You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2004/03/29 18:24:52 UTC

DO NOT REPLY [Bug 28020] New: - Reset problem with ErrorHandlers

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28020>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28020

Reset problem with ErrorHandlers

           Summary: Reset problem with ErrorHandlers
           Product: Xerces2-J
           Version: 2.6.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XML Schema Structures
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: nnissar@ca.ibm.com


A Null Pointer Exception is encountered as a result of attempting to set a 
feature in a hashtable to null in XSDHandler class.

>From Neil Delima: 

XMLErrorHandler currErrorHandler = fErrorReporter.getErrorHandler();
if (currErrorHandler != fSchemaParser.getProperty +(ERROR_HANDLER)) {
      	fSchemaParser.setProperty(ERROR_HANDLER, currErrorHandler);
}

So if for the same parser:

Parse 1: 	If Error_Handler = "myErrHandler"
		reset {
		=>currErrorHandler  =  "myErrHandler"
		=>fSchemaParser.getProperty(ERROR_HANDLER) = null
		=>Enter if and fSchemaParser.getProperty(ERROR_HANDLER) 
= "myErrHandler"
		} 
 
Parse 2:  	If Error_Handler = null
		reset {
		=>currErrorHandler  =  null
		=>fSchemaParser.getProperty(ERROR_HANDLER) = "myErrHandler"
		=>Enter if and set the property (in the hastable) to null 
		}

Hence the NPE.  Adding currErrorHandler!=null in the check fixes the bug.

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