From 2fd21d49c3b5c5bafd7e45887dc30a217c6824c9 Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Tue, 18 Jun 2024 11:53:06 -0700 Subject: [PATCH] WIP: Remove jdk.jsobject module --- bin/unshuffle_list.txt | 1 - make/conf/docs-modules.conf | 1 - make/conf/module-loader-map.conf | 2 - .../share/lib/security/default.policy | 4 - .../share/classes/module-info.java | 34 ----- .../netscape/javascript/JSException.java | 61 -------- .../classes/netscape/javascript/JSObject.java | 134 ------------------ .../netscape/javascript/package-info.java | 38 ----- .../ctw/modules/jdk_jsobject.java | 38 ----- .../doclet/testModules/jdk/element-list | 2 - .../doclet/testRecordTypes/jdk17/element-list | 4 +- 11 files changed, 1 insertion(+), 318 deletions(-) delete mode 100644 src/jdk.jsobject/share/classes/module-info.java delete mode 100644 src/jdk.jsobject/share/classes/netscape/javascript/JSException.java delete mode 100644 src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java delete mode 100644 src/jdk.jsobject/share/classes/netscape/javascript/package-info.java delete mode 100644 test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java diff --git a/bin/unshuffle_list.txt b/bin/unshuffle_list.txt index 36ad8feabc4de..3dc239e787641 100644 --- a/bin/unshuffle_list.txt +++ b/bin/unshuffle_list.txt @@ -78,7 +78,6 @@ src/jdk.jdi : jdk/src/jdk.jdi src/jdk.jdwp.agent : jdk/src/jdk.jdwp.agent src/jdk.jlink : jdk/src/jdk.jlink src/jdk.jshell : langtools/src/jdk.jshell -src/jdk.jsobject : jdk/src/jdk.jsobject src/jdk.jstatd : jdk/src/jdk.jstatd src/jdk.localedata : jdk/src/jdk.localedata src/jdk.management : jdk/src/jdk.management diff --git a/make/conf/docs-modules.conf b/make/conf/docs-modules.conf index b88f6ff6d9093..691744ddd8eac 100644 --- a/make/conf/docs-modules.conf +++ b/make/conf/docs-modules.conf @@ -51,7 +51,6 @@ DOCS_MODULES= \ jdk.jdwp.agent \ jdk.jfr \ jdk.jlink \ - jdk.jsobject \ jdk.jshell \ jdk.jstatd \ jdk.localedata \ diff --git a/make/conf/module-loader-map.conf b/make/conf/module-loader-map.conf index e904031186dee..00e324d80493c 100644 --- a/make/conf/module-loader-map.conf +++ b/make/conf/module-loader-map.conf @@ -79,7 +79,6 @@ PLATFORM_MODULES= \ jdk.crypto.cryptoki \ jdk.dynalink \ jdk.httpserver \ - jdk.jsobject \ jdk.localedata \ jdk.naming.dns \ jdk.security.auth \ @@ -123,7 +122,6 @@ NATIVE_ACCESS_MODULES= \ jdk.internal.le \ jdk.internal.vm.ci \ jdk.jfr \ - jdk.jsobject \ jdk.localedata \ jdk.management \ jdk.management.agent \ 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 deleted file mode 100644 index 7903dbb2c2433..0000000000000 --- a/src/jdk.jsobject/share/classes/module-info.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2016, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * Defines the API for the JavaScript Object. - * - * @moduleGraph - * @since 9 - */ -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 deleted file mode 100644 index 5d677cccec8f4..0000000000000 --- a/src/jdk.jsobject/share/classes/netscape/javascript/JSException.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2006, 2023, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package netscape.javascript; - -/** - * Thrown when an exception is raised in the JavaScript engine. This is merely - * a marker class to indicate an exception relating to the JavaScript - * interface. - * @since 1.5 - */ -public class JSException extends RuntimeException { - private static final long serialVersionUID = 2778103758223661489L; - - /** - * Constructs a new JavaScript exception with null as it's detail message. - */ - public JSException() { - super(); - } - - /** - * Construct a new JavaScript exception with the specified detail message. - * - * @param s The detail message - */ - public JSException(String s) { - super(s); - } - - /** - * Construct a new JavaScript exception with the specified cause. - * - * @param t Throwable cause - */ - public JSException(Throwable t) { - super(t); - } -} diff --git a/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java b/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java deleted file mode 100644 index 0eff2d18e264d..0000000000000 --- a/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2006, 2023, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package netscape.javascript; - -/** - *

- * Allows Java code to manipulate JavaScript objects. - *

- * - *

- * When a JavaScript object is passed or returned to Java code, it - * is wrapped in an instance of {@code JSObject}. When a - * {@code JSObject} instance is passed to the JavaScript engine, - * it is unwrapped back to its original JavaScript object. The - * {@code JSObject} class provides a way to invoke JavaScript - * methods and examine JavaScript properties. - *

- * - *

Any data returned from the JavaScript engine to Java is - * converted to Java data types. Certain data passed to the JavaScript - * engine is converted to JavaScript data types. - *

- * @since 1.5 - */ -public abstract class JSObject { - /** - * Constructs a new JSObject. Users should neither call this method nor - * subclass JSObject. - */ - protected JSObject() { - } - - /** - * Calls a JavaScript method. Equivalent to - * "this.methodName(args[0], args[1], ...)" in JavaScript. - * - * @param methodName The name of the JavaScript method to be invoked. - * @param args the Java objects passed as arguments to the method. - * @return Result of the method. - * @throws JSException when an error is reported from the browser or - * JavaScript engine. - */ - public abstract Object call(String methodName, Object... args) throws JSException; - - /** - * Evaluates a JavaScript expression. The expression is a string of - * JavaScript source code which will be evaluated in the context given by - * "this". - * - * @param s The JavaScript expression. - * @return Result of the JavaScript evaluation. - * @throws JSException when an error is reported from the browser or - * JavaScript engine. - */ - public abstract Object eval(String s) throws JSException; - - /** - * Retrieves a named member of a JavaScript object. Equivalent to - * "this.name" in JavaScript. - * - * @param name The name of the JavaScript property to be accessed. - * @return The value of the property. - * @throws JSException when an error is reported from the browser or - * JavaScript engine. - */ - public abstract Object getMember(String name) throws JSException; - - /** - * Sets a named member of a JavaScript object. Equivalent to - * "this.name = value" in JavaScript. - * - * @param name The name of the JavaScript property to be accessed. - * @param value The value of the property. - * @throws JSException when an error is reported from the browser or - * JavaScript engine. - */ - public abstract void setMember(String name, Object value) throws JSException; - - /** - * Removes a named member of a JavaScript object. Equivalent - * to "delete this.name" in JavaScript. - * - * @param name The name of the JavaScript property to be removed. - * @throws JSException when an error is reported from the browser or - * JavaScript engine. - */ - public abstract void removeMember(String name) throws JSException; - - /** - * Retrieves an indexed member of a JavaScript object. Equivalent to - * "this[index]" in JavaScript. - * - * @param index The index of the array to be accessed. - * @return The value of the indexed member. - * @throws JSException when an error is reported from the browser or - * JavaScript engine. - */ - public abstract Object getSlot(int index) throws JSException; - - /** - * Sets an indexed member of a JavaScript object. Equivalent to - * "this[index] = value" in JavaScript. - * - * @param index The index of the array to be accessed. - * @param value The value to set - * @throws JSException when an error is reported from the browser or - * JavaScript engine. - */ - public abstract void setSlot(int index, Object value) throws JSException; - -} diff --git a/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java b/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java deleted file mode 100644 index d3770732bc001..0000000000000 --- a/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2008, 2016, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - *

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

- * - *

- * The classes in this package were initially specified by Netscape, and are the - * de facto standard mechanism for calling JavaScript from the Java runtime. - *

- */ - -package netscape.javascript; diff --git a/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java b/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java deleted file mode 100644 index e1d2105919f2b..0000000000000 --- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from jdk.jsobject module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.access - * java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules jdk.jsobject - * - * @build jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jsobject - */ diff --git a/test/langtools/jdk/javadoc/doclet/testModules/jdk/element-list b/test/langtools/jdk/javadoc/doclet/testModules/jdk/element-list index e3c40a9e12170..b41712137d06d 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/jdk/element-list +++ b/test/langtools/jdk/javadoc/doclet/testModules/jdk/element-list @@ -302,8 +302,6 @@ jdk.jshell jdk.jshell.execution jdk.jshell.spi jdk.jshell.tool -module:jdk.jsobject -netscape.javascript module:jdk.jstatd module:jdk.localedata module:jdk.management diff --git a/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk17/element-list b/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk17/element-list index 34e3d598eddc9..aea0595432ff2 100644 --- a/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk17/element-list +++ b/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk17/element-list @@ -251,8 +251,6 @@ jdk.jshell jdk.jshell.execution jdk.jshell.spi jdk.jshell.tool -module:jdk.jsobject -netscape.javascript module:jdk.jstatd module:jdk.localedata module:jdk.management @@ -281,4 +279,4 @@ org.w3c.dom.css org.w3c.dom.html org.w3c.dom.stylesheets org.w3c.dom.xpath -module:jdk.zipfs \ No newline at end of file +module:jdk.zipfs