You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2003/11/07 08:21:42 UTC

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

neeraj      2003/11/06 23:21:42

  Modified:    java     build.xml
               java/src/org/apache/xerces/dom ElementImpl.java
                        ElementNSImpl.java
  Log:
  Fixing NPE.
  
  Revision  Changes    Path
  1.143     +2 -2      xml-xerces/java/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/build.xml,v
  retrieving revision 1.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- build.xml	27 Oct 2003 02:06:39 -0000	1.142
  +++ build.xml	7 Nov 2003 07:21:42 -0000	1.143
  @@ -50,7 +50,7 @@
       <echo message= "---------------- ${parser.Name} ${parser.Version} [${year}] ---------------"/>
       <!-- changed made to synchronize with a patch from Sam Ruby (<ru...@apache.org>) to Xerces1
       <property name="build.compiler" value="classic"/> -->
  -    <property name="debug" value="off"/>
  +    <property name="debug" value="on"/>
       <property name="optimize" value="on"/>
       <property name="deprecation" value="off"/>
   
  
  
  
  1.60      +5 -3      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.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- ElementImpl.java	30 Oct 2003 06:28:54 -0000	1.59
  +++ ElementImpl.java	7 Nov 2003 07:21:42 -0000	1.60
  @@ -228,7 +228,8 @@
   
           //2.the base URI of the element's parent element within the document or external entity,
           //if one exists
  -        String parentElementBaseURI = this.parentNode().getBaseURI() ;
  +
  +        String parentElementBaseURI = (this.parentNode() != null) ? this.parentNode().getBaseURI() : null ;
           //base URI of parent element is not null
           if(parentElementBaseURI != null){
               try {
  @@ -242,7 +243,8 @@
           }
           //3. the base URI of the document entity or external entity containing the element
   
  -        String baseURI = this.ownerNode.getBaseURI();
  +        //REVISIT: we are using ownerNode -- we need to return the base URI of the document entity
  +        String baseURI = (this.ownerNode != null) ? this.ownerNode.getBaseURI() : null ;
   
           if(baseURI != null){
               try {
  
  
  
  1.36      +3 -3      xml-xerces/java/src/org/apache/xerces/dom/ElementNSImpl.java
  
  Index: ElementNSImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ElementNSImpl.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- ElementNSImpl.java	31 Oct 2003 10:10:24 -0000	1.35
  +++ ElementNSImpl.java	7 Nov 2003 07:21:42 -0000	1.36
  @@ -399,7 +399,7 @@
   
           //2.the base URI of the element's parent element within the document or external entity,
           //if one exists
  -        String parentElementBaseURI = this.parentNode().getBaseURI() ;
  +        String parentElementBaseURI = (this.parentNode() != null) ? this.parentNode().getBaseURI() : null ;
           //base URI of parent element is not null
           if(parentElementBaseURI != null){
               try {
  @@ -413,7 +413,7 @@
           }
           //3. the base URI of the document entity or external entity containing the element
   
  -        String baseURI = this.ownerNode.getBaseURI();
  +        String baseURI = (this.ownerNode != null) ? this.ownerNode.getBaseURI() : null ;
   
           if(baseURI != null){
               try {
  
  
  

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