RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v12]

Martin Doerr mdoerr at openjdk.org
Wed Apr 12 09:10:43 UTC 2023


On Tue, 11 Apr 2023 21:09:43 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Define an internal jdk.internal.util.Architecture enumeration and static methods to replace uses of the system property `os.arch`.
>> The enumeration values are defined to match those used in the build.
>> The initial values are: `X64, X86, AARCH64, RISCV64, S390, PPC64`
>> Note that `amd64` and `x86_64` in the build are represented by `X64`.
>> The value of the system property `os.arch` is unchanged.
>> 
>> The API is similar to the jdk.internal.util.OperatingSystem enum created by #[12931](https://git.openjdk.org/jdk/pull/12931).
>> Uses in `java.base` and a few others are included but other modules will be done in separate PRs.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Correct mapping and test of ppc64

Works on PPC64 Big Endian, now. However, little Endian fails:
org.opentest4j.AssertionFailedError: Mismatch PPC64 == PPC64 vs isPPC64 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1152)
	at ArchTest.isArch(ArchTest.java:99)
...
System property os.arch: "ppc64le", Architecture.current(): "PPC64"

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

PR Comment: https://git.openjdk.org/jdk/pull/13357#issuecomment-1504925182



More information about the client-libs-dev mailing list