RFR: add different flavors to the useSiteNullChecks compiler option [v2]
Vicente Romero
vromero at openjdk.org
Wed Jan 21 14:28:12 UTC 2026
On Wed, 21 Jan 2026 10:31:14 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - removing unused variable
>> - addressing review comments
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/NullChecksWriter.java line 95:
>
>> 93: } else {
>> 94: useSiteNullChecks = switch (opt) {
>> 95: case "none" -> UseSiteNullChecks.NONE;
>
> You could make the code a bit tighter by moving the names like "none" etc. inside the Enum (e.g. each constant has its own name). Then you can have an enum factory that takes a String (the javac option value) and returns the corresponding enum, if any is found. We use that pattern elsewhere in javac
sure, done
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1939#discussion_r2712812178
More information about the valhalla-dev
mailing list