You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Svetlana Samoilenko (JIRA)" <ji...@apache.org> on 2006/02/17 14:11:24 UTC
[jira] Created: (HARMONY-102) java.util.Date.parse(String) throws
java.lang.IllegalArgumentException for legal string
java.util.Date.parse(String) throws java.lang.IllegalArgumentException for legal string
----------------------------------------------------------------------------------------
Key: HARMONY-102
URL: http://issues.apache.org/jira/browse/HARMONY-102
Project: Harmony
Type: Bug
Components: Classlib
Reporter: Svetlana Samoilenko
According to 1.4.2 and 1.5 specifications for java.util.Date(String s) IllegalArgumentException is thrown if attempt to interpret the string s as a representation of a date and time is fails.
Harmony throws IllegalArgumentException on legal string: "Sat, 1 Jan 1970 +0130 00:00:00".
Code to reproduce:
import java.util.Date;
public class test2 {
public static void main(String[] args) {
long date = Date.parse("Sat, 1 Jan 1970 +0130 00:00:00");
System.out.println("date =" + date);
}
}
Steps to Reproduce:
1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt.
2. Compile test2.java using BEA 1.4 javac
> javac -d . test2.java
3. Run java using compatible VM (J9)
> java -showversion test2
Output:
C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
date =-5400000
C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2
(c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
java.lang.IllegalArgumentException
at java.util.Date.parse(Date.java:404)
at test2.main(test2.java:4)
Suggested junit test case:
------------------------ DateTest.java -------------------------------------------------
import junit.framework.*;
import java.util.Date;
public class DateTest extends TestCase {
public static void main(String[] args) {
junit.textui.TestRunner.run(DateTest.class);
}
public void test_parse () {
assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
}
}
--
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
[jira] Resolved: (HARMONY-102) java.util.Date.parse(String) throws
java.lang.IllegalArgumentException for legal string
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-102?page=all ]
Tim Ellison resolved HARMONY-102:
---------------------------------
Resolution: Fixed
Patch looks good - -thank you Vladimir.
Svetalana,
Fixed in LUNI module java.util.Date at repo revision 379197.
Please check this fully resolves your problem.
> java.util.Date.parse(String) throws java.lang.IllegalArgumentException for legal string
> ----------------------------------------------------------------------------------------
>
> Key: HARMONY-102
> URL: http://issues.apache.org/jira/browse/HARMONY-102
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Tim Ellison
> Attachments: fix102.txt
>
> According to 1.4.2 and 1.5 specifications for java.util.Date(String s) IllegalArgumentException is thrown if attempt to interpret the string s as a representation of a date and time is fails.
> Harmony throws IllegalArgumentException on legal string: "Sat, 1 Jan 1970 +0130 00:00:00".
> Code to reproduce:
> import java.util.Date;
> public class test2 {
> public static void main(String[] args) {
> long date = Date.parse("Sat, 1 Jan 1970 +0130 00:00:00");
> System.out.println("date =" + date);
> }
> }
> Steps to Reproduce:
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt.
> 2. Compile test2.java using BEA 1.4 javac
> > javac -d . test2.java
> 3. Run java using compatible VM (J9)
> > java -showversion test2
> Output:
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2
> java version "1.4.2_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
> date =-5400000
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
> java.lang.IllegalArgumentException
> at java.util.Date.parse(Date.java:404)
> at test2.main(test2.java:4)
> Suggested junit test case:
> ------------------------ DateTest.java -------------------------------------------------
> import junit.framework.*;
> import java.util.Date;
> public class DateTest extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(DateTest.class);
> }
> public void test_parse () {
> assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
> }
> }
--
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
[jira] Assigned: (HARMONY-102) java.util.Date.parse(String) throws
java.lang.IllegalArgumentException for legal string
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-102?page=all ]
Tim Ellison reassigned HARMONY-102:
-----------------------------------
Assign To: Tim Ellison
> java.util.Date.parse(String) throws java.lang.IllegalArgumentException for legal string
> ----------------------------------------------------------------------------------------
>
> Key: HARMONY-102
> URL: http://issues.apache.org/jira/browse/HARMONY-102
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Tim Ellison
> Attachments: fix102.txt
>
> According to 1.4.2 and 1.5 specifications for java.util.Date(String s) IllegalArgumentException is thrown if attempt to interpret the string s as a representation of a date and time is fails.
> Harmony throws IllegalArgumentException on legal string: "Sat, 1 Jan 1970 +0130 00:00:00".
> Code to reproduce:
> import java.util.Date;
> public class test2 {
> public static void main(String[] args) {
> long date = Date.parse("Sat, 1 Jan 1970 +0130 00:00:00");
> System.out.println("date =" + date);
> }
> }
> Steps to Reproduce:
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt.
> 2. Compile test2.java using BEA 1.4 javac
> > javac -d . test2.java
> 3. Run java using compatible VM (J9)
> > java -showversion test2
> Output:
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2
> java version "1.4.2_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
> date =-5400000
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
> java.lang.IllegalArgumentException
> at java.util.Date.parse(Date.java:404)
> at test2.main(test2.java:4)
> Suggested junit test case:
> ------------------------ DateTest.java -------------------------------------------------
> import junit.framework.*;
> import java.util.Date;
> public class DateTest extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(DateTest.class);
> }
> public void test_parse () {
> assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
> }
> }
--
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
[jira] Updated: (HARMONY-102) java.util.Date.parse(String) throws
java.lang.IllegalArgumentException for legal string
Posted by "Vladimir Strigun (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-102?page=all ]
Vladimir Strigun updated HARMONY-102:
-------------------------------------
Attachment: fix102.txt
Fix for the bug. It also include fix for IllegalArgumentException for next string: "00:00:00 GMT +0130 Sat, 11 Jan 1970" I'll update junit test accordingly.
> java.util.Date.parse(String) throws java.lang.IllegalArgumentException for legal string
> ----------------------------------------------------------------------------------------
>
> Key: HARMONY-102
> URL: http://issues.apache.org/jira/browse/HARMONY-102
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Attachments: fix102.txt
>
> According to 1.4.2 and 1.5 specifications for java.util.Date(String s) IllegalArgumentException is thrown if attempt to interpret the string s as a representation of a date and time is fails.
> Harmony throws IllegalArgumentException on legal string: "Sat, 1 Jan 1970 +0130 00:00:00".
> Code to reproduce:
> import java.util.Date;
> public class test2 {
> public static void main(String[] args) {
> long date = Date.parse("Sat, 1 Jan 1970 +0130 00:00:00");
> System.out.println("date =" + date);
> }
> }
> Steps to Reproduce:
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt.
> 2. Compile test2.java using BEA 1.4 javac
> > javac -d . test2.java
> 3. Run java using compatible VM (J9)
> > java -showversion test2
> Output:
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2
> java version "1.4.2_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
> date =-5400000
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
> java.lang.IllegalArgumentException
> at java.util.Date.parse(Date.java:404)
> at test2.main(test2.java:4)
> Suggested junit test case:
> ------------------------ DateTest.java -------------------------------------------------
> import junit.framework.*;
> import java.util.Date;
> public class DateTest extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(DateTest.class);
> }
> public void test_parse () {
> assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
> }
> }
--
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
[jira] Closed: (HARMONY-102) java.util.Date.parse(String) throws
java.lang.IllegalArgumentException for legal string
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-102?page=all ]
Tim Ellison closed HARMONY-102:
-------------------------------
Verified by Svetlana
> java.util.Date.parse(String) throws java.lang.IllegalArgumentException for legal string
> ----------------------------------------------------------------------------------------
>
> Key: HARMONY-102
> URL: http://issues.apache.org/jira/browse/HARMONY-102
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Tim Ellison
> Attachments: fix102.txt
>
> According to 1.4.2 and 1.5 specifications for java.util.Date(String s) IllegalArgumentException is thrown if attempt to interpret the string s as a representation of a date and time is fails.
> Harmony throws IllegalArgumentException on legal string: "Sat, 1 Jan 1970 +0130 00:00:00".
> Code to reproduce:
> import java.util.Date;
> public class test2 {
> public static void main(String[] args) {
> long date = Date.parse("Sat, 1 Jan 1970 +0130 00:00:00");
> System.out.println("date =" + date);
> }
> }
> Steps to Reproduce:
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt.
> 2. Compile test2.java using BEA 1.4 javac
> > javac -d . test2.java
> 3. Run java using compatible VM (J9)
> > java -showversion test2
> Output:
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2
> java version "1.4.2_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
> date =-5400000
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
> java.lang.IllegalArgumentException
> at java.util.Date.parse(Date.java:404)
> at test2.main(test2.java:4)
> Suggested junit test case:
> ------------------------ DateTest.java -------------------------------------------------
> import junit.framework.*;
> import java.util.Date;
> public class DateTest extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(DateTest.class);
> }
> public void test_parse () {
> assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
> }
> }
--
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
[jira] Commented: (HARMONY-102) java.util.Date.parse(String) throws
java.lang.IllegalArgumentException for legal string
Posted by "Vladimir Strigun (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-102?page=comments#action_12366886 ]
Vladimir Strigun commented on HARMONY-102:
------------------------------------------
Here is updated testcase:
import junit.framework.*;
import java.util.Date;
public class DateTest extends TestCase {
public static void main(String[] args) {
junit.textui.TestRunner.run(DateTest.class);
}
public void test_parse () {
assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
assertEquals(858600000, Date.parse("00:00:00 GMT +0130 Sat, 11 Jan 1970"));
}
}
> java.util.Date.parse(String) throws java.lang.IllegalArgumentException for legal string
> ----------------------------------------------------------------------------------------
>
> Key: HARMONY-102
> URL: http://issues.apache.org/jira/browse/HARMONY-102
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Attachments: fix102.txt
>
> According to 1.4.2 and 1.5 specifications for java.util.Date(String s) IllegalArgumentException is thrown if attempt to interpret the string s as a representation of a date and time is fails.
> Harmony throws IllegalArgumentException on legal string: "Sat, 1 Jan 1970 +0130 00:00:00".
> Code to reproduce:
> import java.util.Date;
> public class test2 {
> public static void main(String[] args) {
> long date = Date.parse("Sat, 1 Jan 1970 +0130 00:00:00");
> System.out.println("date =" + date);
> }
> }
> Steps to Reproduce:
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt.
> 2. Compile test2.java using BEA 1.4 javac
> > javac -d . test2.java
> 3. Run java using compatible VM (J9)
> > java -showversion test2
> Output:
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2
> java version "1.4.2_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
> date =-5400000
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
> java.lang.IllegalArgumentException
> at java.util.Date.parse(Date.java:404)
> at test2.main(test2.java:4)
> Suggested junit test case:
> ------------------------ DateTest.java -------------------------------------------------
> import junit.framework.*;
> import java.util.Date;
> public class DateTest extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(DateTest.class);
> }
> public void test_parse () {
> assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
> }
> }
--
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
[jira] Commented: (HARMONY-102) java.util.Date.parse(String) throws
java.lang.IllegalArgumentException for legal string
Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-102?page=comments#action_12368877 ]
Svetlana Samoilenko commented on HARMONY-102:
---------------------------------------------
Vladimir, thank you, I can't reproduce the bug with latest sources.
> java.util.Date.parse(String) throws java.lang.IllegalArgumentException for legal string
> ----------------------------------------------------------------------------------------
>
> Key: HARMONY-102
> URL: http://issues.apache.org/jira/browse/HARMONY-102
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Assignee: Tim Ellison
> Attachments: fix102.txt
>
> According to 1.4.2 and 1.5 specifications for java.util.Date(String s) IllegalArgumentException is thrown if attempt to interpret the string s as a representation of a date and time is fails.
> Harmony throws IllegalArgumentException on legal string: "Sat, 1 Jan 1970 +0130 00:00:00".
> Code to reproduce:
> import java.util.Date;
> public class test2 {
> public static void main(String[] args) {
> long date = Date.parse("Sat, 1 Jan 1970 +0130 00:00:00");
> System.out.println("date =" + date);
> }
> }
> Steps to Reproduce:
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt.
> 2. Compile test2.java using BEA 1.4 javac
> > javac -d . test2.java
> 3. Run java using compatible VM (J9)
> > java -showversion test2
> Output:
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2
> java version "1.4.2_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel)
> date =-5400000
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
> java.lang.IllegalArgumentException
> at java.util.Date.parse(Date.java:404)
> at test2.main(test2.java:4)
> Suggested junit test case:
> ------------------------ DateTest.java -------------------------------------------------
> import junit.framework.*;
> import java.util.Date;
> public class DateTest extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(DateTest.class);
> }
> public void test_parse () {
> assertEquals(-5400000, Date.parse("Sat, 1 Jan 1970 +0130 00:00:00"));
> }
> }
--
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