RFR: 8367499: Refactor exhaustiveness computation from Flow into a separate class

Francesco Andreuzzi fandreuzzi at openjdk.org
Fri Sep 12 10:57:16 UTC 2025


On Fri, 12 Sep 2025 10:54:04 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 204:
>> 
>>> 202: 
>>> 203:         for (PatternDescription pdOne : patterns) {
>>> 204:             if (pdOne instanceof BindingPattern bpOne) {
>> 
>> The scope of this `if` is quite wide, you could consider inverting the condition and `continue`ing if the condition does not match. This would save an indentation level.
>
> Sorry, but the point here is to move the code from one place to another (as suggested in the description). I suspect that any change, despite how desirable it might look, is likely to make reviewing this change more difficult, and hence I would like to avoid that.

I see, thanks for the clarification.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27253#discussion_r2343839560


More information about the compiler-dev mailing list