mrglavas 2004/03/29 14:55:54 Modified: java/src/org/apache/xerces/impl/xs/traversers XSDHandler.java Log: Fixing Bug #28022:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28022 We keep a static pool of schema validators for use by DOM normalizer. If a validator had been previously used and it had an error-handler registered and another document later gets this validator but it offers no error-handler then XSDHandler would throw a NPE when trying to set the error handler to null on the schema parser. Set the DefaultErrorHandler on the schema parser to unregister the old error handler (if there was one). Thanks to Neil Delima for investigating this bug and verifying the fix. Revision Changes Path 1.77 +3 -2 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java Index: XSDHandler.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- XSDHandler.java 24 Feb 2004 22:59:14 -0000 1.76 +++ XSDHandler.java 29 Mar 2004 22:55:54 -0000 1.77 @@ -41,6 +41,7 @@ import org.apache.xerces.impl.xs.opti.ElementImpl; import org.apache.xerces.impl.xs.opti.SchemaParsingConfig; import org.apache.xerces.impl.xs.util.SimpleLocator; +import org.apache.xerces.util.DefaultErrorHandler; import org.apache.xerces.util.DOMUtil; import org.apache.xerces.util.SymbolTable; import org.apache.xerces.util.XMLSymbols; @@ -1578,7 +1579,7 @@ // than checking its value. Don't set the ERROR_HANDLER // property unless it's actually changed. if (currErrorHandler != fSchemaParser.getProperty(ERROR_HANDLER)) { - fSchemaParser.setProperty(ERROR_HANDLER, currErrorHandler); + fSchemaParser.setProperty(ERROR_HANDLER, (currErrorHandler != null) ? currErrorHandler : new DefaultErrorHandler()); } } catch (XMLConfigurationException e) { } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]