mrglavas    2004/05/27 19:43:35

  Modified:    java/src/org/apache/xerces/dom DocumentFragmentImpl.java
                        ElementImpl.java AttrImpl.java
  Log:
  Fixing Jira Bug #966:

  http://nagoya.apache.org/jira/browse/XERCESJ-966

  

  We weren't checking if the nodeValue for the text node

  is null during execution of Node.normalize(). Thanks to

  Antonio Arena and Neil Delima for pointing out these 

  problems. This fixes some potential NPEs.

  
  Revision  Changes    Path
  1.13      +3 -2      
xml-xerces/java/src/org/apache/xerces/dom/DocumentFragmentImpl.java
  
  Index: DocumentFragmentImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DocumentFragmentImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DocumentFragmentImpl.java 24 Feb 2004 23:23:17 -0000      1.12
  +++ DocumentFragmentImpl.java 28 May 2004 02:43:35 -0000      1.13
  @@ -135,8 +135,9 @@
                   else
                   {
                       // If kid is empty, remove it
  -                    if ( kid.getNodeValue().length()==0 )
  +                    if ( kid.getNodeValue() == null || kid.getNodeValue().length() 
== 0 ) {
                           removeChild( kid );
  +                    }
                   }
               }
   
  
  
  
  1.66      +3 -2      xml-xerces/java/src/org/apache/xerces/dom/ElementImpl.java
  
  Index: ElementImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ElementImpl.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- ElementImpl.java  24 Feb 2004 23:23:17 -0000      1.65
  +++ ElementImpl.java  28 May 2004 02:43:35 -0000      1.66
  @@ -340,8 +340,9 @@
                   else
                   {
                       // If kid is empty, remove it
  -                    if ( kid.getNodeValue().length()==0 )
  +                    if ( kid.getNodeValue() == null || kid.getNodeValue().length() 
== 0 ) {
                           removeChild( kid );
  +                    }
                   }
               }
   
  
  
  
  1.58      +3 -2      xml-xerces/java/src/org/apache/xerces/dom/AttrImpl.java
  
  Index: AttrImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttrImpl.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- AttrImpl.java     19 May 2004 19:16:57 -0000      1.57
  +++ AttrImpl.java     28 May 2004 02:43:35 -0000      1.58
  @@ -555,8 +555,9 @@
                   else
                   {
                       // If kid is empty, remove it
  -                    if ( kid.getNodeValue().length()==0 )
  +                    if ( kid.getNodeValue() == null || kid.getNodeValue().length() 
== 0 ) {
                           removeChild( kid );
  +                    }
                   }
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to