mmidy 01/08/29 13:49:48
Modified: java/src/org/apache/xpath/compiler Lexer.java
Log:
Fix for Bugzilla 2684 StringIndexOutOfBounds Exception. Check if we are at
the end of the pattern string.
Revision Changes Path
1.8 +2 -2 xml-xalan/java/src/org/apache/xpath/compiler/Lexer.java
Index: Lexer.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/Lexer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Lexer.java 2001/07/27 22:47:00 1.7
+++ Lexer.java 2001/08/29 20:49:48 1.8
@@ -196,7 +196,7 @@
for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\"'); i++);
- if (c == '\"')
+ if (c == '\"' && i < nChars)
{
addToTokenQueue(pat.substring(startSubstring, i + 1));
@@ -230,7 +230,7 @@
for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\''); i++);
- if (c == '\'')
+ if (c == '\'' && i < nChars)
{
addToTokenQueue(pat.substring(startSubstring, i + 1));
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]