dev@jaxb.java.net

why does jaxb compare strings with == instead of .equals

From: jtmelton <jtmelton_at_gmail.com>
Date: Wed, 3 Jun 2009 13:16:58 -0700 (PDT)

I wanted to ask why JAXB compares strings with the equals operator (==)
instead of the equals method. My understanding is that the equals method
only works when comparing the same object or 2 strings that have both been
initialized to the same value via the standard double quote initialization.
In this case, it appears that an initialized string is being compared to a
method parameter. Why would JAXB do it this way?

As an example please look at the leaveElement method at this link.
http://java.sun.com/developer/technicalArticles/WebServices/jaxb/CollectionTypeImpl.java
http://java.sun.com/developer/technicalArticles/WebServices/jaxb/CollectionTypeImpl.java

Any help is greatly appreciated.
-- 
View this message in context: http://www.nabble.com/why-does-jaxb-compare-strings-with-%3D%3D-instead-of-.equals-tp23858658p23858658.html
Sent from the java.net - jaxb dev mailing list archive at Nabble.com.