You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/12/12 04:23:10 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/dom DeferredDocumentImpl.java

andyc       00/12/11 19:23:10

  Modified:    java/src/org/apache/xerces/dom DeferredDocumentImpl.java
  Log:
  Fix for NullPointerException caused by deferred DOM impl
  when in non-validating mode AND there are multiple IDs
  declared on the same element.
  
  Submitted by:	Elena Litani (hlitani@ca.ibm.com)
  
  Revision  Changes    Path
  1.21      +6 -2      xml-xerces/java/src/org/apache/xerces/dom/DeferredDocumentImpl.java
  
  Index: DeferredDocumentImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DeferredDocumentImpl.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- DeferredDocumentImpl.java	2000/08/18 01:58:34	1.20
  +++ DeferredDocumentImpl.java	2000/12/12 03:23:10	1.21
  @@ -1346,8 +1346,12 @@
                   fIdName[i] = -1;
   
                   // see if there are more IDs on this element
  -                while (fIdElement[i + 1] == elementNodeIndex) {
  -                    name = fStringPool.toString(fIdName[++i]);
  +                while (i + 1 < fIdCount && fIdElement[i + 1] == elementNodeIndex) {
  +                    idNameIndex = fIdName[++i];
  +                    if (idNameIndex == -1) {
  +                        continue;
  +                    }
  +                    name = fStringPool.toString(idNameIndex);
                       putIdentifier0(name, element);
                   }
               }