summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schuster <theBohemian@gmx.net>2006-03-05 22:44:35 +0000
committerRobert Schuster <theBohemian@gmx.net>2006-03-05 22:44:35 +0000
commit55af66a46a67ba3a88feaa2e2c4306b40e52b6fb (patch)
tree2e25d5f92e5b8ae425030775f4af01a029e729d0
parent1efb8de05f013c52ccef376e93e93a44164cf508 (diff)
downloadclasspath-55af66a46a67ba3a88feaa2e2c4306b40e52b6fb.tar.gz
2006-03-05 Robert Schuster <robertschuster@fsfe.org>
* javax/swing/text/GapContent.java: (insertString): Throw exception when argument is below zero.
-rw-r--r--ChangeLog6
-rw-r--r--javax/swing/text/GapContent.java6
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f6936a3f..12a434b11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-05 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/text/GapContent.java:
+ (insertString): Throw exception when argument is below
+ zero.
+
2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
* 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);