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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to