You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2001/03/19 22:06:17 UTC
[Bug 1028] New - DeferredAttrNSImpl namespaceURI fix can force null exception
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1028
*** shadow/1028 Mon Mar 19 13:06:17 2001
--- shadow/1028.tmp.7080 Mon Mar 19 13:06:17 2001
***************
*** 0 ****
--- 1,51 ----
+ +============================================================================+
+ | DeferredAttrNSImpl namespaceURI fix can force null exception |
+ +----------------------------------------------------------------------------+
+ | Bug #: 1028 Product: Xerces-J |
+ | Status: NEW Version: cvs extract (inc |
+ | Resolution: Platform: PC |
+ | Severity: Major OS/Version: Linux |
+ | Priority: Medium Component: DOM |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xerces-j-dev@xml.apache.org |
+ | Reported By: saurik@saurik.com |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ CVS from 2001/03/19 20:30 GMT.
+
+ The following change:
+
+ revision 1.12
+ date: 2001/03/08 03:44:36; author: lehors; state: Exp; lines: +2 -2
+ treat empty namespaceURI as null when it is a namespace declaration
+
+ :is slightly off. I had sent a patch for this about 2 weeks before this
+ modification to the xerces-j-dev mailing list (not knowing about the bug
+ system, had just resigned myself back up to the xerces-j-dev mailing list after
+ everyone was knocked off of it before), and this came out of it. Instead of
+ using .equals("") lehors used .length() == 0, however he also changed the || to
+ an && which really should cause it to throw an exception every time it hits
+ this point (albeit I admit I haven't tested it). Here is a patch:
+
+ Index: java/src/org/apache/xerces/dom/DeferredAttrNSImpl.java
+ ===================================================================
+ RCS file: /home/cvspublic/xml-
+ xerces/java/src/org/apache/xerces/dom/DeferredAttrNSImpl.java,v
+ retrieving revision 1.12
+ diff -u -r1.12 DeferredAttrNSImpl.java
+ --- java/src/org/apache/xerces/dom/DeferredAttrNSImpl.java 2001/03/08
+ 03:44:36 1.12
+ +++ java/src/org/apache/xerces/dom/DeferredAttrNSImpl.java 2001/03/19
+ 20:56:26
+ @@ -157,7 +157,7 @@
+ // to be bound to "http://www.w3.org/2000/xmlns/"
+ // So as long as the XML parser doesn't do it, it needs to
+ // done here.
+ - if (namespaceURI == null && namespaceURI.length() == 0) {
+ + if (namespaceURI == null || namespaceURI.length() == 0) {
+ if (prefix != null) {
+ if (prefix.equals("xmlns")) {
+ namespaceURI = "http://www.w3.org/2000/xmlns/";
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org