You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2001/10/22 22:58:00 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/v2 XSDNotationTraverser.java

sandygao    01/10/22 13:58:00

  Modified:    java/src/org/apache/xerces/impl/v2 XSDNotationTraverser.java
  Log:
  When an attribute is not specified, the value is null, not empty string.
  This fix solves some NPEs.
  
  Revision  Changes    Path
  1.15      +5 -6      xml-xerces/java/src/org/apache/xerces/impl/v2/XSDNotationTraverser.java
  
  Index: XSDNotationTraverser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/v2/XSDNotationTraverser.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XSDNotationTraverser.java	2001/10/22 19:27:15	1.14
  +++ XSDNotationTraverser.java	2001/10/22 20:58:00	1.15
  @@ -75,7 +75,7 @@
    *
    * @author Rahul Srivastava, Sun Microsystems Inc.
    * @author Elena Litani, IBM
  - * @version $Id: XSDNotationTraverser.java,v 1.14 2001/10/22 19:27:15 elena Exp $
  + * @version $Id: XSDNotationTraverser.java,v 1.15 2001/10/22 20:58:00 sandygao Exp $
    */
   class  XSDNotationTraverser extends XSDAbstractTraverser {
   
  @@ -95,15 +95,14 @@
   
           String  publicAttr = (String) attrValues[XSAttributeChecker.ATTIDX_PUBLIC];
           String  systemAttr = (String) attrValues[XSAttributeChecker.ATTIDX_SYSTEM];
  -        if (nameAttr.length() == 0) {
  -            //REVISIT: update error message
  +        if (nameAttr == null) {
               reportGenericSchemaError("<notation> must have a name");
               fAttrChecker.returnAttrArray(attrValues, schemaDoc);
               return null;
           }
   
  -        if (publicAttr.length() == 0 && systemAttr.length() == 0) {
  -            reportGenericSchemaError("Invalid <notation> declaration");
  +        if (publicAttr == null) {
  +            reportGenericSchemaError("<notation> must have 'public' attribute");
           }
   
           XSNotationDecl notation = new XSNotationDecl();
  @@ -128,7 +127,7 @@
                                              "NotationContentRestricted",
                                              args,
                                              XMLErrorReporter.SEVERITY_ERROR);
  -            
  +
           }
           grammar.addGlobalNotationDecl(notation);
           fAttrChecker.returnAttrArray(attrValues, schemaDoc);
  
  
  

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