You are viewing a plain text version of this content. The canonical link for it is here.
Posted to crimson-cvs@xml.apache.org by ed...@apache.org on 2001/01/18 02:10:00 UTC

cvs commit: xml-crimson/src/org/apache/crimson/parser Parser2.java

edwingo     01/01/17 17:10:00

  Modified:    src/org/apache/crimson/parser Parser2.java
  Log:
  Avoid calling getChars on zero-size array as a workaround for a bug that
  occurs in at least JDK1.2.2 which has since been fixed in JDK1.3.
  
  Revision  Changes    Path
  1.2       +8 -3      xml-crimson/src/org/apache/crimson/parser/Parser2.java
  
  Index: Parser2.java
  ===================================================================
  RCS file: /home/cvs/xml-crimson/src/org/apache/crimson/parser/Parser2.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Parser2.java	2000/11/23 01:53:33	1.1
  +++ Parser2.java	2001/01/18 01:09:58	1.2
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Parser2.java,v 1.1 2000/11/23 01:53:33 edwingo Exp $
  + * $Id: Parser2.java,v 1.2 2001/01/18 01:09:58 edwingo Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -118,7 +118,7 @@
    * @author David Brownell
    * @author Rajiv Mordani
    * @author Edwin Goei
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class Parser2
   {
  @@ -925,7 +925,12 @@
               // Convert string to array of chars
               int length = strTmp.length();
               char[] charArray = new char[length];
  -            strTmp.getChars(0, length, charArray, 0);
  +            if (length != 0) {
  +                // XXX Avoid calling getChars on zero-size array as a
  +                // workaround for a bug that occurs in at least JDK1.2.2
  +                // which has since been fixed in JDK1.3
  +                strTmp.getChars(0, length, charArray, 0);
  +            }
               lexicalHandler.comment(charArray, 0, length);
           }
           return true;