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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]