Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 8153 invoked from network); 27 Aug 2008 10:04:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Aug 2008 10:04:58 -0000 Received: (qmail 5419 invoked by uid 500); 27 Aug 2008 10:04:55 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 5395 invoked by uid 500); 27 Aug 2008 10:04:54 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 5384 invoked by uid 99); 27 Aug 2008 10:04:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2008 03:04:54 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of junjie0122@gmail.com designates 72.14.220.157 as permitted sender) Received: from [72.14.220.157] (HELO fg-out-1718.google.com) (72.14.220.157) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2008 10:03:57 +0000 Received: by fg-out-1718.google.com with SMTP id d23so1434437fga.36 for ; Wed, 27 Aug 2008 03:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=x1cRXIb2RRqkDB7Nx/ZtqBkwy8nhvv6FUEHi94gVARE=; b=LIJ4Z8f8PJmmcQE+j2yRjR1IaRGygtS2IHBnp6nEYhlZQtDlz10X4dlc7FNObtyv24 9O94SE9V4DO6xN+P0JcV7g/Ug4P+5XrA8+sPvGBwcvxFA6PnMY6Dui9pmRXHelz15kql O4YOEs3CSQ/HSYfAVFEc//35OHod733UeHQpM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=wrYQQ3GBlZ3ta5+oUwLjNEyPx1v4kuVpFC84wjlb4yr13s8M6970xPzekQyUUhmVKR DW0VZQtSEG+wuYE/w8Y1tt4Idn1+cGUQXpC+jVqbwwK+M6UnTmJbQ9OyPPKEgrKj1hh6 DH9yNBLzngrKCyZ3vD2f4TUOO006fELtRtoog= Received: by 10.86.68.1 with SMTP id q1mr5216967fga.2.1219831448953; Wed, 27 Aug 2008 03:04:08 -0700 (PDT) Received: by 10.86.29.4 with HTTP; Wed, 27 Aug 2008 03:04:08 -0700 (PDT) Message-ID: Date: Wed, 27 Aug 2008 18:04:08 +0800 From: "Jim Yu" To: dev@harmony.apache.org Subject: Re: [classlib][util] java.util.Date.toString output is inconsistent with RI In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3227_27477628.1219831448938" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_3227_27477628.1219831448938 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Good idea. I've revised my patch and attached it to the JIRA again. Thanks, Alexey. 2008/8/27 Alexey Petrenko > 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 : > > 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 ------=_Part_3227_27477628.1219831448938--