xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mm...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xpath/compiler Lexer.java
Date Wed, 12 Sep 2001 20:01:02 GMT
mmidy       01/09/12 13:01:02

  Modified:    java/src/org/apache/xpath/compiler Lexer.java
  Log:
  Bug 2140: Catch index out of bounds exception
  
  Revision  Changes    Path
  1.9       +18 -15    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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Lexer.java	2001/08/29 20:49:48	1.8
  +++ Lexer.java	2001/09/12 20:01:02	1.9
  @@ -348,26 +348,29 @@
           addToTokenQueue(pat.substring(i, i + 1));
           break;
         case ':' :
  -        if (posOfNSSep == (i - 1))
  +        if (i>0)
           {
  -          if (startSubstring != -1)
  +          if (posOfNSSep == (i - 1))
             {
  -            if (startSubstring < (i - 1))
  -              addToTokenQueue(pat.substring(startSubstring, i - 1));
  -          }
  +            if (startSubstring != -1)
  +            {
  +              if (startSubstring < (i - 1))
  +                addToTokenQueue(pat.substring(startSubstring, i - 1));
  +            }
   
  -          isNum = false;
  -          isAttrName = false;
  -          startSubstring = -1;
  -          posOfNSSep = -1;
  +            isNum = false;
  +            isAttrName = false;
  +            startSubstring = -1;
  +            posOfNSSep = -1;
   
  -          addToTokenQueue(pat.substring(i - 1, i + 1));
  +            addToTokenQueue(pat.substring(i - 1, i + 1));
   
  -          break;
  -        }
  -        else
  -        {
  -          posOfNSSep = i;
  +            break;
  +          }
  +          else
  +          {
  +            posOfNSSep = i;
  +          }
           }
   
         // fall through on purpose
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message