This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Hashtable, RuleBasedCollator and natIconv (again)


>>>>> "Vladimir" == Vladimir Pu¹ka¹ <vpuskas at eunet dot 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.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]