diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 15f9eaf439e..f6697bf6f53 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -345,10 +345,12 @@ jdk.jartool_ADD_JAVAC_FLAGS += -XDstringConcat=inline ################################################################################ +jdk.scripting.nashorn_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides jdk.scripting.nashorn_COPY := .properties .js ################################################################################ +jdk.scripting.nashorn.shell_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides jdk.scripting.nashorn.shell_COPY += .js .properties ################################################################################ diff --git a/make/nashorn/project.properties b/make/nashorn/project.properties index 87238c8c3bc..f01a045693d 100644 --- a/make/nashorn/project.properties +++ b/make/nashorn/project.properties @@ -371,6 +371,7 @@ run.test.jvmargs.common=\ -Duser.language=${run.test.user.language} \ -Duser.country=${run.test.user.country} \ -Dnashorn.typeInfo.cacheDir=${build.dir}${file.separator}test${file.separator}type_info_cache \ + -Dnashorn.args.prepend=--no-deprecation-warning \ ${jfr.args} \ -XX:+HeapDumpOnOutOfMemoryError diff --git a/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java b/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java index 38b3b78da64..b0b67b43993 100644 --- a/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java +++ b/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java @@ -60,6 +60,7 @@ import jdk.nashorn.tools.Shell; /** * Interactive command line Shell for Nashorn. */ +@Deprecated(since="11", forRemoval=true) public final class Main extends Shell { private Main() {} diff --git a/src/jdk.scripting.nashorn.shell/share/classes/module-info.java b/src/jdk.scripting.nashorn.shell/share/classes/module-info.java index 3ba89b02b16..f7ddfbd8889 100644 --- a/src/jdk.scripting.nashorn.shell/share/classes/module-info.java +++ b/src/jdk.scripting.nashorn.shell/share/classes/module-info.java @@ -37,6 +37,7 @@ * @moduleGraph * @since 9 */ +@Deprecated(since="11", forRemoval=true) module jdk.scripting.nashorn.shell { requires static java.compiler; requires jdk.internal.le; diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java index c2e74ea503d..5123f0badf0 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java @@ -42,6 +42,7 @@ import jdk.nashorn.internal.runtime.linker.Bootstrap; * can use the linkers exported by this provider to support tight integration * of Nashorn objects. */ +@Deprecated(since="11", forRemoval=true) public final class NashornLinkerExporter extends GuardingDynamicLinkerExporter { /** * The default constructor. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java index 0d5bf7157ee..fe5620b8dde 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java @@ -38,8 +38,12 @@ import java.util.Set; * operations like obj[i], obj.foo, obj.func(), delete obj.foo will be delegated * to appropriate method call of this class. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public abstract class AbstractJSObject implements JSObject { /** * The default constructor. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java index a19dcd14478..c4a4ca440fb 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java @@ -29,8 +29,12 @@ package jdk.nashorn.api.scripting; * jsr-223 program embedding nashorn script can set ClassFilter instance * to be used when an engine instance is created. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public interface ClassFilter { /** * Should the Java class of the specified name be exposed to scripts? diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java index afbb0a21363..61502657ec1 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java @@ -35,8 +35,12 @@ import jdk.nashorn.internal.runtime.JSType; * operations like obj[i], obj.foo, obj.func(), delete obj.foo will be delegated * to appropriate method call of this interface. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public interface JSObject { /** * Call this object as a JavaScript function. This is equivalent to diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java index b8db1b7326d..87a997d71a2 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java @@ -42,8 +42,12 @@ import jdk.nashorn.internal.runtime.ScriptObject; * interface. In these cases, user code will get an instance of this or * implementation defined subclass. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) @SuppressWarnings("serial") public abstract class NashornException extends RuntimeException { private static final long serialVersionUID = 1L; diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java index a2d4276a10d..98bb960542b 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java @@ -67,8 +67,12 @@ import jdk.nashorn.internal.runtime.options.Options; * {@link Invocable} interfaces, allowing for efficient precompilation and repeated execution of scripts. * @see NashornScriptEngineFactory * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class NashornScriptEngine extends AbstractScriptEngine implements Compilable, Invocable { /** * Key used to associate Nashorn global object mirror with arbitrary Bindings instance. @@ -135,6 +139,10 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C } }, CREATE_CONTEXT_ACC_CTXT); + if (!nashornContext.getEnv()._no_deprecation_warning) { + System.err.println("Warning: Nashorn engine is planned to be removed from a future JDK release"); + } + // cache this option that is used often this._global_per_engine = nashornContext.getEnv()._global_per_engine; diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java index a510d8e0339..47e05bf3acb 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java @@ -46,8 +46,12 @@ import jdk.nashorn.internal.runtime.Version; * Programs executing in engines created using {@link #getScriptEngine(String[])} will have the passed arguments * accessible as a global variable named {@code "arguments"}. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class NashornScriptEngineFactory implements ScriptEngineFactory { @Override public String getEngineName() { diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java index 8d7fe11bea6..0e82a12cf91 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java @@ -58,8 +58,12 @@ import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor; /** * Mirror object that wraps a given Nashorn Script object. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class ScriptObjectMirror extends AbstractJSObject implements Bindings { private static AccessControlContext getContextAccCtxt() { final Permissions perms = new Permissions(); diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java index e2f5ea93607..7859131c62d 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java @@ -37,8 +37,12 @@ import jdk.nashorn.internal.runtime.linker.Bootstrap; /** * Utilities that are to be called from script code. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class ScriptUtils { private ScriptUtils() {} diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java index cca271b8598..3383e66f5c0 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java @@ -37,8 +37,12 @@ import jdk.nashorn.internal.runtime.Source; * A Reader that reads from a URL. Used to make sure that the reader * reads content from given URL and can be trusted to do so. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class URLReader extends Reader { // underlying URL private final URL url; diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java index 4fda2dc91d8..d1554ebc283 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * expression [ index ] * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ArrayAccessTree extends ExpressionTree { /** * Returns the array that is accessed. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java index f6ed2211f83..048f48dafb5 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java @@ -30,8 +30,12 @@ import java.util.List; /** * Represents ECMAScript array literal expression. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ArrayLiteralTree extends ExpressionTree { /** * Returns the list of Array element expressions. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java index 5999cc71a8f..c87eabbae56 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * variable = expression * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface AssignmentTree extends ExpressionTree { /** * Returns the left hand side (LHS) of this assignment. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java index ecc80727786..61fcfa775e6 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * leftOperand operator rightOperand * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface BinaryTree extends ExpressionTree { /** * Returns left hand side (LHS) of this binary expression. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java index afb7f1cd0ba..aa04fad0661 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java @@ -37,8 +37,12 @@ import java.util.List; * { statements } * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface BlockTree extends StatementTree { /** * Returns the list of statements in this block. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java index 81d606778c3..5e797539cf5 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java @@ -35,8 +35,12 @@ package jdk.nashorn.api.tree; * break label ; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface BreakTree extends GotoTree { /** * Label associated with this break statement. This is null diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java index b01d1984b22..d5d4524d5df 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java @@ -39,8 +39,12 @@ import java.util.List; * statements * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CaseTree extends Tree { /** * Case expression of this 'case' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java index 25b4b710afd..a3ed5bd25ce 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * block * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CatchTree extends Tree { /** * Returns the catch parameter identifier or parameter binding pattern of the exception caught. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java index 0eb98cfe9f7..cf2571f2b96 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java @@ -29,8 +29,12 @@ import java.util.List; /** * A tree node that represents a class declaration. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ClassDeclarationTree extends StatementTree { /** diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java index 938c6849b58..ec693d45ba7 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java @@ -30,8 +30,12 @@ import java.util.List; /** * A tree node that represents a class expression. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ClassExpressionTree extends ExpressionTree { /** * Class identifier. Optional. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java index a7afb51f859..fb424b76737 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java @@ -31,8 +31,12 @@ import java.util.List; * Represents the abstract syntax tree for compilation units (source * files) * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CompilationUnitTree extends Tree { /** * Return the list of source elements in this compilation unit. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java index b181759ed54..53d70be4060 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * variable operator expression * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CompoundAssignmentTree extends ExpressionTree { /** * Returns the left hand side (LHS) of this assignment. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java index 459682fedb8..5f90b61b43b 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * condition ? trueExpression : falseExpression * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ConditionalExpressionTree extends ExpressionTree { /** * Returns the condition expression of this ternary expression. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java index 10031edeec4..ef5ac559310 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java @@ -28,8 +28,12 @@ package jdk.nashorn.api.tree; /** * A mixin for conditional "loop" statements. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ConditionalLoopTree extends LoopTree { /** * Returns the condition expression of this 'loop' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java index 6be05bd3749..28b4f9f8485 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * continue label ; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ContinueTree extends GotoTree { /** * Label associated with this continue statement. This is null diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java index 625ca0dba25..052b0b7d632 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java @@ -33,7 +33,11 @@ package jdk.nashorn.api.tree; * debugger; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface DebuggerTree extends StatementTree { } diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java index 3ca43457c6c..0528c333a49 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java @@ -40,8 +40,12 @@ package jdk.nashorn.api.tree; *

Line terminator is as defined in ECMAScript specification which is one * of { \u000A, \u000B, \u2028, \u2029 }. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface Diagnostic { /** @@ -55,7 +59,11 @@ public interface Diagnostic { * should imply any inherent semantic meaning to the message * of the diagnostic: for example, a tool might provide an * option to report all warnings as errors. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ + @Deprecated(since="11", forRemoval=true) enum Kind { /** * Problem which prevents the tool's normal completion. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java index e0053a7950a..8c3d3bbff60 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java @@ -28,8 +28,12 @@ package jdk.nashorn.api.tree; /** * Interface for receiving diagnostics from Nashorn parser. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) @FunctionalInterface public interface DiagnosticListener { /** diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java index 45f4a8abddb..96d08644e1c 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java @@ -35,8 +35,12 @@ package jdk.nashorn.api.tree; * while ( expression ); * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface DoWhileLoopTree extends ConditionalLoopTree { /** * Returns the condition expression of this do-while statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java index 5f499924919..6de96b5559b 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java @@ -33,6 +33,10 @@ package jdk.nashorn.api.tree; * ; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface EmptyStatementTree extends StatementTree {} diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java index dd0c95a6d5f..79b9c6c3151 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java @@ -28,7 +28,11 @@ package jdk.nashorn.api.tree; /** * A tree node to stand in for a malformed expression. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ErroneousTree extends ExpressionTree { } diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java index 2e830abd219..d6c96c1d5ef 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java @@ -28,7 +28,11 @@ import java.util.List; /** * A Tree node for export entry in Module information. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface ExportEntryTree extends Tree { /** * Returns the entry's export name. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java index dbf09a59d5f..d7bbd28ab8e 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * expression ; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ExpressionStatementTree extends StatementTree { /** * Returns the expression of this expression statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java index 6076ba07775..69752f1d193 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java @@ -29,6 +29,10 @@ package jdk.nashorn.api.tree; * A tree node used as the base class for the different types of * expressions. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ExpressionTree extends Tree {} diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java index 302a4f53dd5..c34c64fcc1f 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * statement * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ForInLoopTree extends LoopTree { /** * The for..in left hand side expression. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java index 1e260a8e3df..d9466463f97 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * statement * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ForLoopTree extends ConditionalLoopTree { /** * Returns the initializer expression of this 'for' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java index 999c4d3e3f9..b6dd4241712 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * statement * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ForOfLoopTree extends LoopTree { /** * The for..of left hand side expression. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java index 38ee487d400..713a21fd497 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java @@ -37,8 +37,12 @@ import java.util.List; * this . identifier ( arguments ) * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface FunctionCallTree extends ExpressionTree { /** * Returns the function being called. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java index 2ff8eb7d802..19442de1f98 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java @@ -43,8 +43,12 @@ import java.util.List; * body * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface FunctionDeclarationTree extends StatementTree { /** * Returns the name of the function being declared. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java index d3cd3d233c1..07e931f0526 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java @@ -41,8 +41,12 @@ import java.util.List; * var func = (x) => x+1 * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface FunctionExpressionTree extends ExpressionTree { /** * Returns the name of the function being declared. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java index b08484c4d4f..c23ede97a98 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java @@ -31,8 +31,12 @@ package jdk.nashorn.api.tree; * type serves as a super interface for {@link BreakTree} and * {@link ContinueTree}. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface GotoTree extends StatementTree { /** * Label associated with this goto statement. This is null diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java index e82e257cdce..d6684fb9307 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * name * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface IdentifierTree extends ExpressionTree { /** * Returns the name of this identifier. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java index a1a65691dd0..e515dc0d539 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java @@ -39,8 +39,12 @@ package jdk.nashorn.api.tree; * elseStatement * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface IfTree extends StatementTree { /** * Returns the condition expression of this 'if' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java index f28db074080..91212ff9f49 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java @@ -28,7 +28,11 @@ import java.util.List; /** * A Tree node for import entry of Module information. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface ImportEntryTree extends Tree { /** * Returns the entry's module request. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java index 5b72ead221b..bf721fdce6b 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * expression instanceof type * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface InstanceOfTree extends ExpressionTree { /** * Returns the expression whose type is being checked. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java index 3b009fff56d..39f2e9bf749 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * label : statement * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LabeledStatementTree extends StatementTree { /** * Returns the label associated with this statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java index 042df249be3..08476e7dccc 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java @@ -29,8 +29,12 @@ package jdk.nashorn.api.tree; * Provides methods to convert between character positions and line numbers * for a compilation unit. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LineMap { /** * Find the line containing a position; a line termination diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java index b1c94f72f91..9378bb24dc0 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * value * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LiteralTree extends ExpressionTree { /** * Returns the value of this literal. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java index 54f7e3973ad..2b0d38dfb1b 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java @@ -28,8 +28,12 @@ package jdk.nashorn.api.tree; /** * A mixin for "loop" statements. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LoopTree extends StatementTree { /** * Returns the statement contained in this 'loop' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java index 61fd6f1a70c..70f779f07b0 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * expression . identifier * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface MemberSelectTree extends ExpressionTree { /** * The object expression whose member is being selected. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java index cb7d3538c80..52e06483f0e 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java @@ -28,7 +28,11 @@ import java.util.List; /** * A Tree node for Module information. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface ModuleTree extends Tree { /** * Returns the list of import entries. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java index 35e51ac5378..06ebb4fe080 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java @@ -35,8 +35,12 @@ package jdk.nashorn.api.tree; * new identifier ( arguments ) * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface NewTree extends ExpressionTree { /** * Returns the constructor expression of this 'new' expression. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java index 35c745e9fff..402669fd8d4 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java @@ -30,8 +30,12 @@ import java.util.List; /** * Represents ECMAScript object literal expression. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ObjectLiteralTree extends ExpressionTree { /** * Returns the list of properties of this object literal. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java index 8a840d4c035..d27a8a5f2db 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * ( expression ) * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ParenthesizedTree extends ExpressionTree { /** * Returns the expression within the parenthesis. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java index 2ab8050838e..40aef0a9d27 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java @@ -36,8 +36,12 @@ import jdk.nashorn.api.scripting.ScriptObjectMirror; /** * Represents nashorn ECMAScript parser instance. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface Parser { /** * Parses the source file and returns compilation unit tree diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java index 9292bdb15ed..c23119c8e2d 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java @@ -28,8 +28,12 @@ package jdk.nashorn.api.tree; /** * To represent property setting in an object literal tree. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface PropertyTree extends Tree { /** * Returns the name of this property. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java index ff77c267d12..152b9bad676 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java @@ -28,8 +28,12 @@ package jdk.nashorn.api.tree; /** * Represents regular expression literal in the source code. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface RegExpLiteralTree extends ExpressionTree { /** * Regular expression pattern to match. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java index b8d2dc8e9c8..0689c49abcc 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * return expression; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ReturnTree extends StatementTree { /** * Returns the expression being returned. This is null if no value diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java index 043eb32dc4d..43705803a67 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java @@ -40,12 +40,16 @@ package jdk.nashorn.api.tree; * subclasses with {@link java.lang.Override @Override} will help * ensure that methods are overridden as intended. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @param the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param

the type of the additional parameter to this visitor's * methods. Use {@code Void} for visitors that do not need an * additional parameter. */ +@Deprecated(since="11", forRemoval=true) public class SimpleTreeVisitorES5_1 implements TreeVisitor { @Override public R visitAssignment(final AssignmentTree node, final P r) { diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java index 8e4faf073e0..d535f41a751 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java @@ -42,12 +42,16 @@ import java.util.List; * subclasses with {@link java.lang.Override @Override} will help * ensure that methods are overridden as intended. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @param the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param

the type of the additional parameter to this visitor's * methods. Use {@code Void} for visitors that do not need an * additional parameter. */ +@Deprecated(since="11", forRemoval=true) public class SimpleTreeVisitorES6 extends SimpleTreeVisitorES5_1 { @Override public R visitCompilationUnit(final CompilationUnitTree node, final P r) { diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java index ca66dce8580..45b4263cbb8 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java @@ -27,7 +27,11 @@ package jdk.nashorn.api.tree; /** * A tree node for spread operator in array elements, function call arguments. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface SpreadTree extends ExpressionTree { /** * Returns the expression that is being spread. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java index a62d463a0f8..f2d0bf740ea 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java @@ -29,7 +29,11 @@ package jdk.nashorn.api.tree; * A tree node used as the base class for the different kinds of * statements. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface StatementTree extends Tree { } diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java index 0f70dd5c8a8..dc15265222e 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java @@ -37,8 +37,12 @@ import java.util.List; * } * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface SwitchTree extends StatementTree { /** * Returns the expression on which this statement switches. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java index 86bc4195ed5..ad799a698c1 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java @@ -35,9 +35,13 @@ import java.util.List; * `This is a String with ${computed} values in it` * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 * */ +@Deprecated(since="11", forRemoval=true) public interface TemplateLiteralTree extends ExpressionTree { /** * Returns the list of expressions in this template string diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java index 230b5b6f901..b7d4870593f 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * throw expression; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ThrowTree extends StatementTree { /** * Returns the expression being thrown. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java index eddeab54c88..d732f187104 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java @@ -31,13 +31,21 @@ package jdk.nashorn.api.tree; *

WARNING: This interface and its sub-interfaces are * subject to change as the ECMAScript programming language evolves. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface Tree { /** * Enumerates all kinds of trees. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ + @Deprecated(since="11", forRemoval=true) public enum Kind { /** * Used for instances of {@link ArrayAccessTree}. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java index 70c124d453c..677df34fe2f 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java @@ -45,6 +45,9 @@ package jdk.nashorn.api.tree; default method bodies will be introduced which will call visitUnknown method as a fallback. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @param the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param

the type of the additional parameter to this visitor's @@ -53,6 +56,7 @@ package jdk.nashorn.api.tree; * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface TreeVisitor { /** * Visit assignment tree. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java index e6b6bb8f89a..8aaad475dfa 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java @@ -39,8 +39,12 @@ import java.util.List; * finallyBlock * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface TryTree extends StatementTree { /** * Returns the 'try' block of this 'try' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java index 2e57ad81962..bcc6eb0817f 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java @@ -36,8 +36,12 @@ package jdk.nashorn.api.tree; * expression operator * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface UnaryTree extends ExpressionTree { /** * Returns the expression operated by the unary operator. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java index e14a01df595..fc601585416 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java @@ -33,8 +33,12 @@ package jdk.nashorn.api.tree; * {@linkplain TreeVisitor tree visitor} to indicate that the * visitor was created for a prior version of the language. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public class UnknownTreeException extends RuntimeException { private static final long serialVersionUID = 1L; diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java index b0cbada632f..e055ebdfada 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * var binding_pattern [ initializer ]; * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface VariableTree extends StatementTree { /** * Returns the binding of this declaration. This is an {@link IdentifierTree} diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java index a345e503ba2..cfda191692e 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * statement * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface WhileLoopTree extends ConditionalLoopTree { /** * The condition expression of this 'while' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java index a7af282393b..f08085b2d2c 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java @@ -34,8 +34,12 @@ package jdk.nashorn.api.tree; * statement * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface WithTree extends StatementTree { /** * The scope object expression for this 'with' statement. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java index 0b21bb0be2c..8ba8e20113c 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java @@ -37,8 +37,12 @@ package jdk.nashorn.api.tree; * } * * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface YieldTree extends ExpressionTree { /** * Returns the expression that is yielded. diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java index 55f02d45328..16d95255b14 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java @@ -108,6 +108,8 @@ public final class ScriptEnvironment { /** Enable experimental ECMAScript 6 features. */ public final boolean _es6; + /** do not show deprecation warning for nashorn engine and jjs usage. */ + public final boolean _no_deprecation_warning; /** Number of times a dynamic call site has to be relinked before it is * considered unstable (and thus should be linked as if it were megamorphic). @@ -306,6 +308,7 @@ public final class ScriptEnvironment { _strict = options.getBoolean("strict"); _version = options.getBoolean("version"); _verify_code = options.getBoolean("verify.code"); + _no_deprecation_warning = options.getBoolean("no.deprecation.warning"); final int configuredUrt = options.getInteger("unstable.relink.threshold"); // The default for this property is -1, so we can easily detect when diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties index 9c1eb70ae81..87bcb29ec99 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties @@ -223,6 +223,14 @@ nashorn.option.log = { \ type=Log \ } +nashorn.option.no.deprecation.warning = { \ + name="--no-deprecation-warning", \ + type=Boolean, \ + default=false, \ + desc="Do not show nashorn deprecation warning." \ +} + + nashorn.option.lazy.compilation = { \ name="--lazy-compilation", \ is_undocumented=true, \ diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java index 9722ac133d4..e141eb7d226 100644 --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java @@ -170,6 +170,9 @@ public class Shell implements PartialParser { final Global global = context.createGlobal(); final ScriptEnvironment env = context.getEnv(); + if (!env._no_deprecation_warning) { + System.err.println("Warning: The jjs tool is planned to be removed from a future JDK release"); + } final List files = env.getFiles(); if (files.isEmpty()) { return readEvalPrint(context, global); diff --git a/src/jdk.scripting.nashorn/share/classes/module-info.java b/src/jdk.scripting.nashorn/share/classes/module-info.java index 102cf6ab693..478c0418299 100644 --- a/src/jdk.scripting.nashorn/share/classes/module-info.java +++ b/src/jdk.scripting.nashorn/share/classes/module-info.java @@ -135,10 +135,14 @@ ScriptEngine nashornEngine = new ScriptEngineManager().getEngineByName("nashorn" * non-standard built-in objects: * {@code JSAdapter}, {@code JavaImporter}, {@code Packages} * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @provides javax.script.ScriptEngineFactory * @moduleGraph * @since 9 */ +@Deprecated(since="11", forRemoval=true) module jdk.scripting.nashorn { requires java.logging; requires jdk.dynalink; diff --git a/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh b/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh index 7b3510c4af3..6a3d4e76ff2 100644 --- a/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh +++ b/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh @@ -42,7 +42,7 @@ fi # -e option with JavaScript explicitly choosen as language rm -f jrunscript-eTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true -l nashorn -e "println('hello')" > jrunscript-eTest.out 2>&1 +${JRUNSCRIPT} -J-Dnashorn.args.prepend=--no-deprecation-warning -J-Djava.awt.headless=true -l nashorn -e "println('hello')" > jrunscript-eTest.out 2>&1 $golden_diff jrunscript-eTest.out ${TESTSRC}/dash-e.out if [ $? != 0 ] diff --git a/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh b/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh index 6be1e9132c6..44dbcb6a215 100644 --- a/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh +++ b/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh @@ -43,7 +43,7 @@ fi # with -l option rm -f jrunscript-fTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true -l nashorn -f ${TESTSRC}/hello.js > jrunscript-fTest.out 2>&1 +${JRUNSCRIPT} -J-Dnashorn.args.prepend=--no-deprecation-warning -J-Djava.awt.headless=true -l nashorn -f ${TESTSRC}/hello.js > jrunscript-fTest.out 2>&1 $golden_diff jrunscript-fTest.out ${TESTSRC}/dash-f.out if [ $? != 0 ] diff --git a/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh b/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh index b95273c937b..042763c8dc3 100644 --- a/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh +++ b/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh @@ -40,7 +40,7 @@ if [ $? -eq 2 ]; then fi rm -f jrunscriptTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true -l nashorn > jrunscriptTest.out 2>&1 < jrunscriptTest.out 2>&1 </dev/null -${JJS} -J-Djava.security.manager ${TESTSRC}/file.js > jjs-fileTest.out 2>&1 +${JJS} --no-deprecation-warning -J-Djava.security.manager ${TESTSRC}/file.js > jjs-fileTest.out 2>&1 $golden_diff jjs-fileTest.out ${TESTSRC}/file.out if [ $? != 0 ] diff --git a/test/nashorn/script/nosecurity/JDK-8193137.js b/test/nashorn/script/nosecurity/JDK-8193137.js index b1fef72ce77..163fed042bf 100644 --- a/test/nashorn/script/nosecurity/JDK-8193137.js +++ b/test/nashorn/script/nosecurity/JDK-8193137.js @@ -54,6 +54,6 @@ var emptyFile = new File($ENV.PWD+File.separator+"empty.js"); emptyFile.createNewFile(); emptyFile.deleteOnExit(); -$EXEC(jjsCmd + " empty.js"); +$EXEC(jjsCmd + " --no-deprecation-warning empty.js"); if($ERR != "") fail("jjs fails with empty script file");