Hi, Sun's GapContent.insertString does not like it when the where argument is below zero and throws a BadLocationException. That exception should be visible when an instance of that class is used by PlainDocument. There is already a mauve test which relies on that.
This small patch fixes that and makes the test pass.
@Mark: Please let this go into the release branch.
2006-03-05 Robert Schuster <[EMAIL PROTECTED]>
* javax/swing/text/GapContent.java:
(insertString): Throw exception when argument is below
zero.
cya
Robert
Index: javax/swing/text/GapContent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/GapContent.java,v
retrieving revision 1.41
diff -u -r1.41 GapContent.java
--- javax/swing/text/GapContent.java 4 Mar 2006 06:25:02 -0000 1.41
+++ javax/swing/text/GapContent.java 5 Mar 2006 22:44:05 -0000
@@ -347,8 +347,12 @@
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);
signature.asc
Description: OpenPGP digital signature
