RFR: 8244146: javac changes for JEP 306

Jan Lahoda jlahoda at openjdk.java.net
Wed May 5 11:07:51 UTC 2021


On Wed, 5 May 2021 05:26:47 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

>> 8244146: javac changes for JEP 306
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java line 1704:
> 
>> 1702:         if (Feature.REDUNDANT_STRICTFP.allowedInSource(source))
>> 1703:             result = result & ~STRICTFP;
>> 1704: 
> 
> Nitpick: Doing in Rome as ... would mean this is better written as 
> 
> result &= ~STRICTFP;
> 
> to be in harmony with the code in the vicinity
> 
> Also I am OK with the feature-allowed-in-source-check, but wonder if it is an overkill for smaller focussed changes like this one. I will say I don't know what is the standard operating procedure. See that elsewhere in Lint.java you are doing 
> 
> if (source.compareTo(Source.JDK17) >= 0) {
>                 values.add(LintCategory.STRICTFP);
> }

IMO it is better to have an enum constant in Feature for source level changes.

But here, I wonder if a Target method on this place wouldn't be more appropriate. One can write:

javac -source 16 -targete 17 Test.java


If `Test.java` contains `strictfp`, should the classfile have `STRICTFP` set or not?

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

PR: https://git.openjdk.java.net/jdk/pull/3831


More information about the compiler-dev mailing list