RFR: 8303485: Replacing os.name for operating system customization

Mandy Chung mchung at openjdk.org
Fri Mar 10 18:19:10 UTC 2023


On Fri, 10 Mar 2023 14:01:04 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Improvements to support OS specific customization for JDK internal use:
>>  - To select values and code; allowing elimination of unused code and values
>>  - Optionally evaluated by build processes, compilation, or archiving (i.e. CDS)
>>  - Simple API to replace adhoc comparisons with `os.name`
>>  - Clear and consistent use across build, runtime, and JDK modules
>>  
>> The PR includes updates within java.base to use the new API.
>
> src/java.base/share/classes/jdk/internal/misc/OperatingSystem.java line 23:
> 
>> 21:  * questions.
>> 22:  */
>> 23: package jdk.internal.misc;
> 
> I see there is a follow on PR to see this in several modules. We can't have jdk.internal.misc exported widely as it contains Unsafe and several other important classes.   jdk.internal.util may be a better place, at the same of turning that package into a place for random stuff.

Agree.  `jdk.internal.platform` can be one option.  It can be extended to include platform-related utilities beyond containers.

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

PR: https://git.openjdk.org/jdk/pull/12931



More information about the build-dev mailing list