You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2008/02/11 14:04:12 UTC

Re: svn commit: r620477 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java

Is this the right place to fix the problem?  Why not teach DRLVM to send 
the timezone ID without the trailing newline?

Regards,
Tim

ayza@apache.org wrote:
> Author: ayza
> Date: Mon Feb 11 04:52:38 2008
> New Revision: 620477
> 
> URL: http://svn.apache.org/viewvc?rev=620477&view=rev
> Log:
> Fixing the issue with extra \n at the end of timezone ID returned by DRLVM. See HARMONY-5476.
> 
> Modified:
>     harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
> 
> Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java?rev=620477&r1=620476&r2=620477&view=diff
> ==============================================================================
> --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java (original)
> +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java Mon Feb 11 04:52:38 2008
> @@ -302,6 +302,7 @@
>          if (AvailableZones == null) {
>              initializeAvailable();
>          }
> +
>          TimeZone zone = AvailableZones.get(name);
>          if (zone == null) {
>              if (name.startsWith("GMT") && name.length() > 3) {
> @@ -420,6 +421,11 @@
>  
>          String zone = AccessController.doPrivileged(new PriviAction<String>(
>                  "user.timezone"));
> +
> +        // sometimes DRLVM incorrectly adds "\n" to the end of timezone ID
> +        if (zone.contains("\n")) {
> +            zone = zone.substring(0, zone.indexOf("\n")); 
> +        }
>  
>          // if property user.timezone is not set, we call the native method
>          // getCustomTimeZone
> 
> 
> 

Re: svn commit: r620477 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java

Posted by Alexei Zakharov <al...@gmail.com>.
FYI I've created HARMONY-5494 about the issue in the
port_user_timezone() implementation. I would be nice if someone from
our DRLVM experts could find a time to take a look at it.

Thanks,
Alexei

2008/2/11, Tim Ellison <t....@gmail.com>:
> Alexei Zakharov wrote:
> > FYI I've marked the fix as a "workaround" in JIRA. I'll create new
> > DRLVM issue with detailed description of the problem. I promise to
> > roll back this workaround as soon as we have this issue fixed in
> > DRLVM. Does this make sense?
>
> Sure
>
> Thanks,
> Tim
>
> > 2008/2/11, Tim Ellison <t....@gmail.com>:
> >> Alexey Petrenko wrote:
> >>> 2008/2/11, Tim Ellison <t....@gmail.com>:
> >>>> Is this the right place to fix the problem?  Why not teach DRLVM to send
> >>>> the timezone ID without the trailing newline?
> >>> +1
> >>>
> >>>> ayza@apache.org wrote:
> >>>>> +        if (zone.contains("\n")) {
> >>>>> +            zone = zone.substring(0, zone.indexOf("\n"));
> >>>>> +        }
> >>> As far as I understood the string ends with "\n".
> >>> If so I believe it's better use the following construction here:
> >>> if (zone.endsWith("\n"))
> >>>     zone = zone.sunstring(0, zone.length() -1);
> >> If we can fix DRLVM by M5 then I suggest we don't need the workaround at
> >> all.  Otherwise leave it in but leave the JIRA open and redirect it to
> >> DRLVM with a reminder to remove the workaround when fixed properly.
> >>
> >> Regards,
> >> Tim
> >>
> >>
> >>
> >
>

Re: svn commit: r620477 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java

Posted by Tim Ellison <t....@gmail.com>.
Alexei Zakharov wrote:
> FYI I've marked the fix as a "workaround" in JIRA. I'll create new
> DRLVM issue with detailed description of the problem. I promise to
> roll back this workaround as soon as we have this issue fixed in
> DRLVM. Does this make sense?

Sure

Thanks,
Tim

> 2008/2/11, Tim Ellison <t....@gmail.com>:
>> Alexey Petrenko wrote:
>>> 2008/2/11, Tim Ellison <t....@gmail.com>:
>>>> Is this the right place to fix the problem?  Why not teach DRLVM to send
>>>> the timezone ID without the trailing newline?
>>> +1
>>>
>>>> ayza@apache.org wrote:
>>>>> +        if (zone.contains("\n")) {
>>>>> +            zone = zone.substring(0, zone.indexOf("\n"));
>>>>> +        }
>>> As far as I understood the string ends with "\n".
>>> If so I believe it's better use the following construction here:
>>> if (zone.endsWith("\n"))
>>>     zone = zone.sunstring(0, zone.length() -1);
>> If we can fix DRLVM by M5 then I suggest we don't need the workaround at
>> all.  Otherwise leave it in but leave the JIRA open and redirect it to
>> DRLVM with a reminder to remove the workaround when fixed properly.
>>
>> Regards,
>> Tim
>>
>>
>>
> 

Re: svn commit: r620477 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java

Posted by Alexei Zakharov <al...@gmail.com>.
FYI I've marked the fix as a "workaround" in JIRA. I'll create new
DRLVM issue with detailed description of the problem. I promise to
roll back this workaround as soon as we have this issue fixed in
DRLVM. Does this make sense?

Regards,
Alexei

2008/2/11, Tim Ellison <t....@gmail.com>:
> Alexey Petrenko wrote:
> > 2008/2/11, Tim Ellison <t....@gmail.com>:
> >> Is this the right place to fix the problem?  Why not teach DRLVM to send
> >> the timezone ID without the trailing newline?
> > +1
> >
> >> ayza@apache.org wrote:
> >>> +        if (zone.contains("\n")) {
> >>> +            zone = zone.substring(0, zone.indexOf("\n"));
> >>> +        }
> > As far as I understood the string ends with "\n".
> > If so I believe it's better use the following construction here:
> > if (zone.endsWith("\n"))
> >     zone = zone.sunstring(0, zone.length() -1);
>
> If we can fix DRLVM by M5 then I suggest we don't need the workaround at
> all.  Otherwise leave it in but leave the JIRA open and redirect it to
> DRLVM with a reminder to remove the workaround when fixed properly.
>
> Regards,
> Tim
>
>
>

Re: svn commit: r620477 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java

Posted by Tim Ellison <t....@gmail.com>.
Alexey Petrenko wrote:
> 2008/2/11, Tim Ellison <t....@gmail.com>:
>> Is this the right place to fix the problem?  Why not teach DRLVM to send
>> the timezone ID without the trailing newline?
> +1
> 
>> ayza@apache.org wrote:
>>> +        if (zone.contains("\n")) {
>>> +            zone = zone.substring(0, zone.indexOf("\n"));
>>> +        }
> As far as I understood the string ends with "\n".
> If so I believe it's better use the following construction here:
> if (zone.endsWith("\n"))
>     zone = zone.sunstring(0, zone.length() -1);

If we can fix DRLVM by M5 then I suggest we don't need the workaround at 
all.  Otherwise leave it in but leave the JIRA open and redirect it to 
DRLVM with a reminder to remove the workaround when fixed properly.

Regards,
Tim



Re: svn commit: r620477 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java

Posted by Alexey Petrenko <al...@gmail.com>.
2008/2/11, Tim Ellison <t....@gmail.com>:
> Is this the right place to fix the problem?  Why not teach DRLVM to send
> the timezone ID without the trailing newline?
+1

> ayza@apache.org wrote:
> > +        if (zone.contains("\n")) {
> > +            zone = zone.substring(0, zone.indexOf("\n"));
> > +        }
As far as I understood the string ends with "\n".
If so I believe it's better use the following construction here:
if (zone.endsWith("\n"))
    zone = zone.sunstring(0, zone.length() -1);

SY, Alexey