RFR: 8367530: The exhaustiveness errors could be improved [v8]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Nov 14 14:25:58 UTC 2025
On Fri, 14 Nov 2025 13:31:01 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fixing trailing whitespaces.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 161:
>
>> 159: return enum2Constants.get(enumType).stream().map(c -> enumType.toString() + "." + c.name);
>> 160: } else {
>> 161: return Stream.of(pd.toString());
>
> As discussed offline, eager string generation will render the diagnostic arguments completely opaque to the formatter. This would mean that no `where` clauses will be generated, and unambiguous qualifiers will not be omitted.
Also, don't forget `JCDiagnostic.MultilineDiagnostic`, which we use in overloads to render repetitive fragments in tabular format.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27256#discussion_r2527692180
More information about the compiler-dev
mailing list