RFR: 8349288: runtime/os/windows/TestAvailableProcessors.java fails on localized Windows platform [v7]

Kazuhisa Takakuri ktakakuri at openjdk.org
Fri Jun 6 08:21:08 UTC 2025


On Thu, 8 May 2025 10:35:22 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Kazuhisa Takakuri has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8349288: runtime/os/windows/TestAvailableProcessors.java fails on localized Windows platform
>
> test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java line 72:
> 
>> 70:             System.getenv("WINDIR")     != null ? new File(System.getenv ("WINDIR")) :
>> 71:             null;
>> 72:         String systemDirW = new File(systemRoot, "System32").getPath();
> 
> If `SystemRoot` is null this will just throw `NullPointerException`. You should check for null and throw a more meaningful exception

I'm sorry for being extremely late.
According to the [API documentation](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/io/File.html#%3Cinit%3E(java.io.File,java.lang.String)) , it seems that NullPointerException is not thrown even if parent(systemRoot) is null. However, I believe that a null check is necessary.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23536#discussion_r2131740823


More information about the hotspot-runtime-dev mailing list