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

Joe Darcy darcy at openjdk.org
Fri Sep 2 23:24:53 UTC 2022


On Fri, 2 Sep 2022 21:47:19 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java line 216:
>> 
>>> 214:         POLY(JDK8),
>>> 215:         LAMBDA(JDK8, Fragments.FeatureLambda, DiagKind.PLURAL),
>>> 216:         DEFAULT_METHODS(JDK8, Fragments.FeatureDefaultMethods, DiagKind.PLURAL),
>> 
>> As noted in https://github.com/openjdk/jdk/pull/10074#issuecomment-1230998246, if DEFAULT_METHODS is removed, there is a core libs test that will fail.
>> 
>> I believe the functionality request is a standard idiom for forcing a source file to be compiled as Preview. Merely setting -XDpreview (however that hidden option is spelled) is not sufficient. A feature that triggers a checkSourceLevel call is needed too.
>
> that can be worked out I think as I did with other tests, it should show up in the mach5 run, are you referring to: `PreviewHiddenClass.java`?

Pretty sure the test in question was under java.lang.invoke in the libraries (i.e. test/jdk vs test/langtools) area.

If we come up for a supported idiom for this, there is at least one other test I'd want to update to use it; that can be done as future work.

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

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


More information about the compiler-dev mailing list