Hashtable, RuleBasedCollator and natIconv (again)

Tom Tromey tromey@redhat.com
Thu Mar 6 05:42:00 GMT 2003

>>>>> "Vladimir" == Vladimir Pu¹ka¹ <vpuskas@eunet.yu> writes:

Vladimir> Xalan 1.2 (yes, it's old, but it's included with project I
Vladimir> have to build native) has a simple class
Vladimir> "org.apache.xalan.xpath.xml.StringKey".  StringKey caches
Vladimir> hash values of its String for fast lookups when used in
Vladimir> Hashtables. Idea is to fill StringKeys into hashtable, then
Vladimir> using a String (!?!) get values out.

Vladimir> One solution is attached bellow :), other approach would be
Vladimir> to search and replace all hashtable gets in Xalan which use
Vladimir> this little trick :(

I've been thinking about this a bit today.

I think it is really preferable to fix Xalan.  There's nothing in the
Hashtable docs to suggest that this behavior is guaranteed.  Also,
Object.equals() is very clearly defined as an equivalence
relationship, which this is not.


More information about the Java mailing list