You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pavel Pervov (JIRA)" <ji...@apache.org> on 2008/02/06 15:49:08 UTC
[jira] Created: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
[classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
-----------------------------------------------------------------------------------------------------------------
Key: HARMONY-5468
URL: https://issues.apache.org/jira/browse/HARMONY-5468
Project: Harmony
Issue Type: Bug
Environment: All
Reporter: Pavel Pervov
The fllowing test demonstrates the behaviour:
--------------------------
import java.util.TimeZone;
import java.util.Date;
class DateToString {
public static void main(String[] args) {
TimeZone tz = TimeZone.getDefault();
tz.setDefault(tz.getTimeZone("MST"));
System.out.println(new Date(104, 2, 13));
}
}
--------------------------
It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569913#action_12569913 ]
Pavel Pervov commented on HARMONY-5468:
---------------------------------------
Tony,
As this was redirected into ICU, I would suggest moving this bug out of M5.
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Fix For: 5.0M5
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tony Wu reassigned HARMONY-5468:
--------------------------------
Assignee: Tony Wu
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Fix For: 5.0M5
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jim Yu updated HARMONY-5468:
----------------------------
Attachment: HARMONY-5468V3.diff
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Attachments: HARMONY-5468.diff, HARMONY-5468V2.diff, HARMONY-5468V3.diff
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Pervov updated HARMONY-5468:
----------------------------------
Fix Version/s: (was: 5.0M5)
Moving out of M5. ICU won't fix this promptly enough.
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626039#action_12626039 ]
Jim Yu commented on HARMONY-5468:
---------------------------------
I took a look at this issue and found that we can remove the delegation to ICU since we only use the en-us locale here. I think we can easily implement
this method instead of delegating to SimpleDateFormat. Then, this defect can be easily resolved. Moreover, invoking SimpleDateFormat will lead to low performance
of this API. For a simple testcase as below [1], the original result is 119667 millisecs while the result after applying my patch is only 1140 millisecs.
Is there anyone to verify this patch?
[1]
import java.util.Date;
public class DateToStringTest {
public static void main(String[] args) {
long start = System.currentTimeMillis();
Date date = new Date();
long count = 100000;
System.out.println(date.toString());
while(--count != 0) {
date.toString();
}
System.out.println(System.currentTimeMillis() - start);
}
}
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Attachments: HARMONY-5468.diff
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Pervov updated HARMONY-5468:
----------------------------------
Fix Version/s: 5.0M5
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Environment: All
> Reporter: Pavel Pervov
> Fix For: 5.0M5
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tony Wu resolved HARMONY-5468.
------------------------------
Resolution: Fixed
Fix Version/s: 5.0M8
Hi, Jim
thanks for your contribution.
Patch committed at r690853, please verify whether it is fixed as you expected.
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Fix For: 5.0M8
>
> Attachments: HARMONY-5468.diff, HARMONY-5468V2.diff, HARMONY-5468V3.diff
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567990#action_12567990 ]
Pavel Pervov commented on HARMONY-5468:
---------------------------------------
Linking it in JIRA with ICU tracker not to miss: http://bugs.icu-project.org/trac/ticket/6174
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Fix For: 5.0M5
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570226#action_12570226 ]
Tony Wu commented on HARMONY-5468:
----------------------------------
Yes, agree. Thanks Pavel.
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jim Yu updated HARMONY-5468:
----------------------------
Attachment: HARMONY-5468V2.diff
Change toDayOfWeek and toMonth methods to simple static arrays.
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Attachments: HARMONY-5468.diff, HARMONY-5468V2.diff
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567310#action_12567310 ]
Tony Wu commented on HARMONY-5468:
----------------------------------
It caused by difference of SimpleDateFormat. I think it is a bug of ICU since spec says that it should return GMT+/-offset if the timezone does not have a name.
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Fix For: 5.0M5
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5468) [classlib][util]
java.util.Date.toString outputs real time zone name on RI, but prints
GMT<+/-offset> on Harmony.
Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jim Yu updated HARMONY-5468:
----------------------------
Attachment: HARMONY-5468.diff
> [classlib][util] java.util.Date.toString outputs real time zone name on RI, but prints GMT<+/-offset> on Harmony.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5468
> URL: https://issues.apache.org/jira/browse/HARMONY-5468
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: All
> Reporter: Pavel Pervov
> Assignee: Tony Wu
> Attachments: HARMONY-5468.diff
>
>
> The fllowing test demonstrates the behaviour:
> --------------------------
> import java.util.TimeZone;
> import java.util.Date;
> class DateToString {
> public static void main(String[] args) {
> TimeZone tz = TimeZone.getDefault();
> tz.setDefault(tz.getTimeZone("MST"));
> System.out.println(new Date(104, 2, 13));
> }
> }
> --------------------------
> It looks like the problem may be in ICU's SimpleTimeZone pattern processing code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.