Benefit from computing String Hash at compile time?
Paul Benedict
pbenedict at apache.org
Fri Dec 18 14:29:01 PST 2009
James,
I concur with your thoughts. It's a risky decision to embed the hash
code into the class file. I can't imagine any other JDK implementation
would attempt this, but perhaps Sun can bet on some things that others
cannot. Regardless, some prominent people disagreed, but I don't think
it changes reality. Either the hash code should forever be made what
it is -- and why couldn't that be done? -- or have an alternate
implementation. I really like your idea of storing the Strings in the
class file and computing their hash when the class loads.
Paul
More information about the coin-dev
mailing list