RFR: 8367530: The exhaustiveness errors could be improved [v13]

Jan Lahoda jlahoda at openjdk.org
Tue Jan 27 16:33:12 UTC 2026


On Mon, 26 Jan 2026 11:49:32 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Attempting to use the number of 'base checks' as the limit, instead of wall-clock time.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java line 771:
> 
>> 769:                     exhaustivenessResult.notExhaustiveDetails()
>> 770:                                        .stream()
>> 771:                                        .sorted((pd1, pd2) -> pd1.toString().compareTo(pd2.toString()))
> 
> Maybe we could have pattern descriptions be comparable?

The sorting now uses JCDiagnostic; to me, using a comparator for lexicographical ordering seems OK, although I can investigate other options if desired.

> src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java line 215:
> 
>> 213:      */
>> 214:     protected void preprocessArgument(Object arg) {
>> 215:         //TODO: preprocess for patterns
> 
> Is this comment this valid?

Removed, thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27256#discussion_r2732852046
PR Review Comment: https://git.openjdk.org/jdk/pull/27256#discussion_r2732853155


More information about the build-dev mailing list