Summary
Revise the specification of the java.lang.System::getProperties
method to allow the values of specific system properties to be undefined, and to allow the system property java.vendor.version
to be undefined.
Problem
The system property java.vendor.version
was introduced by
JEP 322: Time-Based Release Versioning in JDK 10. The JEP says:
java.vendor.version
— An implementor-specific product version string, optionally assigned by the individual or organization that produces a specific implementation. If not assigned at build time then it has no value; otherwise, its value is a non-empty string that matches the regular expression\p{Graph}+
.
The specification of the java.lang.System::getProperties
method contains a table of all of the standard system properties. The java.vendor.version
property was added to that table when JEP 322 was implemented. That specification mandates, however, that "this set of system properties always includes values for the following keys," which is true of every property listed except for java.vendor.version
.
Solution
Revise the specification of the java.lang.System::getProperties
method to allow the values of specific system properties to be undefined, and to allow the system property java.vendor.version
to be undefined.
Specification
diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java
--- a/src/java.base/share/classes/java/lang/System.java
+++ b/src/java.base/share/classes/java/lang/System.java
@@ -618,8 +618,9 @@
* {@link #getProperty(String)} method is returned as a
* {@code Properties} object. If there is no current set of
* system properties, a set of system properties is first created and
- * initialized. This set of system properties always includes values
- * for the following keys:
+ * initialized. This set of system properties includes a value
+ * for each of the following keys unless the description of the associated
+ * value indicates that the value is optional:
* <table class="striped" style="text-align:left">
* <caption style="display:none">Shows property keys and associated values</caption>
* <thead>
@@ -639,7 +640,7 @@
* <tr><th scope="row">{@systemProperty java.vendor.url}</th>
* <td>Java vendor URL</td></tr>
* <tr><th scope="row">{@systemProperty java.vendor.version}</th>
- * <td>Java vendor version</td></tr>
+ * <td>Java vendor version <em>(optional)</em> </td></tr>
* <tr><th scope="row">{@systemProperty java.home}</th>
* <td>Java installation directory</td></tr>
* <tr><th scope="row">{@systemProperty java.vm.specification.version}</th>
Specdiff: https://cr.openjdk.java.net/~mr/rev/8179727/specdiff/
Javadoc output: https://cr.openjdk.java.net/~mr/rev/8179727/java.base/java/lang/System.html#getProperties%28%29
- csr of
-
JDK-8197927 Allow the system property `java.vendor.version` to be undefined
-
- Resolved
-