Return-Path: Delivered-To: apmail-xml-xerces-cvs-archive@www.apache.org Received: (qmail 58545 invoked from network); 16 Feb 2004 05:43:12 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 16 Feb 2004 05:43:12 -0000 Received: (qmail 71269 invoked by uid 500); 16 Feb 2004 05:42:51 -0000 Delivered-To: apmail-xml-xerces-cvs-archive@xml.apache.org Received: (qmail 71224 invoked by uid 500); 16 Feb 2004 05:42:51 -0000 Mailing-List: contact xerces-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: Delivered-To: mailing list xerces-cvs@xml.apache.org Received: (qmail 71211 invoked from network); 16 Feb 2004 05:42:51 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 16 Feb 2004 05:42:51 -0000 Received: (qmail 58538 invoked by uid 1678); 16 Feb 2004 05:43:11 -0000 Date: 16 Feb 2004 05:43:11 -0000 Message-ID: <20040216054311.58537.qmail@minotaur.apache.org> From: mrglavas@apache.org To: xml-xerces-cvs@apache.org Subject: cvs commit: xml-xerces/java/src/org/apache/xerces/parsers AbstractDOMParser.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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