Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 65248 invoked from network); 27 May 2009 12:28:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 May 2009 12:28:56 -0000 Received: (qmail 34390 invoked by uid 500); 27 May 2009 12:29:08 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 34292 invoked by uid 500); 27 May 2009 12:29:08 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 34281 invoked by uid 99); 27 May 2009 12:29:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 12:29:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 12:29:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B9A9E234C004 for ; Wed, 27 May 2009 05:28:45 -0700 (PDT) Message-ID: <1492011530.1243427325746.JavaMail.jira@brutus> Date: Wed, 27 May 2009 05:28:45 -0700 (PDT) From: "Mark Miller (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-1653) Change DateTools to not create a Calendar in every call to dateToString or timeToString In-Reply-To: <663237927.1242939345970.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Miller updated LUCENE-1653: -------------------------------- Attachment: LUCENE-1653.patch add changes.txt > Change DateTools to not create a Calendar in every call to dateToString or timeToString > --------------------------------------------------------------------------------------- > > Key: LUCENE-1653 > URL: https://issues.apache.org/jira/browse/LUCENE-1653 > Project: Lucene - Java > Issue Type: Improvement > Components: Other > Reporter: Shai Erera > Priority: Minor > Fix For: 2.9 > > Attachments: LUCENE-1653.patch, LUCENE-1653.patch > > > DateTools creates a Calendar instance on every call to dateToString and timeToString. Specifically: > # timeToString calls Calendar.getInstance on every call. > # dateToString calls timeToString(date.getTime()), which then instantiates a new Date(). I think we should change the order of the calls, or not have each call the other. > # round(), which is called from timeToString (after creating a Calendar instance) creates another (!) Calendar instance ... > Seems that if we synchronize the methods and create the Calendar instance once (static), it should solve it. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org