On Wed, 10 Jan 2018 20:21:53 -0700, Gary Gregory wrote:
On Wed, Jan 10, 2018 at 5:44 PM, Matt Benson <mben...@apache.org> wrote:

As I'm sure you're aware, the planned obsolescence of this approach is its obvious drawback (a similar drawback exists already in the JavaVersion parameter type). I assume this is the reason you said "technical reasons." However, wouldn't it be straight up simple, as well as future proof (if
done correctly), to provide a method that tests an int against the
available major Java version?


Hi Matt,

What would that look like?

https://stackoverflow.com/questions/1293308/java-api-to-find-out-the-jdk-version-a-class-file-is-compiled-for

[But I don't know how whether that can help wrt your
purpose (i.e. do you need the version of the running
JVM or the target version of a given class?).]

Gilles


Gary



Matt


On Jan 10, 2018 6:35 PM, "Gary Gregory" <garydgreg...@gmail.com> wrote:

Hi All:

I find myself writing a lot of this kind of code:

if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)) ...

and


Assume.assumeTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8));

I think this would be more tidy:

if (SystemUtils.isJavaVersionAtLeast8()) ...

If this makes your skin crawl, please present a (technical) argument
against it...

Gary



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to