You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2008/02/08 14:49:07 UTC
[jira] Created: (HARMONY-5476) [classlib][luni] Harmony is unable
to detect correct time zone on Linux
[classlib][luni] Harmony is unable to detect correct time zone on Linux
-----------------------------------------------------------------------
Key: HARMONY-5476
URL: https://issues.apache.org/jira/browse/HARMONY-5476
Project: Harmony
Issue Type: Bug
Components: Classlib
Environment: Linux32
Reporter: Alexei Zakharov
Assignee: Alexei Zakharov
On Linux auto detection of default time zone works incorrectly. For example SimpleDateFormat always returns GMT +0 by default. This leads to incorrect work of some applications - Clock demo applet from RI distribution could be one of such examples. Please see the test case below:
DateTest.java
---
import java.text.SimpleDateFormat;
import java.util.TimeZone;
public class DateTest {
public static void main(String argv[]) {
SimpleDateFormat formatter;
formatter = new SimpleDateFormat();
System.out.println(formatter.getTimeZone().getDisplayName(
true, TimeZone.SHORT) + ", " +
formatter.getTimeZone().getDisplayName(true, TimeZone.LONG));
}
--
On RI (my workstation is located in Moscow, GMT+3):
MSD, Moscow Daylight Time
on Harmony (r619813):
GMT+00:00, GMT+00:00
However, on Windows Harmony correctly sets time zone to GMT +3. So this is a UNIX-only issue.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (HARMONY-5476) [classlib][luni] Harmony is unable
to detect correct time zone on Linux
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov reopened HARMONY-5476:
--------------------------------------
I will close the issue as soon as we have the root issue fixed in DRLVM. See HARMONY-5494.
> [classlib][luni] Harmony is unable to detect correct time zone on Linux
> -----------------------------------------------------------------------
>
> Key: HARMONY-5476
> URL: https://issues.apache.org/jira/browse/HARMONY-5476
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux32
> Reporter: Alexei Zakharov
> Assignee: Alexei Zakharov
>
> On Linux auto detection of default time zone works incorrectly. For example SimpleDateFormat always returns GMT +0 by default. This leads to incorrect work of some applications - Clock demo applet from RI distribution could be one of such examples. Please see the test case below:
> DateTest.java
> ---
> import java.text.SimpleDateFormat;
> import java.util.TimeZone;
> public class DateTest {
> public static void main(String argv[]) {
> SimpleDateFormat formatter;
> formatter = new SimpleDateFormat();
> System.out.println(formatter.getTimeZone().getDisplayName(
> true, TimeZone.SHORT) + ", " +
> formatter.getTimeZone().getDisplayName(true, TimeZone.LONG));
> }
> --
> On RI (my workstation is located in Moscow, GMT+3):
> MSD, Moscow Daylight Time
> on Harmony (r619813):
> GMT+00:00, GMT+00:00
> However, on Windows Harmony correctly sets time zone to GMT +3. So this is a UNIX-only issue.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5476) [classlib][luni] Harmony is unable
to detect correct time zone on Linux
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568638#action_12568638 ]
Alexei Zakharov commented on HARMONY-5476:
------------------------------------------
I discovered that on some Linux distributions DRLVM is unable to detect time zone at all. I faced it on Fedora Core 7. I don't know the exact reason of this but it set user.timezone to empty string there. I created and committed a fallback code at r627506. It simply tries to detect the time zone by means standard API (from "time.h") in case if JVM failed to set "user.timezone" system variable.
> [classlib][luni] Harmony is unable to detect correct time zone on Linux
> -----------------------------------------------------------------------
>
> Key: HARMONY-5476
> URL: https://issues.apache.org/jira/browse/HARMONY-5476
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux32
> Reporter: Alexei Zakharov
> Assignee: Alexei Zakharov
>
> On Linux auto detection of default time zone works incorrectly. For example SimpleDateFormat always returns GMT +0 by default. This leads to incorrect work of some applications - Clock demo applet from RI distribution could be one of such examples. Please see the test case below:
> DateTest.java
> ---
> import java.text.SimpleDateFormat;
> import java.util.TimeZone;
> public class DateTest {
> public static void main(String argv[]) {
> SimpleDateFormat formatter;
> formatter = new SimpleDateFormat();
> System.out.println(formatter.getTimeZone().getDisplayName(
> true, TimeZone.SHORT) + ", " +
> formatter.getTimeZone().getDisplayName(true, TimeZone.LONG));
> }
> --
> On RI (my workstation is located in Moscow, GMT+3):
> MSD, Moscow Daylight Time
> on Harmony (r619813):
> GMT+00:00, GMT+00:00
> However, on Windows Harmony correctly sets time zone to GMT +3. So this is a UNIX-only issue.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-5476) [classlib][luni] Harmony is unable
to detect correct time zone on Linux
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov resolved HARMONY-5476.
--------------------------------------
Resolution: Fixed
Workaround was commited to Harmony repository at r620477. The root cause of this problem is in port_user_timezone() function from "vm/port/src/misc/linux/timezone.c" ( DRLVM workspace). It constantly adds extra '\n' to the end of returned timezone ID under Linux and this breaks all further logic. Looks like parsing of zoneinfo files was not implemented 100% correctly on DRLVM.
BTW, there are no such issues with J9 VM.
> [classlib][luni] Harmony is unable to detect correct time zone on Linux
> -----------------------------------------------------------------------
>
> Key: HARMONY-5476
> URL: https://issues.apache.org/jira/browse/HARMONY-5476
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux32
> Reporter: Alexei Zakharov
> Assignee: Alexei Zakharov
>
> On Linux auto detection of default time zone works incorrectly. For example SimpleDateFormat always returns GMT +0 by default. This leads to incorrect work of some applications - Clock demo applet from RI distribution could be one of such examples. Please see the test case below:
> DateTest.java
> ---
> import java.text.SimpleDateFormat;
> import java.util.TimeZone;
> public class DateTest {
> public static void main(String argv[]) {
> SimpleDateFormat formatter;
> formatter = new SimpleDateFormat();
> System.out.println(formatter.getTimeZone().getDisplayName(
> true, TimeZone.SHORT) + ", " +
> formatter.getTimeZone().getDisplayName(true, TimeZone.LONG));
> }
> --
> On RI (my workstation is located in Moscow, GMT+3):
> MSD, Moscow Daylight Time
> on Harmony (r619813):
> GMT+00:00, GMT+00:00
> However, on Windows Harmony correctly sets time zone to GMT +3. So this is a UNIX-only issue.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.