RFR: 8367530: The exhaustiveness errors could be improved [v13]
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Jan 26 12:20:50 UTC 2026
On Mon, 26 Jan 2026 12:13:30 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 691:
>>
>>> 689: }
>>> 690:
>>> 691: protected void checkTimeout() {
>>
>> This is probably no longer a good name for this method.
>>
>> More seriously, I have a question as to why this method is only checked (AFAICS) from `isBpCovered`. I would have expected it to be more directly tied to `computeMissingPatternDescriptions` ?
>
> Maybe the intent is that you don't want to just check the "depth" of the check, but also the "width" -- e.g. if there's few nested record patterns, but each has a huge number of components.
Also, `isBpCovered` seems to be called by routines (like `reduceRecordPattern`) that do not seem related to the new logic (which is what got me suspicious about the location of the update to begin with). Which has (at least in theory) potential for `TooManyChecksException` to trigger in places where it's not expected? (but maybe that's handled by the special value `-1` which is carefully set after the new logic runs)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27256#discussion_r2727385802
More information about the build-dev
mailing list