RFR: 8304913: Use OperatingSystem, Architecture, and Version in jlink [v2]

Jaikiran Pai jpai at openjdk.org
Fri May 5 10:56:24 UTC 2023


On Thu, 4 May 2023 20:37:31 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Refactor the Platform class of jlink to use jdk.internal.util OperatingSystem and Architecture instead of os.name and os.arch. 
>> They are direct replacements for the Platform enums except for UNKNOWN; its use is refactored to report errors via exceptions.
>> 
>> Neither os.name nor os.arch should be assumed to be changeable; 
>> one test case is removed because it assumes os.name can be changed on the command line.
>
> Roger Riggs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 28 commits:
> 
>  - Remove unused static methods in DefaultImageBuilder
>  - Merge branch 'master' into 8304913-os-arch-jlink
>  - Merge branch 'master' into 8304913-os-arch-jlink
>  - Minor cleanup
>  - Merge branch 'master' into 8304913-os-arch-jlink
>  - 8304913: Use OperatingSystem, Architecture, and Version in jlink
>  - Simplify exception handling
>  - Simplify version parsing
>  - 8306678: Replace use of os.version with an internal Version record
>  - Use and test of "s390" verified by reviewer.
>  - ... and 18 more: https://git.openjdk.org/jdk/compare/0c6529d2...5bf9a506

These latest changes look OK to me.

I have very limited knowledge of this area, so it would be good to wait for another review.

src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java line 86:

> 84:      */
> 85:     public default Platform getTargetPlatform() {
> 86:         throw new UnsupportedOperationException("Builder does not define getTargetPlatform");

I think it is OK to change this implementation to now throw this exception, since this is an internal interface (from what I can see in the module definition).

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

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13585#pullrequestreview-1414571255
PR Review Comment: https://git.openjdk.org/jdk/pull/13585#discussion_r1185954316


More information about the core-libs-dev mailing list