ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: cvs commit: ant/src/testcases/org/apache/tools/ant/types/selectors ModifiedSelectorTest.java
Date Fri, 17 Dec 2004 09:37:00 GMT
On 16 Dec 2004, <bodewig@apache.org> 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


Mime
View raw message