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

Mandy Chung mchung at openjdk.org
Tue May 9 09:06:32 UTC 2023


On Mon, 8 May 2023 14:53:41 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 incrementally with one additional commit since the last revision:
> 
>   Correct Platform.is64Bit() to report address size of the architecture enum, not the running system

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Platform.java line 65:

> 63:      */
> 64:     public boolean is64Bit() {
> 65:         return arch != Architecture.X86;

Have you considered having an instance `Architecture::is64bit` method in lieu of the current static method?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13585#discussion_r1188348420


More information about the core-libs-dev mailing list