<Swing Dev>  Review Request: 8213516 jck test api/javax_accessibility/AccessibleState/fields.html fails intermittent
Sergey.Bylokhov at oracle.com
Mon Apr 29 08:06:48 UTC 2019
Please review the fix for JDK 13.
We have a bug in our implementation of the cache in the AccessibleBundle class. The current cache should cache the "value" per compound key "locale+name_bundle", but the only locale is used. The problem is reproduced when we try to use different resource bundles for one locale.
One of the previous version of the fix was sent here:
Since this is a cache I have an assumption that the performance of this code matters. So I decided to measure the difference before/after the fix, and w/o cache of AccessibleRole.LABEL.toDisplayString(Locale.ENGLISH);
BEFORE: 25.826 ops/MICROSECONDS
AFTER: 5.459 ops/MICROSECONDS
WITHOUT CACHE 11.015 ops/MICROSECONDS
This cache was added in jdk 1.3 in 1999 using this description: "Obtaining resource bundles can be expensive,...A time performance improvement can be made if we cache the resource bundles by locale. We probably should also see if ResourceBundle itself caches these for us"
I have checked that the current implementation of ResourceBundle caches its state and our implementation does not provide any real benefit.
Best regards, Sergey.
More information about the swing-dev