From 7593af832b497ca7bc7659127c7ec51a6bcd86d7 Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Fri, 2 Aug 2024 16:22:07 -0700 Subject: [PATCH] 8311530: Deprecate jdk.jsobject module for removal --- make/conf/module-loader-map.conf | 2 +- src/java.base/share/lib/security/default.policy | 4 ---- src/jdk.jsobject/share/classes/module-info.java | 4 ++++ .../share/classes/netscape/javascript/JSException.java | 4 ++++ .../share/classes/netscape/javascript/JSObject.java | 4 ++++ .../share/classes/netscape/javascript/package-info.java | 7 +++++++ 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/make/conf/module-loader-map.conf b/make/conf/module-loader-map.conf index e904031186dee..dbf526431ab67 100644 --- a/make/conf/module-loader-map.conf +++ b/make/conf/module-loader-map.conf @@ -62,6 +62,7 @@ UPGRADEABLE_PLATFORM_MODULES= \ java.compiler \ jdk.graal.compiler \ jdk.graal.compiler.management \ + jdk.jsobject \ # PLATFORM_MODULES= \ @@ -79,7 +80,6 @@ PLATFORM_MODULES= \ jdk.crypto.cryptoki \ jdk.dynalink \ jdk.httpserver \ - jdk.jsobject \ jdk.localedata \ jdk.naming.dns \ jdk.security.auth \ diff --git a/src/java.base/share/lib/security/default.policy b/src/java.base/share/lib/security/default.policy index aa67bd6b53e66..d9bfdede97857 100644 --- a/src/java.base/share/lib/security/default.policy +++ b/src/java.base/share/lib/security/default.policy @@ -167,10 +167,6 @@ grant codeBase "jrt:/jdk.graal.compiler" { permission java.security.AllPermission; }; -grant codeBase "jrt:/jdk.jsobject" { - permission java.security.AllPermission; -}; - grant codeBase "jrt:/jdk.localedata" { permission java.lang.RuntimePermission "accessClassInPackage.sun.text.*"; permission java.lang.RuntimePermission "accessClassInPackage.sun.util.*"; diff --git a/src/jdk.jsobject/share/classes/module-info.java b/src/jdk.jsobject/share/classes/module-info.java index 7903dbb2c2433..60e521fcf942b 100644 --- a/src/jdk.jsobject/share/classes/module-info.java +++ b/src/jdk.jsobject/share/classes/module-info.java @@ -28,7 +28,11 @@ * * @moduleGraph * @since 9 + * @deprecated Users are advised to ship the jdk.jsobject module + * with their application. */ +@Deprecated(since = "24", forRemoval = true) +@SuppressWarnings("removal") module jdk.jsobject { exports netscape.javascript; } diff --git a/src/jdk.jsobject/share/classes/netscape/javascript/JSException.java b/src/jdk.jsobject/share/classes/netscape/javascript/JSException.java index 5d677cccec8f4..0594b79a8c2d4 100644 --- a/src/jdk.jsobject/share/classes/netscape/javascript/JSException.java +++ b/src/jdk.jsobject/share/classes/netscape/javascript/JSException.java @@ -30,7 +30,11 @@ * a marker class to indicate an exception relating to the JavaScript * interface. * @since 1.5 + * @deprecated Users are advised to ship the jdk.jsobject module + * with their application. */ +@Deprecated(since = "24", forRemoval = true) +@SuppressWarnings("removal") public class JSException extends RuntimeException { private static final long serialVersionUID = 2778103758223661489L; diff --git a/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java b/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java index 0eff2d18e264d..6c16ed545b8b6 100644 --- a/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java +++ b/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java @@ -44,7 +44,11 @@ * engine is converted to JavaScript data types. *

* @since 1.5 + * @deprecated Users are advised to ship the jdk.jsobject module + * with their application. */ +@Deprecated(since = "24", forRemoval = true) +@SuppressWarnings("removal") public abstract class JSObject { /** * Constructs a new JSObject. Users should neither call this method nor diff --git a/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java b/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java index fcc97132a5074..52d8e019da0a5 100644 --- a/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java +++ b/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java @@ -24,6 +24,13 @@ */ /** + *

+ * Deprecated, for removal: This API element is subject to removal + * in a future version.
+ * Users are advised to ship the jdk.jsobject module + * with their application. + *

+ * *

* Provides Java code the ability to access the JavaScript engine and the * HTML DOM in the web browser.