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

Vicente Romero vromero at openjdk.org
Mon Sep 5 18:22:36 UTC 2022


On Mon, 5 Sep 2022 15:04:30 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fixing additional test
>
> test/jdk/java/lang/invoke/defineHiddenClass/src/HiddenInterface.java line 31:
> 
>> 29: public interface HiddenInterface {
>> 30:     default void test() {
>> 31:         record R() {}
> 
> surprised to see this change

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`

> test/langtools/jdk/jshell/ToolEnablePreviewTest.java line 76:
> 
>> 74:     public void testCompilerTestFlagEnv() {
>> 75:         test(new String[] {"-C", "-XDforcePreview"},
>> 76:                 (a) -> assertCommandOutputContains(a, "Function<Integer,Integer> f = (var i) -> i + i",
> 
> surprised to see these changes

similar as comment before `LAMBDA` is being removed but `VAR_SYNTAX_IMPLICIT_LAMBDAS` is still there

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

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


More information about the compiler-dev mailing list