From 55af66a46a67ba3a88feaa2e2c4306b40e52b6fb Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Sun, 5 Mar 2006 22:44:35 +0000 Subject: 2006-03-05 Robert Schuster * javax/swing/text/GapContent.java: (insertString): Throw exception when argument is below zero. --- ChangeLog | 6 ++++++ javax/swing/text/GapContent.java | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4f6936a3f..12a434b11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-05 Robert Schuster + + * javax/swing/text/GapContent.java: + (insertString): Throw exception when argument is below + zero. + 2006-03-05 David Gilbert * javax/swing/plaf/metal/MetalComboBoxButton.java diff --git a/javax/swing/text/GapContent.java b/javax/swing/text/GapContent.java index f5ab7f2b2..28d1d6ee0 100644 --- a/javax/swing/text/GapContent.java +++ b/javax/swing/text/GapContent.java @@ -347,8 +347,12 @@ public class GapContent int length = length(); int strLen = str.length(); + if (where < 0) + throw new BadLocationException("The where argument cannot be smaller" + + " than the zero", where); + if (where >= length) - throw new BadLocationException("the where argument cannot be greater" + throw new BadLocationException("The where argument cannot be greater" + " than the content length", where); replace(where, 0, str.toCharArray(), strLen); -- cgit v1.2.1