Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 12181 invoked from network); 17 Dec 2004 10:06:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Dec 2004 10:06:41 -0000 Received: (qmail 15919 invoked by uid 500); 17 Dec 2004 09:38:40 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 15853 invoked by uid 500); 17 Dec 2004 09:38:40 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 15837 invoked by uid 99); 17 Dec 2004 09:38:40 -0000 Received-SPF: neutral (hermes.apache.org: local policy) Received: from bodewig.bost.de (HELO bodewig.bost.de) (62.96.16.111) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 17 Dec 2004 01:37:24 -0800 Received: (from bodewig@localhost) by bodewig.bost.de (8.11.6/8.11.6) id iBH9b0a26091; Fri, 17 Dec 2004 10:37:00 +0100 X-Authentication-Warning: bodewig.bost.de: bodewig set sender to bodewig@apache.org using -f To: dev@ant.apache.org Subject: Re: cvs commit: ant/src/testcases/org/apache/tools/ant/types/selectors ModifiedSelectorTest.java X-Draft-From: ("nnfolder:mail.jakarta-ant" 64130) References: <20041216140140.90473.qmail@minotaur.apache.org> From: Stefan Bodewig Date: Fri, 17 Dec 2004 10:37:00 +0100 In-Reply-To: <20041216140140.90473.qmail@minotaur.apache.org> (bodewig@apache.org's message of "16 Dec 2004 14:01:40 -0000") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 16 Dec 2004, wrote: > Jikes again: shadows, some private finals that could be static and > statics used as instance methods Is not the full truth since I accidentially committed files I didn't intend to commit - this time. The other part (see below) is: "Move Kaffe detection to JavaEnvUtils". Stefan > Index: Path.java > =================================================================== > RCS file: > /home/cvs/ant/src/main/org/apache/tools/ant/types/Path.java,v > retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 > -r1.66 --- Path.java 7 Dec 2004 22:14:13 -0000 1.65 > +++ Path.java 16 Dec 2004 14:01:37 -0000 1.66 > @@ -574,7 +574,7 @@ > * Add the Java Runtime classes to this Path instance. > */ > public void addJavaRuntime() { > - if ("Kaffe".equals(System.getProperty("java.vm.name"))) { > + if (JavaEnvUtils.isKaffe()) { > // newer versions of Kaffe (1.1.1+) won't have this, > // but this will be sorted by FileSet anyway. > File kaffeShare = new File(System.getProperty("java.home") > > > > 1.23 +20 -0 > ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java > > Index: JavaEnvUtils.java > =================================================================== > RCS file: > /home/cvs/ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java,v > retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 > -r1.23 --- JavaEnvUtils.java 22 Nov 2004 09:23:37 -0000 1.22 > +++ JavaEnvUtils.java 16 Dec 2004 14:01:37 -0000 1.23 > @@ -67,6 +67,9 @@ > /** Version constant for Java 1.5 */ > public static final String JAVA_1_5 = "1.5"; > > + /** Whether this is the Kaffe VM */ > + private static boolean kaffeDetected; > + > /** array of packages in the runtime */ > private static Vector jrePackages; > > @@ -103,6 +106,13 @@ > // swallow as we've hit the max class version that > // we have > } > + kaffeDetected = false; > + try { > + Class.forName("kaffe.util.NotImplemented"); > + kaffeDetected = true; > + } catch (Throwable t) { > + // swallow as this simply doesn't seem to be Kaffe > + } > } > > /** > @@ -123,6 +133,16 @@ > */ > public static boolean isJavaVersion(String version) { > return javaVersion.equals(version); > + } > + > + /** > + * Checks whether the current Java VM is Kaffe. > + * @return true if the current Java VM is Kaffe. > + * @since Ant 1.6.3 > + * @see http://www.kaffe.org/ > + */ > + public static boolean isKaffe() { > + return kaffeDetected; > } > > /** --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org