RFR: 8340404: Clarify CharsetProvider deployment on application module path

Alan Bateman alanb at openjdk.org
Thu Sep 19 05:43:39 UTC 2024


On Thu, 19 Sep 2024 00:07:30 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8340412) which clarifies that a CharsetProvider SPI can be provided via the application module path.
> 
> This came as a result from a comment on the PR of JDK-8339735. 
> 
> I included some minor wording on deploying as a module, with a link to `Service Loader's` _Developing Service Providers section_ to handle the heavy lifting. However, I am happy to adjust as needed, if it is felt that more info should be laid out directly on `CharsetProvider's` class description itself.
> 
> An associated test is provided to confirm that a `CharsetProvider` _can_ be deployed as a module.

test/jdk/java/nio/charset/spi/CharsetProviderAsModuleTest.java line 45:

> 43:         } else {
> 44:             bazCs = cs.get("BAZ");
> 45:             var aliases = bazCs.aliases();

I think this needs to test that bazCs.getClass().getModule() is a named module.

test/jdk/java/nio/charset/spi/provider/module-info.java line 24:

> 22:  */
> 23: module provider {
> 24:     exports spi;

It's a bit of anti pattern for service provider modules to export an API, can you drop this? I don't think it's possible to check the test setup while that is there.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21076#discussion_r1766189848
PR Review Comment: https://git.openjdk.org/jdk/pull/21076#discussion_r1766188958


More information about the nio-dev mailing list