harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Yu" <junjie0...@gmail.com>
Subject Re: [classlib][util] java.util.Date.toString output is inconsistent with RI
Date Fri, 29 Aug 2008 03:33:15 GMT
Tony,

I can pass the testcase successfully by using Sun's JRE 1.6. I'm not sure
why it fails on your platform. Do you use JRE 1.6 or previous version? As
you said, I would reset the default timezone in my patch. Thanks.

2008/8/29 Tony Wu <wuyuehao@gmail.com>

> I run the testcase and found that it failed on RI. can you tell us why
> RI returns MDT rather than MST even if we explicitly set the default
> timezone to MST? Is it a non-bug difference?
> And please reset the default timezone to the original one after
> running your testcase otherwise it may have side effect to other
> tests.
>
> On Wed, Aug 27, 2008 at 6:04 PM, Jim Yu <junjie0122@gmail.com> wrote:
> > Good idea. I've revised my patch and attached it to the JIRA again.
> Thanks,
> > Alexey.
> >
> > 2008/8/27 Alexey Petrenko <alexey.a.petrenko@gmail.com>
> >
> >> I would suggest to change toDayOfWeek and toMonth methods to simple
> >> static arrays. We do not need these calls and switches in this case.
> >>
> >> Thanks in advance.
> >>
> >> SY, Alexey
> >>
> >> 2008/8/27 Jim Yu <junjie0122@gmail.com>:
> >> > Hi all,
> >> >
> >> > I took a look at [1] and found that we can remove the delegation to
> >> > SimpleDateFormat 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 [2], the original
> >> > result is 119667 millisecs while the result after applying my patch is
> >> only
> >> > 1140 millisecs. I've attached my patch to this JIRA.
> >> > Is there anyone to verify the patch? Thanks.
> >> >
> >> > [1] https://issues.apache.org/jira/browse/HARMONY-5468
> >> > [2]
> >> > 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);
> >> >    }
> >> > }
> >> > --
> >> > Best Regards,
> >> > Jim, Jun Jie Yu
> >> >
> >> > China Software Development Lab, IBM
> >> >
> >>
> >
> >
> >
> > --
> > Best Regards,
> > Jim, Jun Jie Yu
> >
> > China Software Development Lab, IBM
> >
>
>
>
> --
> Tony Wu
> China Software Development Lab, IBM
>



-- 
Best Regards,
Jim, Jun Jie Yu

China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message