Hashtable, RuleBasedCollator and natIconv (again)
Thu Mar 6 05:42:00 GMT 2003
>>>>> "Vladimir" == Vladimir PuÂ¹kaÂ¹ <email@example.com> 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