RFR: 8293051: Further refactor javac after removal of -source/-target/--release 7 [v2]

Vicente Romero vromero at openjdk.org
Thu Sep 8 14:24:52 UTC 2022


On Thu, 8 Sep 2022 13:02:29 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> this is was done because test: `test/jdk/java/lang/invoke/defineHiddenClass/PreviewHiddenClass.java` is compiling this code with options `--enable-preview -source [latestSource] -XDforcePreview` and then checking that the obtained class file has 65535 as its minor version. This was working so far as `DEFAULT_METHODS` was one member of `com.sun.tools.javac.code.Source.Feature` but as this PR is removing `DEFAULT_METHODS` we are obtaining the same effect defining a record as `RECORDS` are still defined in `com.sun.tools.javac.code.Source.Feature`
>
> I see. I understand what the fix does then.
> I wonder if, moving forward, it wouldn't be better to tweak the semantics of forcePreview so that it always pollutes the classfile not matter what (which seems to be what some of the tests want). Otherwise we're stuck with these fragile tricks of using this or that feature to force javac's preview system into submission.

yes that would be a sensible change going forward. Thanks for the review

-------------

PR: https://git.openjdk.org/jdk/pull/10150


More information about the compiler-dev mailing list