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

Martin Doerr mdoerr at openjdk.org
Tue Apr 11 10:42:41 UTC 2023


On Tue, 11 Apr 2023 10:26:02 GMT, ExE Boss <duke at openjdk.org> wrote:

>> test/jdk/jdk/internal/util/ArchTest.java line 128:
>> 
>>> 126:             case RISCV64 -> true;
>>> 127:             case S390 -> false;
>>> 128:             case PPC64 -> true;
>> 
>> This is not always true. The PPC64 architecture supports both endianness versions. AIX and legacy linux is Big Endian while recent linux is little Endian (determined by platform name "os.arch = ppc64le" instead of "os.arch = ppc64"). Querying the endianness is also possible, of course.
>
> This should (probably) be correct:
> Suggestion:
> 
>             case PPC64 -> !OperatingSystem.isAix() && Architecture.isLittleEndian();

Looks correct, but makes the test pointless for any linux on PPC64.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13357#discussion_r1162628828


More information about the serviceability-dev mailing list