cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/sax XMLByteStreamInterpreter.java
Date Thu, 31 May 2001 15:07:03 GMT
cziegeler    01/05/31 08:07:02

  Modified:    src/org/apache/cocoon/components/sax
                        XMLByteStreamInterpreter.java
  Log:
  Fix for AIOOBE - reported by Tim Klaasen
  
  Revision  Changes    Path
  1.4       +7 -7      xml-cocoon2/src/org/apache/cocoon/components/sax/XMLByteStreamInterpreter.java
  
  Index: XMLByteStreamInterpreter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/sax/XMLByteStreamInterpreter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLByteStreamInterpreter.java	2001/05/22 14:36:46	1.3
  +++ XMLByteStreamInterpreter.java	2001/05/31 15:06:56	1.4
  @@ -20,7 +20,7 @@
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2001/05/22 14:36:46 $
  + * @version CVS $Revision: 1.4 $ $Date: 2001/05/31 15:06:56 $
    */
   
   public final class XMLByteStreamInterpreter
  @@ -87,14 +87,14 @@
                   case CHARACTERS:
                       char[] chars = this.readChars();
                       int len = chars.length;
  -                    while (chars[len-1]==0) len--;
  -                    contentHandler.characters(chars, 0, len);
  +                    while (len > 0 && chars[len-1]==0) len--;
  +                    if (len > 0) contentHandler.characters(chars, 0, len);
                       break;
                   case IGNORABLE_WHITESPACE:
                       char[] spaces = this.readChars();
                       len = spaces.length;
  -                    while (spaces[len-1]==0) len--;
  -                    contentHandler.characters(spaces, 0, len);
  +                    while (len > 0 && spaces[len-1]==0) len--;
  +                    if (len > 0) contentHandler.characters(spaces, 0, len);
                       break;
                   case PROCESSING_INSTRUCTION:
                       contentHandler.processingInstruction(this.readString(), this.readString());
  @@ -103,8 +103,8 @@
                       chars = this.readChars();
                       if (this.lexicalHandler != null) {
                           len = chars.length;
  -                        while (chars[len-1]==0) len--;
  -                        lexicalHandler.comment(chars, 0, len);
  +                        while (len > 0 && chars[len-1]==0) len--;
  +                        if (len > 0) lexicalHandler.comment(chars, 0, len);
                       }
                       break;
                   default:
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message