Summary
Add a new system property, java.specification.maintenance.version
, to return the maintenance release number of the Java SE specification being implemented by the JDK.
Problem
There is no existing programmatic way to determine if a JDK is implementing an original release Java SE specification or a maintenance release to a Java SE specification.
Solution
Add an optional property, java.specification.maintenance.version
, to the list of properties defined by System.getProperties()
. The property is unset, optional in the terminology of System.getProperties, for an initial release of a specification. Subsequent values are "1", "2", etc.
Specification
diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java
index cfb9dcc3d10..10740273d2c 100644
--- a/src/java.base/share/classes/java/lang/System.java
+++ b/src/java.base/share/classes/java/lang/System.java
@@ -732,6 +732,9 @@ public final class System {
* <td>Java Runtime Environment specification version, whose value is
* the {@linkplain Runtime.Version#feature feature} element of the
* {@linkplain Runtime#version() runtime version}</td></tr>
+ * <tr><th scope="row">{@systemProperty java.specification.maintenance.version}</th>
+ * <td>Java Runtime Environment specification maintenance version,
+ * may be interpreted as a positive integer <em>(optional, see below)</em></td></tr>
* <tr><th scope="row">{@systemProperty java.specification.vendor}</th>
* <td>Java Runtime Environment specification vendor</td></tr>
* <tr><th scope="row">{@systemProperty java.specification.name}</th>
@@ -779,6 +782,16 @@ public final class System {
* </tbody>
* </table>
* <p>
+ * The {@code java.specification.maintenance.version} property is
+ * defined if the specification implemented by this runtime at the
+ * time of its construction had undergone a <a
+ * href="https://jcp.org/en/procedures/jcp2#3.6.4">maintenance
+ * release</a>. When defined, its value identifies that
+ * maintenance release. To indicate the first maintenance release
+ * this property will have the value {@code "1"}, to indicate the
+ * second maintenance release, this property will have the value
+ * {@code "2"}, and so on.
+ * <p>
* Multiple paths in a system property value are separated by the path
* separator character of the platform.
* <p>
- csr of
-
JDK-8285497 Add system property for Java SE specification maintenance version
- Resolved