xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18676] New: - TreeWalker.setCurrentNode(null) does not raise a NOT_SUPPORTED_ERR
Date Thu, 03 Apr 2003 23:08:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18676>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18676

TreeWalker.setCurrentNode(null) does not raise a NOT_SUPPORTED_ERR

           Summary: TreeWalker.setCurrentNode(null) does not raise a
                    NOT_SUPPORTED_ERR
           Product: Xerces2-J
           Version: 2.4.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Other
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: nddelima@ca.ibm.com


A NOT_SUPPORTED_ERR is not raised for TreeWalker.setCurrentNode if an attempt 
is made to set currentNode to null.

Patch:

Index: TreeWalkerImpl.java
===================================================================
RCS file: /home/cvspublic/xml-
xerces/java/src/org/apache/xerces/dom/TreeWalkerImpl.java,v
retrieving revision 1.7
diff -u -r1.7 TreeWalkerImpl.java
--- TreeWalkerImpl.java	9 Aug 2002 15:18:15 -0000	1.7
+++ TreeWalkerImpl.java	3 Apr 2003 14:40:23 -0000
@@ -60,6 +60,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.traversal.NodeFilter;
 import org.w3c.dom.traversal.TreeWalker;
+import org.w3c.dom.DOMException;
 
 /** This class implements the TreeWalker interface. */
 /**
@@ -134,6 +135,10 @@
     }
     /** Return the current Node. */
     public void               setCurrentNode(Node node) {
+    	if (node == null) {
+            String msg = DOMMessageFormatter.formatMessage
(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
+            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
+        }
         fCurrentNode = node;
     }

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


Mime
View raw message