FULL PRODUCT VERSION : java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux cs86612 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux A DESCRIPTION OF THE PROBLEM : When we use java.text.DateFormat.getDateTimeInstance().parse() can produce a bug. REGRESSION. Last worked in version 8u144 ADDITIONAL REGRESSION INFORMATION: java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode) EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Sun Nov 10 18:00:00 CST 2013 ACTUAL - Produce a bug. ERROR MESSAGES/STACK TRACES THAT OCCUR : java.text.ParseException: Unparseable date: "11 November 2013 00:00:00 GMT" at java.base/java.text.DateFormat.parse(DateFormat.java:388) at edu.utd.cs.testjdk.TestCalendar001.testPasadate(TestCalendar001.java:15) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:252) at junit.framework.TestSuite.run(TestSuite.java:247) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package edu.utd.cs.testjdk; import java.text.DateFormat; import java.text.ParseException; import java.util.Date; import java.util.Locale; import org.junit.Test; import junit.framework.TestCase; public class TestParsedata extends TestCase{ @Test public void testPasadate() throws ParseException { Date mtime = DateFormat.getDateTimeInstance(1, 1, Locale.UK).parse("11 November 2013 00:00:00 GMT"); assertEquals("Sun Nov 10 18:00:00 CST 2013",mtime); } } ---------- END SOURCE ---------- SUPPORT : YES
|