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 2001/12/14 03:08:19 UTC

DO NOT REPLY [Bug 5425] New: - String comparison uses '==' instead of String.equals()

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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5425

String comparison uses '==' instead of String.equals()

           Summary: String comparison uses '==' instead of String.equals()
           Product: Xerces2-J
           Version: 2.0.0 [beta 3]
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Other
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: sanjoy@yahoo.com


In XSDHandler.java method

    protected Object getGlobalDecl(XSDocumentInfo currSchema,
                                   int declType,
                                   QName declToTraverse) {

on line 734, the code is

        if (declToTraverse.uri != null &&
            declToTraverse.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA) {

This test naturally fails because declToTraverse.uri and 
SchemaSymbols.URI_SCHEMAFORSCHEMA are distinct java.lang.String's with the same 
chars.

This causes it to NOT recognize xsd:string as a simple type.

Just changing '==' to String.equals() make this work just fine.

This is a critical bug for us as we are planning to use Xerces for our 
validating parser.

Thanks,
Sanjoy Ghosh
Tibco Software Inc.

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