diff options
Diffstat (limited to 'javax/swing/text/GapContent.java')
-rw-r--r-- | javax/swing/text/GapContent.java | 6 |
1 files changed, 5 insertions, 1 deletions
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); |