RFR: 8244146: javac changes for JEP 306
Joe Darcy
joe.darcy at oracle.com
Wed May 5 17:55:14 UTC 2021
On 5/5/2021 4:07 AM, Jan Lahoda wrote:
> 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?
Good point on the mixed 16 source / 17 target combination Jan. I've
pushed a revision that adds a predicate to Target and updated the tests
accordingly.
Thanks,
-Joe
More information about the compiler-dev
mailing list