Re: RFR: 8287121: Fix typo in jlink's description resource key lookup
On Tue, 24 May 2022 04:58:44 GMT, Jaikiran Pai wrote: >> Commit >> https://github.com/openjdk/jdk/commit/655500a4f5e3abcff176599604deceefb6ca6640 >> for issue [JDK-8286654](https://bugs.openjdk.java.net/browse/JDK-8286654) >> added an optional description accessor on the `ToolProvider` interface. It >> included a typo in` jlink`'s description resource key lookup: >> `"jlink.desciption"` >> >> This follow-up commit fixes the typo by adding the missing `r` character: >> `"jlink.description"`. >> >> This commit also also adds an automated check that ensures all current and >> future tool provider implementations within the JDK don't throw an exception >> when invoking their name and description accessor methods. Specific tool >> names and descriptions are not expected by this general test. > > test/jdk/java/util/spi/ToolProviderDescriptionTest.java line 40: > >> 38: public static void main(String... args) throws Exception { >> 39: List descriptions = listToolDescriptions(); >> 40: if (descriptions.isEmpty()) { > > Hello @sormuras, > Won't this condition always be "false", because from what I see in this test > code, the `descriptions` list will never be empty since in the `describeTool` > method of this test we always return a `String` instance to be added to the > `List`, even if there's no `description` for the `ToolProvider` instance. The list will be empty, if no `ToolProvider` service is observable at all. For example, when running `java` with `--limit-module java.base` - which doesn't provide an implemention of `ToolProvider` as of today. This test checks that all observable tools don't throw on calling their `name()` and `description()` accessors. This test does not care for proper results being returned. - PR: https://git.openjdk.java.net/jdk/pull/8825
Re: RFR: 8287121: Fix typo in jlink's description resource key lookup
On Sun, 22 May 2022 05:58:25 GMT, Christian Stein wrote: > Commit > https://github.com/openjdk/jdk/commit/655500a4f5e3abcff176599604deceefb6ca6640 > for issue [JDK-8286654](https://bugs.openjdk.java.net/browse/JDK-8286654) > added an optional description accessor on the `ToolProvider` interface. It > included a typo in` jlink`'s description resource key lookup: > `"jlink.desciption"` > > This follow-up commit fixes the typo by adding the missing `r` character: > `"jlink.description"`. > > This commit also also adds an automated check that ensures all current and > future tool provider implementations within the JDK don't throw an exception > when invoking their name and description accessor methods. Specific tool > names and descriptions are not expected by this general test. test/jdk/java/util/spi/ToolProviderDescriptionTest.java line 40: > 38: public static void main(String... args) throws Exception { > 39: List descriptions = listToolDescriptions(); > 40: if (descriptions.isEmpty()) { Hello @sormuras, Won't this condition always be "false", because from what I see in this test code, the `descriptions` list will never be empty since in the `describeTool` method of this test we always return a `String` instance to be added to the `List`, even if there's no `description` for the `ToolProvider` instance. - PR: https://git.openjdk.java.net/jdk/pull/8825
Re: RFR: 8287121: Fix typo in jlink's description resource key lookup
On Sun, 22 May 2022 05:58:25 GMT, Christian Stein wrote: > Commit > https://github.com/openjdk/jdk/commit/655500a4f5e3abcff176599604deceefb6ca6640 > for issue [JDK-8286654](https://bugs.openjdk.java.net/browse/JDK-8286654) > added an optional description accessor on the `ToolProvider` interface. It > included a typo in` jlink`'s description resource key lookup: > `"jlink.desciption"` > > This follow-up commit fixes the typo by adding the missing `r` character: > `"jlink.description"`. > > This commit also also adds an automated check that ensures all current and > future tool provider implementations within the JDK don't throw an exception > when invoking their name and description accessor methods. Specific tool > names and descriptions are not expected by this general test. Marked as reviewed by lancea (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/8825
Re: RFR: 8287121: Fix typo in jlink's description resource key lookup
On Sun, 22 May 2022 05:58:25 GMT, Christian Stein wrote: > Commit > https://github.com/openjdk/jdk/commit/655500a4f5e3abcff176599604deceefb6ca6640 > for issue [JDK-8286654](https://bugs.openjdk.java.net/browse/JDK-8286654) > added an optional description accessor on the `ToolProvider` interface. It > included a typo in` jlink`'s description resource key lookup: > `"jlink.desciption"` > > This follow-up commit fixes the typo by adding the missing `r` character: > `"jlink.description"`. > > This commit also also adds an automated check that ensures all current and > future tool provider implementations within the JDK don't throw an exception > when invoking their name and description accessor methods. Specific tool > names and descriptions are not expected by this general test. Marked as reviewed by alanb (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/8825
Re: RFR: 8287121: Fix typo in jlink's description resource key lookup
On Sun, 22 May 2022 05:58:25 GMT, Christian Stein wrote: > Commit > https://github.com/openjdk/jdk/commit/655500a4f5e3abcff176599604deceefb6ca6640 > for issue [JDK-8286654](https://bugs.openjdk.java.net/browse/JDK-8286654) > added an optional description accessor on the `ToolProvider` interface. It > included a typo in` jlink`'s description resource key lookup: > `"jlink.desciption"` > > This follow-up commit fixes the typo by adding the missing `r` character: > `"jlink.description"`. > > This commit also also adds an automated check that ensures all current and > future tool provider implementations within the JDK don't throw an exception > when invoking their name and description accessor methods. Specific tool > names and descriptions are not expected by this general test. test/jdk/java/util/spi/ToolProviderDescriptionTest.java line 46: > 44: > 45: static List listToolDescriptions() { > 46: return > StreamSupport.stream(ServiceLoader.load(ToolProvider.class).spliterator(), > false) it doesn't matter for this test but SL does have a stream method that could be used instead: ServiceLoader.load(ToolProvider.class) .stream() .map(ServiceLoader.Provider::get) .sorted(Comparator.comparing(ToolProvider::name)) ... - PR: https://git.openjdk.java.net/jdk/pull/8825
RFR: 8287121: Fix typo in jlink's description resource key lookup
Commit https://github.com/openjdk/jdk/commit/655500a4f5e3abcff176599604deceefb6ca6640 for issue [JDK-8286654](https://bugs.openjdk.java.net/browse/JDK-8286654) added an optional description accessor on the `ToolProvider` interface. It included a typo in` jlink`'s description resource key lookup: `"jlink.desciption"` This follow-up commit fixes the typo by adding the missing `r` character: `"jlink.description"`. This commit also also adds an automated check that ensures all current and future tool provider implementations within the JDK don't throw an exception when invoking their name and description accessor methods. Specific tool names and descriptions are not expected by this general test. - Commit messages: - 8287121: Fix typo in jlink's description resource key lookup Changes: https://git.openjdk.java.net/jdk/pull/8825/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8825=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8287121 Stats: 58 lines in 2 files changed: 57 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/8825.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/8825/head:pull/8825 PR: https://git.openjdk.java.net/jdk/pull/8825