You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Robert Hu (JIRA)" <ji...@apache.org> on 2006/09/21 10:52:23 UTC
[jira] Commented: (HARMONY-1514) [classlib][util]
Locale.getAvailableLocales returns duplicate data
[ http://issues.apache.org/jira/browse/HARMONY-1514?page=comments#action_12436473 ]
Robert Hu commented on HARMONY-1514:
------------------------------------
I found that the problem lies on "Locale[] java.util.Locale.find(String prefix)".
In this method, Harmony find locale data from class file and ZIP/JAR file, and usually include duplicate locale data. Because Harmony use Locale array to store the result, so the duplicate locales are kept.
I'll upload the patch to fix it.
> [classlib][util] Locale.getAvailableLocales returns duplicate data
> ------------------------------------------------------------------
>
> Key: HARMONY-1514
> URL: http://issues.apache.org/jira/browse/HARMONY-1514
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Robert Hu
> Priority: Minor
>
> Following test shows that Harmony returns duplicate data.
> Locale[] locales = Locale.getAvailableLocales();
> Set<Locale> localesSet = new HashSet<Locale>(Arrays.asList(locales));
> assertEquals(localesSet.size(),locales.length);
> RI: Pass
> Harmony: junit.framework.AssertionFailedError: expected:<190> but was:<380>
> If we print out locales by "System.out.println(Arrays.toString(locales));" on Harmony, we'll find that Harmony print out all the locales twice. It's the reason why above test case fails. (Set will filter the same locales).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira