neeraj 2003/10/31 03:11:46
Modified: java/src/org/apache/xerces/dom CoreDocumentImpl.java
Log:
Fixing another bug. The method Document.adoptNode() throws NullPointerException in
case when an
attribute node is adopted
Revision Changes Path
1.46 +8 -4 xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java
Index: CoreDocumentImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- CoreDocumentImpl.java 31 Oct 2003 09:45:31 -0000 1.45
+++ CoreDocumentImpl.java 31 Oct 2003 11:11:46 -0000 1.46
@@ -1614,10 +1614,14 @@
case ATTRIBUTE_NODE: {
AttrImpl attr = (AttrImpl) node;
// remove node from wherever it is
- attr.getOwnerElement().removeAttributeNode(attr);
- // mark it as specified
+ if( attr.getOwnerElement() != null){
+ //1. owner element attribute is set to null
+ attr.getOwnerElement().removeAttributeNode(attr);
+ }
+ //2. specified flag is set to true
attr.isSpecified(true);
- // change ownership
+
+ //3. change ownership
attr.setOwnerDocument(this);
break;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]