Selecting values and code within the JDK for specific operating system functions currently uses a runtime comparison with the `os.name` system property. As a runtime check, the comparison does not allow values or code for other operating systems to be eliminated and is not easily optimized away or handled at build time.
Improvements should 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
Non-goals:
- Not a public API
- No support for hardware architecture enumeration (parallel and separate)
Improvements should 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
Non-goals:
- Not a public API
- No support for hardware architecture enumeration (parallel and separate)
- blocks
-
JDK-8304912 Use OperatingSystem enum in java.desktop module
-
- Resolved
-
-
JDK-8304910 Replace use of os.name system property with OperatingSystem enum in modules
-
- Resolved
-