venu        2003/09/08 08:32:24

  Modified:    java/src/org/apache/xerces/dom Tag: jaxp-1_3_0-branch
                        ElementImpl.java
  Log:
  Description : Methods setIdAttribute(), setIdAttributeNS() should  throw 
NOT_FOUND_ERR instead of NullPointerException when attributes are not found.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.58.4.1  +19 -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.58
  retrieving revision 1.58.4.1
  diff -u -r1.58 -r1.58.4.1
  --- ElementImpl.java  16 Jan 2003 22:53:44 -0000      1.58
  +++ ElementImpl.java  8 Sep 2003 15:32:24 -0000       1.58.4.1
  @@ -942,7 +942,15 @@
               synchronizeData();
           }
           Attr at = getAttributeNode(name);
  -        if (ownerDocument.errorChecking) {
  +             
  +             if( at == null){
  +                     String msg = DOMMessageFormatter.formatMessage(
  +                                                                     
DOMMessageFormatter.DOM_DOMAIN, 
  +                                                                     
"NOT_FOUND_ERR", null);
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
  +             }
  +        
  +             if (ownerDocument.errorChecking) {
               if (isReadOnly()) {
                   String msg = 
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
"NO_MODIFICATION_ALLOWED_ERR", null);
                   throw new DOMException(
  @@ -974,7 +982,15 @@
               synchronizeData();
           }
           Attr at = getAttributeNodeNS(namespaceURI, localName);
  -        if (ownerDocument.errorChecking) {
  +             
  +             if( at == null){
  +                     String msg = DOMMessageFormatter.formatMessage(
  +                                                                     
DOMMessageFormatter.DOM_DOMAIN, 
  +                                                                     
"NOT_FOUND_ERR", null);
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
  +             }
  +       
  +             if (ownerDocument.errorChecking) {
               if (isReadOnly()) {
                   String msg = 
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
"NO_MODIFICATION_ALLOWED_ERR", null);
                   throw new DOMException(
  
  
  

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

Reply via email to