RFR  8151384: Examine sun.misc.ASCIICaseInsensitiveComparator
peter.levart at gmail.com
Wed Mar 9 16:31:50 UTC 2016
On 03/09/2016 05:10 PM, Claes Redestad wrote:
> On 2016-03-09 16:58, Peter Levart wrote:
>>> Can this really happen? ASCIICaseInsensitiveComparator was asserting
>>> string characters were ASCII, so this situation would have triggered
>>> an assert
>>> with the old code, no?
>> If assertions were..
> Stahp! Attributes.Name constructor validates that all charachters in
> name is in [0-9a-zA-Z-_], so I think we're good from a correctness
> perspective already.
> The code you wrote to do this looks like a performance win since it
> avoids the lower-casing.
It is actually not a performance win (at least the benchmark doesn't
show it as a win). Probably because it goes through upper-casing and
lower-casing vs. just lower-casing and construction of new String.
> Doesn't seem worth it for Attributes alone, but maybe there's demand
> for such a utility elsewhere?
It would be good to have it just so that other programmers don't roll
their own versions that might or might not be consistent with
More information about the core-libs-dev