xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject cvs commit: xml-xerces/java/src/org/apache/xerces/parsers AbstractDOMParser.java
Date Mon, 16 Feb 2004 05:43:11 GMT
mrglavas    2004/02/15 21:43:11

  Modified:    java/src/org/apache/xerces/parsers AbstractDOMParser.java
  Log:
  Bug #26613. Making code consistent with startDocument by checking for default document class
name.
  This is the right thing to do since we load DocumentImpl statically.
  
  Revision  Changes    Path
  1.106     +16 -14    xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java
  
  Index: AbstractDOMParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- AbstractDOMParser.java	12 Feb 2004 23:26:06 -0000	1.105
  +++ AbstractDOMParser.java	16 Feb 2004 05:43:11 -0000	1.106
  @@ -368,23 +368,25 @@
               documentClassName = DEFAULT_DOCUMENT_CLASS_NAME;
           }
           
  -        // verify that this class exists and is of the right type
  -        try {
  -            Class _class = ObjectFactory.findProviderClass (documentClassName,
  -            ObjectFactory.findClassLoader (), true);
  -            //if (!_class.isAssignableFrom(Document.class)) {
  -            if (!Document.class.isAssignableFrom (_class)) {
  +        if (!documentClassName.equals(DEFAULT_DOCUMENT_CLASS_NAME)) {
  +            // verify that this class exists and is of the right type
  +            try {
  +                Class _class = ObjectFactory.findProviderClass (documentClassName,
  +                ObjectFactory.findClassLoader (), true);
  +                //if (!_class.isAssignableFrom(Document.class)) {
  +                if (!Document.class.isAssignableFrom (_class)) {
  +                    throw new IllegalArgumentException (
  +                        DOMMessageFormatter.formatMessage(
  +                        DOMMessageFormatter.DOM_DOMAIN,
  +                        "InvalidDocumentClassName", new Object [] {documentClassName}));
  +                }
  +            }
  +            catch (ClassNotFoundException e) {
                   throw new IllegalArgumentException (
                       DOMMessageFormatter.formatMessage(
                       DOMMessageFormatter.DOM_DOMAIN,
  -                    "InvalidDocumentClassName", new Object [] {documentClassName}));
  +                    "MissingDocumentClassName", new Object [] {documentClassName}));
               }
  -        }
  -        catch (ClassNotFoundException e) {
  -            throw new IllegalArgumentException (
  -                DOMMessageFormatter.formatMessage(
  -                DOMMessageFormatter.DOM_DOMAIN,
  -                "MissingDocumentClassName", new Object [] {documentClassName}));
           }
           
           // set document class name
  
  
  

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


Mime
View raw message