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 Wed, 27 Aug 2008 10:04:08 GMT
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

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