[ 
http://issues.apache.org/jira/browse/XERCESJ-1068?page=comments#action_63329 ]
     
Michael Glavassevich commented on XERCESJ-1068:
-----------------------------------------------

In what context is this a problem? I should note that XSNamedMap4Types is not 
intended for general use. When created by the parser all of the members of the 
fNamespaces array should be internalized strings. This allows object reference 
comparison with namespace.intern(). If each member of fNamespaces is not 
internalized then there's probably a bug somewhere else.

> XSNamedMap4Types.java: Doing Object comparison when Strings are compared
> ------------------------------------------------------------------------
>
>          Key: XERCESJ-1068
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1068
>      Project: Xerces2-J
>         Type: Bug
>   Components: XML Schema datatypes
>     Versions: 2.6.2
>     Reporter: Anil Saldhana

>
> public XSObject itemByName(String namespace, String localName) {
>         if (namespace != null)
>             namespace = namespace.intern();
>         for (int i = 0; i < fNSNum; i++) {
>             if (namespace == fNamespaces[i]) {
>                 XSTypeDefinition type = 
> (XSTypeDefinition)fMaps[i].get(localName);
>                 // only return it if it mataches the required type
>                 if (type.getTypeCategory() == fType)
>                     return type;
>                 return null;
>             }
>         }
>         return null;
>     }
> You are doing object comparison, when you should be doing the following:
> if(namespace.equals(fNamespaces[i]))

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to