Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 93103 invoked from network); 20 Sep 2007 10:59:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Sep 2007 10:59:49 -0000 Received: (qmail 11133 invoked by uid 500); 20 Sep 2007 10:59:40 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 11091 invoked by uid 500); 20 Sep 2007 10:59:40 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 11080 invoked by uid 99); 20 Sep 2007 10:59:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2007 03:59:40 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of peter.kitt.reilly@gmail.com designates 209.85.146.181 as permitted sender) Received: from [209.85.146.181] (HELO wa-out-1112.google.com) (209.85.146.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2007 10:59:40 +0000 Received: by wa-out-1112.google.com with SMTP id k22so548546waf for ; Thu, 20 Sep 2007 03:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Fh7maZPKqesndA/hzAUWH3IC8KbwhrXLqJK22Hn9uvc=; b=I0poGIK4fM2M93gd+RSSi4wwue0FTifOx26rtQhRW6iRZBSVFGVGb+jc9B5gRlDBKbfpeskrKYHGzo332Nny39rsoM0FysfrpFCc/9IcsX+rkLnlZ8FrY6/cqeJwikmjusptQJx4Nrgr2lEwvFIDRmsP8z9mE4HpCdsu1P7Gyds= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=W+NACxIfwb3XUnj+tfX7NMcMcsofu7QldQj8+x/Oy8s6IQmfwaz1hfyT3Ei471vkmR8YyMS0RO2iq98SQMjPxptmbJODe5PIZ7T35MSG3qdih8MH8QKVqaUGQ9brKw7O9Gj0y+j2SOxF2Lm0siBZInAra1TS5lW558GJYxNVs0E= Received: by 10.114.27.20 with SMTP id a20mr41945waa.1190285959797; Thu, 20 Sep 2007 03:59:19 -0700 (PDT) Received: by 10.140.127.6 with HTTP; Thu, 20 Sep 2007 03:59:19 -0700 (PDT) Message-ID: Date: Thu, 20 Sep 2007 11:59:19 +0100 From: "Peter Reilly" To: "Ant Developers List" Subject: Re: svn commit: r577308 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs: ProcessDestroyer.java RecorderEntry.java Redirector.java Sleep.java StreamPumper.java Tar.java Zip.java In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org Yes, It is difficult to come up with good names.... When I see wait(1000), my brain translates this it wait for a signal, but if it does not happen in a second, give up. So in this case, one second as a name sounds reasonable (or at least better than 1000). Peter On 9/20/07, Jan.Materne@rzf.fin-nrw.de wrote: > >URL: http://svn.apache.org/viewvc?rev=577308&view=rev > >Log: more magic numbers > > > > > >Modified: > >ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer. > java > > class ProcessDestroyer implements Runnable { > >- > >+ private static final int TWENTY_SECONDS = 20000; > > private Vector processes = new Vector(); > > // methods to register and unregister shutdown hooks > > private Method addShutdownHookMethod; > > try { > >- destroyProcessThread.join(20000); > >+ destroyProcessThread.join(TWENTY_SECONDS); > > > You should use the meaning of the constant as name, not its value. > > > >Modified: > >ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Redirector.java > > public class Redirector { > >+ private static final int ONE_SECOND = 1000; > > > > private static final String DEFAULT_ENCODING > > = System.getProperty("file.encoding"); > >- wait(1000); > >+ wait(ONE_SECOND); > > > again - describe the meaning not the value > > > >ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java > (original) > > public class StreamPumper implements Runnable { > > > >+ private static final int SMALL_BUFFER_SIZE = 128; > >- private int bufferSize = 128; > >+ private int bufferSize = SMALL_BUFFER_SIZE; > > > exactly like here. Its not HUNDRED_TWENTY_EIGHT, it is SMALL_BUFFER_SIZE > ;) > > > Jan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org