On Wed, 29 May 2024 22:25:09 GMT, Naoto Sato <na...@openjdk.org> wrote:
>> Yes, `break` guarantees that the search completes one way or another once >> the module name has been matched. This is not how it used to be done. > > Right. Since `findAny` is after the module name matching, there is at most 1 > match. In the case we didn't find any, the final `orElse(null)` eventually > returns null. So the refactored code is semantically the same. It's only semantically the same if we assume a module can only provide a single `JdkConsoleProvider`, no? The `break;` disallows multiple providers (for disjoint sets of charsets) in a single module. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/19467#discussion_r1620164006