We're updating the issue view to help you get more done. 

ULocale.forLocale CACHE ineffective

Description

The CACHE HashMap used in conjunction with ULocale.forLocale is completely
ineffective due to problematic conditional tests in the forLocale method. In
essence, a non-null value retrieved from the CACHE map is always ignored and a
new ULocale instance is always created. To fix, change the logic in forLocale
from:

1 2 3 4 5 6 7 ULocale result = (ULocale)CACHE.get(loc); if (result == null && defaultULocale != null && loc == defaultULocale.locale) { result = defaultULocale; } else { result = new ULocale(loc.toString(), loc); }

to:

1 2 3 4 5 6 7 8 ULocale result = (ULocale)CACHE.get(loc); if (result == null) { if (defaultULocale != null && loc == defaultULocale.locale) { result = defaultULocale; } else { result = new ULocale(loc.toString(), loc); } }

Status

Assignee

Douglas Felt

Reporter

TracBot

Labels

None

Reviewer

None

Time Needed

Hours

Start date

None

Components

Priority

minor