-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
6u10
-
x86
-
linux
FULL PRODUCT VERSION :
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux ha28c1n6 2.4.21-47.0.1.ELhugemem #1 SMP Fri Oct 13 17:48:02 EDT 2006 i686 i686 i386 GNU/Linux
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
On Hungarian machines with a Locale of “hu_HU” we find that the symbol in date formatters for am/pm which is normally “a” becomes “x” and parsing the date causes a ParseException
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
see attached test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should format properly.
ACTUAL -
causes a parsing exception on all AM parsing
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.internal.runners.JUnit4ClassRunner;
import org.junit.runner.RunWith;
@RunWith(JUnit4ClassRunner.class)
public class TestDate {
private final static String TIME = "1:00:00 am";
private final static String TIME_FORMAT = "h:m:s a";
@Test
public void testUkDateParsing() throws ParseException
{
Locale.setDefault(Locale.UK);
SimpleDateFormat formatter = new SimpleDateFormat(TIME_FORMAT);
formatter.parse(TIME);
Assert.assertEquals(TIME_FORMAT, formatter.toLocalizedPattern());
}
@Test
public void testHungarianDateParsing() throws ParseException
{
Locale.setDefault(new Locale("hu", "HU"));
SimpleDateFormat formatter = new SimpleDateFormat(TIME_FORMAT);
formatter.parse(TIME);
Assert.assertEquals(TIME_FORMAT, formatter.toLocalizedPattern());
}
}
---------- END SOURCE ----------
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux ha28c1n6 2.4.21-47.0.1.ELhugemem #1 SMP Fri Oct 13 17:48:02 EDT 2006 i686 i686 i386 GNU/Linux
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
On Hungarian machines with a Locale of “hu_HU” we find that the symbol in date formatters for am/pm which is normally “a” becomes “x” and parsing the date causes a ParseException
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
see attached test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should format properly.
ACTUAL -
causes a parsing exception on all AM parsing
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.internal.runners.JUnit4ClassRunner;
import org.junit.runner.RunWith;
@RunWith(JUnit4ClassRunner.class)
public class TestDate {
private final static String TIME = "1:00:00 am";
private final static String TIME_FORMAT = "h:m:s a";
@Test
public void testUkDateParsing() throws ParseException
{
Locale.setDefault(Locale.UK);
SimpleDateFormat formatter = new SimpleDateFormat(TIME_FORMAT);
formatter.parse(TIME);
Assert.assertEquals(TIME_FORMAT, formatter.toLocalizedPattern());
}
@Test
public void testHungarianDateParsing() throws ParseException
{
Locale.setDefault(new Locale("hu", "HU"));
SimpleDateFormat formatter = new SimpleDateFormat(TIME_FORMAT);
formatter.parse(TIME);
Assert.assertEquals(TIME_FORMAT, formatter.toLocalizedPattern());
}
}
---------- END SOURCE ----------