RFR: 8333103: Re-examine the console provider loading

Claes Redestad redestad at openjdk.org
Thu May 30 07:47:02 UTC 2024


On Wed, 29 May 2024 22:25:09 GMT, Naoto Sato <naoto at 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


More information about the core-libs-dev mailing list