Skip to content

Commit

Permalink
8285497: Add system property for Java SE specification maintenance ve…
Browse files Browse the repository at this point in the history
…rsion

Reviewed-by: dholmes, iris, mchung, andrew
Backport-of: 31a63ba5f255e09349b3842984ac5bb3ad8e6c0b
  • Loading branch information
jddarcy committed Aug 24, 2022
1 parent e3251a2 commit d0ad242
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
16 changes: 15 additions & 1 deletion jdk/src/share/classes/java/lang/System.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -559,6 +559,10 @@ public static native void arraycopy(Object src, int srcPos,
* <td>Java installation directory</td></tr>
* <tr><td><code>java.vm.specification.version</code></td>
* <td>Java Virtual Machine specification version</td></tr>
* <tr><td><code>java.specification.maintenance.version</code></td>
* <td>Java Runtime Environment specification maintenance
* version, may be interpreted as a positive integer
* <em>(optional, see below)</em></td></tr>
* <tr><td><code>java.vm.specification.vendor</code></td>
* <td>Java Virtual Machine specification vendor</td></tr>
* <tr><td><code>java.vm.specification.name</code></td>
Expand Down Expand Up @@ -610,6 +614,16 @@ public static native void arraycopy(Object src, int srcPos,
* <td>User's current working directory</td></tr>
* </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>
Expand Down
5 changes: 4 additions & 1 deletion jdk/src/share/classes/sun/security/provider/PolicyFile.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -686,6 +686,9 @@ public Void run() {
pe.add(new PropertyPermission
("java.specification.version",
SecurityConstants.PROPERTY_READ_ACTION));
pe.add(new PropertyPermission
("java.specification.maintenance.version",
SecurityConstants.PROPERTY_READ_ACTION));
pe.add(new PropertyPermission
("java.specification.vendor",
SecurityConstants.PROPERTY_READ_ACTION));
Expand Down
1 change: 1 addition & 0 deletions jdk/src/share/lib/security/java.policy
Expand Up @@ -36,6 +36,7 @@ grant {
permission java.util.PropertyPermission "line.separator", "read";

permission java.util.PropertyPermission "java.specification.version", "read";
permission java.util.PropertyPermission "java.specification.maintenance.version", "read";
permission java.util.PropertyPermission "java.specification.vendor", "read";
permission java.util.PropertyPermission "java.specification.name", "read";

Expand Down
4 changes: 3 additions & 1 deletion jdk/src/share/native/java/lang/System.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -214,6 +214,8 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)

PUTPROP(props, "java.specification.version",
JDK_MAJOR_VERSION "." JDK_MINOR_VERSION);
PUTPROP(props, "java.specification.maintenance.version",
"4");
PUTPROP(props, "java.specification.name",
"Java Platform API Specification");
PUTPROP(props, "java.specification.vendor",
Expand Down

1 comment on commit d0ad242

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.