harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Salikh Zakirov <Salikh.Zaki...@Intel.com>
Subject Re: [drlvm] string interning in java
Date Fri, 28 Jul 2006 16:10:48 GMT
Salikh Zakirov wrote:
>> Subject: [PATCH] Pure java string intern()

I have just been privately asked by a fellow colleague
what the interning is used for.
So I figured it would be nice to describe the answer on the list
too, especially because I am interested in learning something new
on the subject :)

The most important reason I know is that interning
is required by the specification.

A particular use case I know is message localization: having string
literals interned by default allows to optimize the lookup
in the message bundles, as we can intern the keys on loading
the bundle, and use object reference comparison later at lookup time.

While I was working on the patch, there was a moment when I screwed
the condition in intern() function, and it worked incorrectly,
and returned incorrect strings sometimes. When I tried to run
Eclipse with the bug, it complained about missing localization
string and terminated by exception.

Any other insights?

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message