FULL PRODUCT VERSION :
java version "1.6.0_20"
A DESCRIPTION OF THE PROBLEM :
With Java 6 it isn't possible anymore to override ListResourceBundle for other locale definitions.
Overriding classes are never called, so overriding has no effect anymore.
Same behaviour for every language/country.
With Java4 it worked fine.
REGRESSION. Last worked in version 6
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Implement new class:
package sun.text.resources;
import java.util.ListResourceBundle;
public class LocaleElements_cs_EU extends ListResourceBundle
{
public LocaleElements_cs_EU()
{
}
public Object[][] getContents()
{
return (new Object[][]{new Object[]{"DateTimeElements", new String[]{"2", "4"}}});
}
}
And start program/server with
"-Duser.language=cs
-Duser.country=EU"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The new defintion for DateTimeElements should be used if the server settings are
"-Duser.language=cs
-Duser.country=EU"
ACTUAL -
Class was never called.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error message and nothing called.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class LocaleElements_cs_EUTest extends FdBaseTestCase
{
public void testLocaleElements_cs_EU()
{
Calendar cal_cs = Calendar.getInstance(new Locale("cs"));
Calendar cal_cs_EU = Calendar.getInstance(new Locale("cs", "EU"));
int kalenderWoche1;
int kalenderWoche2;
cal_cs_EU.setTimeInMillis(FdDateSupport.getDate(2004, 12, 27).getTime());
kalenderWoche1 = cal_cs_EU.get(Calendar.WEEK_OF_YEAR);
cal_cs_EU.setTimeInMillis(FdDateSupport.getDate(2004, 12, 26).getTime());
kalenderWoche2 = cal_cs_EU.get(Calendar.WEEK_OF_YEAR);
assertTrue("Wrong", kalenderWoche1 == kalenderWoche2 + 1);
cal_cs_EU.setTimeInMillis(FdDateSupport.getDate(1995, 1, 1).getTime());
cal_cs.setTimeInMillis(FdDateSupport.getDate(1995, 1, 1).getTime());
assertTrue("Wrong", cal_cs_EU.get(Calendar.WEEK_OF_YEAR) == 52);
cal_cs_EU.setTimeInMillis(FdDateSupport.getDate(2005, 1, 1).getTime());
assertTrue("Wrong", cal_cs_EU.get(Calendar.WEEK_OF_YEAR) == 53);
cal_cs_EU.setTimeInMillis(FdDateSupport.getDate(1999, 1, 1).getTime());
assertTrue("Wrong", cal_cs_EU.get(Calendar.WEEK_OF_YEAR) == 53);
cal_cs_EU.setTimeInMillis(FdDateSupport.getDate(2004, 1, 1).getTime());
assertTrue("Wrong", cal_cs_EU.get(Calendar.WEEK_OF_YEAR) == 1);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
No workaround yet.