ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaikiran Pai <jai.forums2...@gmail.com>
Subject Re: ant-ivy git commit: IVY-1569 Avoid reflection warnings (or worse) in Java 9+
Date Mon, 05 Feb 2018 04:00:52 GMT


On 02/02/18 11:49 PM, gintas@apache.org wrote:
> Repository: ant-ivy
> Updated Branches:
>    refs/heads/master 1d3567f30 -> 7ebc8107a
>
>
> IVY-1569 Avoid reflection warnings (or worse) in Java 9+
>
>
> +    private static int getJavaVersion() {
> +        // See https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90002
> +        final String[] version = System.getProperty("java.version").split("\\.");
> +        final int major = Integer.parseInt(version[0]);
> +        return major == 1 ? Integer.parseInt(version[1]) : major;
> +    }
>   }
>
I think we should use java.specification.version system property instead 
which is the recommended one as per the JEP 
http://openjdk.java.net/jeps/223. We use this property in Ant too to 
determine the Java version.

-Jaikiran

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message