Bug in javac release flag?

Stephen Colebourne scolebourne at joda.org
Mon Jan 22 15:11:03 UTC 2018

I think I have a problem with the java release flag, reported by a user here:

The particular case that is a problem are the new methods on java.lang.Math.

Java 8 had these methods:

Java 9 has these methods:

(there are similar new overloads for other method names)

Clearly, if you build on Java 9, code can link to the new(long,int)
overload, but that code will get a NoSuchMethodError on Java 8.

But, I am using Java 9 with the javac release flag set to be 8. If I
understand the release flag correctly, the (long,int) overload should
not be visible, and thus a different overload should be selected.

So, is this a bug? Perhaps the tool that captures new method
signatures doesn't handle overloads?

(ThreeTen-Extra v1.3 was built using Maven on Java 9 using Maven's
implementation of the release flag, so it could be Maven that is
buggy, but I don't think so as it produces the correct classfile
version number).


More information about the core-libs-dev mailing list