Line terminator is as defined in ECMAScript specification which is one
* of { \u000A, \u000B, \u2028, \u2029 }.
*
- * @since 1.9
+ * @since 9
*/
public interface Diagnostic {
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java
index a79829f9829..e0053a7950a 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java
@@ -28,7 +28,7 @@ package jdk.nashorn.api.tree;
/**
* Interface for receiving diagnostics from Nashorn parser.
*
- * @since 1.9
+ * @since 9
*/
@FunctionalInterface
public interface DiagnosticListener {
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java
index de4d848fe73..45f4a8abddb 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java
@@ -35,7 +35,7 @@ package jdk.nashorn.api.tree;
* while ( expression );
*
*
- * @since 1.9
+ * @since 9
*/
public interface DoWhileLoopTree extends ConditionalLoopTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java
index 280ae6db867..5f499924919 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java
@@ -33,6 +33,6 @@ package jdk.nashorn.api.tree;
* ;
*
*
- * @since 1.9
+ * @since 9
*/
public interface EmptyStatementTree extends StatementTree {}
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java
index eb7805114aa..dd0c95a6d5f 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java
@@ -28,7 +28,7 @@ package jdk.nashorn.api.tree;
/**
* A tree node to stand in for a malformed expression.
*
- * @since 1.9
+ * @since 9
*/
public interface ErroneousTree extends ExpressionTree {
}
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java
index 8881031db57..dbf09a59d5f 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* expression ;
*
*
- * @since 1.9
+ * @since 9
*/
public interface ExpressionStatementTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java
index 7fa88a17541..6076ba07775 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java
@@ -29,6 +29,6 @@ package jdk.nashorn.api.tree;
* A tree node used as the base class for the different types of
* expressions.
*
- * @since 1.9
+ * @since 9
*/
public interface ExpressionTree extends Tree {}
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java
index 84a91558501..302a4f53dd5 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java
@@ -34,7 +34,7 @@ package jdk.nashorn.api.tree;
* statement
*
*
- * @since 1.9
+ * @since 9
*/
public interface ForInLoopTree extends LoopTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java
index 83fc3904e9c..1e260a8e3df 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java
@@ -34,7 +34,7 @@ package jdk.nashorn.api.tree;
* statement
*
*
- * @since 1.9
+ * @since 9
*/
public interface ForLoopTree extends ConditionalLoopTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java
index 82a0651ff61..38ee487d400 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java
@@ -37,7 +37,7 @@ import java.util.List;
* this . identifier ( arguments )
*
*
- * @since 1.9
+ * @since 9
*/
public interface FunctionCallTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java
index 345346873fd..1fbd0945c8f 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java
@@ -37,7 +37,7 @@ import java.util.List;
* body
*
*
- * @since 1.9
+ * @since 9
*/
public interface FunctionDeclarationTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java
index 260eef9c555..13a89bdadbd 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java
@@ -37,7 +37,7 @@ import java.util.List;
* body
*
*
- * @since 1.9
+ * @since 9
*/
public interface FunctionExpressionTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java
index 4c77ad47f0c..b08484c4d4f 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java
@@ -31,7 +31,7 @@ package jdk.nashorn.api.tree;
* type serves as a super interface for {@link BreakTree} and
* {@link ContinueTree}.
*
- * @since 1.9
+ * @since 9
*/
public interface GotoTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java
index 8af19227f2d..95498572e86 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* name
*
*
- * @since 1.9
+ * @since 9
*/
public interface IdentifierTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java
index d0ffebfb040..a1a65691dd0 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java
@@ -39,7 +39,7 @@ package jdk.nashorn.api.tree;
* elseStatement
*
*
- * @since 1.9
+ * @since 9
*/
public interface IfTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java
index 7eb4506430e..5b72ead221b 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* expression instanceof type
*
*
- * @since 1.9
+ * @since 9
*/
public interface InstanceOfTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java
index dd2c6433d88..3b009fff56d 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* label : statement
*
*
- * @since 1.9
+ * @since 9
*/
public interface LabeledStatementTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java
index 3a4f050ff52..042df249be3 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java
@@ -29,7 +29,7 @@ package jdk.nashorn.api.tree;
* Provides methods to convert between character positions and line numbers
* for a compilation unit.
*
- * @since 1.9
+ * @since 9
*/
public interface LineMap {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java
index 5ec1c327c7b..b1c94f72f91 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java
@@ -34,7 +34,7 @@ package jdk.nashorn.api.tree;
* value
*
*
- * @since 1.9
+ * @since 9
*/
public interface LiteralTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java
index 97687059831..54f7e3973ad 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java
@@ -28,7 +28,7 @@ package jdk.nashorn.api.tree;
/**
* A mixin for "loop" statements.
*
- * @since 1.9
+ * @since 9
*/
public interface LoopTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java
index d145737d4db..61fd6f1a70c 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* expression . identifier
*
*
- * @since 1.9
+ * @since 9
*/
public interface MemberSelectTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java
index ecad024d42d..35e51ac5378 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java
@@ -35,7 +35,7 @@ package jdk.nashorn.api.tree;
* new identifier ( arguments )
*
*
- * @since 1.9
+ * @since 9
*/
public interface NewTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java
index f287786a41e..35c745e9fff 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java
@@ -30,7 +30,7 @@ import java.util.List;
/**
* Represents ECMAScript object literal expression.
*
- * @since 1.9
+ * @since 9
*/
public interface ObjectLiteralTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java
index d90bc8c8d9e..8a840d4c035 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java
@@ -34,7 +34,7 @@ package jdk.nashorn.api.tree;
* ( expression )
*
*
- * @since 1.9
+ * @since 9
*/
public interface ParenthesizedTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java
index 10bbebe2639..63a1bad3a91 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java
@@ -36,7 +36,7 @@ import jdk.nashorn.api.scripting.ScriptObjectMirror;
/**
* Represents nashorn ECMAScript parser instance.
*
- * @since 1.9
+ * @since 9
*/
public interface Parser {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java
index fed1e42d1ed..0b4af44ce4b 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java
@@ -28,7 +28,7 @@ package jdk.nashorn.api.tree;
/**
* To represent property setting in an object literal tree.
*
- * @since 1.9
+ * @since 9
*/
public interface PropertyTree extends Tree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java
index 2b09e5233ce..d3729e47dd8 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java
@@ -28,7 +28,7 @@ package jdk.nashorn.api.tree;
/**
* Represents regular expression literal in the source code.
*
- * @since 1.9
+ * @since 9
*/
public interface RegExpLiteralTree extends Tree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java
index 765c9d713a7..b8d2dc8e9c8 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java
@@ -34,7 +34,7 @@ package jdk.nashorn.api.tree;
* return expression;
*
*
- * @since 1.9
+ * @since 9
*/
public interface ReturnTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java
index 7dc58da667d..a62d463a0f8 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java
@@ -29,7 +29,7 @@ package jdk.nashorn.api.tree;
* A tree node used as the base class for the different kinds of
* statements.
*
- * @since 1.9
+ * @since 9
*/
public interface StatementTree extends Tree {
}
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java
index 3c9da0e773e..0f70dd5c8a8 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java
@@ -37,7 +37,7 @@ import java.util.List;
* }
*
*
- * @since 1.9
+ * @since 9
*/
public interface SwitchTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java
index c1f0a679a3c..230b5b6f901 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* throw expression;
*
*
- * @since 1.9
+ * @since 9
*/
public interface ThrowTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java
index 13cd6f88266..6b3de2c3591 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java
@@ -31,7 +31,7 @@ package jdk.nashorn.api.tree;
*
WARNING: This interface and its sub-interfaces are
* subject to change as the ECMAScript programming language evolves.
*
- * @since 1.9
+ * @since 9
*/
public interface Tree {
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java
index f97b5208e39..c9c8a9666d8 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java
@@ -51,7 +51,7 @@ package jdk.nashorn.api.tree;
* methods. Use {@code Void} for visitors that do not need an
* additional parameter.
*
- * @since 1.9
+ * @since 9
*/
public interface TreeVisitor {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java
index 583d560900a..e6b6bb8f89a 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java
@@ -39,7 +39,7 @@ import java.util.List;
* finallyBlock
*
*
- * @since 1.9
+ * @since 9
*/
public interface TryTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java
index 16fb334402b..2e57ad81962 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java
@@ -36,7 +36,7 @@ package jdk.nashorn.api.tree;
* expressionoperator
*
*
- * @since 1.9
+ * @since 9
*/
public interface UnaryTree extends ExpressionTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java
index 0a801b8fbfb..00f65cd9d19 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* {@linkplain TreeVisitor tree visitor} to indicate that the
* visitor was created for a prior version of the language.
*
- * @since 1.9
+ * @since 9
*/
public class UnknownTreeException extends RuntimeException {
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java
index 2fd4d427b16..8697360b9bc 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java
@@ -33,7 +33,7 @@ package jdk.nashorn.api.tree;
* varnameinitializer ;
*
*
- * @since 1.9
+ * @since 9
*/
public interface VariableTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java
index 63fb01a5fbc..a345e503ba2 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java
@@ -34,7 +34,7 @@ package jdk.nashorn.api.tree;
* statement
*
*
- * @since 1.9
+ * @since 9
*/
public interface WhileLoopTree extends ConditionalLoopTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java
index 684498ca65b..a7af282393b 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java
@@ -34,7 +34,7 @@ package jdk.nashorn.api.tree;
* statement
*
*
- * @since 1.9
+ * @since 9
*/
public interface WithTree extends StatementTree {
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java
index 725856c447f..832de0b0596 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java
@@ -68,7 +68,7 @@
*
*
*
- * @since 1.9
+ * @since 9
*/
package jdk.nashorn.api.tree;
From fdfdf19e75b6982efd9609b797400f679a687d5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?=
Date: Thu, 21 Jan 2016 16:31:27 +0100
Subject: [PATCH 5/5] 8147845: Varargs Array functions still leaking longs
Reviewed-by: mhaupt, sundar
---
.../internal/codegen/FoldConstants.java | 2 +-
.../nashorn/internal/objects/NativeArray.java | 9 ++--
.../jdk/nashorn/internal/runtime/JSType.java | 24 ++++------
nashorn/test/script/basic/JDK-8147845.js | 44 +++++++++++++++++++
4 files changed, 58 insertions(+), 21 deletions(-)
create mode 100644 nashorn/test/script/basic/JDK-8147845.js
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java
index f79be1dafaa..c288e80bb89 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java
@@ -335,7 +335,7 @@ final class FoldConstants extends SimpleNodeVisitor implements Loggable {
break;
case SHR:
final long result = JSType.toUint32(lhs.getInt32() >>> rhs.getInt32());
- return LiteralNode.newInstance(token, finish, JSType.isRepresentableAsInt(result) ? (int) result : (double) result);
+ return LiteralNode.newInstance(token, finish, JSType.toNarrowestNumber(result));
case SAR:
return LiteralNode.newInstance(token, finish, lhs.getInt32() >> rhs.getInt32());
case SHL:
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java
index 4441dd8bed8..6773840a0a8 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java
@@ -70,7 +70,6 @@ import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
import jdk.nashorn.internal.runtime.arrays.ArrayLikeIterator;
import jdk.nashorn.internal.runtime.arrays.ContinuousArrayData;
import jdk.nashorn.internal.runtime.arrays.IntElements;
-import jdk.nashorn.internal.runtime.arrays.IntOrLongElements;
import jdk.nashorn.internal.runtime.arrays.IteratorAction;
import jdk.nashorn.internal.runtime.arrays.NumericElements;
import jdk.nashorn.internal.runtime.linker.Bootstrap;
@@ -285,7 +284,7 @@ public final class NativeArray extends ScriptObject implements OptimisticBuiltin
final long newLen = NativeArray.validLength(newLenDesc.getValue());
// Step 3e - note that we need to convert to int or double as long is not considered a JS number type anymore
- newLenDesc.setValue(JSType.isRepresentableAsInt(newLen) ? Integer.valueOf((int) newLen) : Double.valueOf((double) newLen));
+ newLenDesc.setValue(JSType.toNarrowestNumber(newLen));
// Step 3f
// increasing array length - just need to set new length value (and attributes if any) and return
@@ -1043,7 +1042,7 @@ public final class NativeArray extends ScriptObject implements OptimisticBuiltin
if (bulkable(sobj) && sobj.getArray().length() + args.length <= JSType.MAX_UINT) {
final ArrayData newData = sobj.getArray().push(true, args);
sobj.setArray(newData);
- return newData.length();
+ return JSType.toNarrowestNumber(newData.length());
}
long len = JSType.toUint32(sobj.getLength());
@@ -1052,7 +1051,7 @@ public final class NativeArray extends ScriptObject implements OptimisticBuiltin
}
sobj.set("length", len, CALLSITE_STRICT);
- return len;
+ return JSType.toNarrowestNumber(len);
} catch (final ClassCastException | NullPointerException e) {
throw typeError(Context.getGlobal(), e, "not.an.object", ScriptRuntime.safeToString(self));
}
@@ -1471,7 +1470,7 @@ public final class NativeArray extends ScriptObject implements OptimisticBuiltin
final long newLength = len + items.length;
sobj.set("length", newLength, CALLSITE_STRICT);
- return newLength;
+ return JSType.toNarrowestNumber(newLength);
}
/**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java
index b791acd92d1..22925e8a0c4 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java
@@ -791,6 +791,15 @@ public enum JSType {
return Double.NaN;
}
+ /**
+ * Convert a long to the narrowest JavaScript Number type. This returns either a
+ * {@link Integer} or {@link Double} depending on the magnitude of {@code l}.
+ * @param l a long value
+ * @return the value converted to Integer or Double
+ */
+ public static Number toNarrowestNumber(final long l) {
+ return isRepresentableAsInt(l) ? Integer.valueOf((int) l) : Double.valueOf((double) l);
+ }
/**
* JavaScript compliant conversion of Boolean to number
@@ -1726,21 +1735,6 @@ public enum JSType {
}
}
- /**
- * Returns the boxed version of a primitive class
- * @param clazz the class
- * @return the boxed type of clazz, or unchanged if not primitive
- */
- public static Class> getBoxedClass(final Class> clazz) {
- if (clazz == int.class) {
- return Integer.class;
- } else if (clazz == double.class) {
- return Double.class;
- }
- assert !clazz.isPrimitive();
- return clazz;
- }
-
/**
* Create a method handle constant of the correct primitive type
* for a constant object
diff --git a/nashorn/test/script/basic/JDK-8147845.js b/nashorn/test/script/basic/JDK-8147845.js
new file mode 100644
index 00000000000..87dbb50b22c
--- /dev/null
+++ b/nashorn/test/script/basic/JDK-8147845.js
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/**
+ * JDK-8147845: Varargs Array functions still leaking longs
+ *
+ * @test
+ * @run
+ */
+
+Assert.assertTrue([].push() === 0);
+Assert.assertTrue([].unshift() === 0);
+Assert.assertTrue(typeof [].push() === 'number');
+Assert.assertTrue(typeof [].unshift() === 'number');
+
+Assert.assertTrue([].push(1, 2, 3) === 3);
+Assert.assertTrue([].unshift(1, 2, 3) === 3);
+Assert.assertTrue(typeof [].push(1, 2, 3) === 'number');
+Assert.assertTrue(typeof [].unshift(1, 2, 3) === 'number');
+
+Assert.assertTrue([].push(1) === 1);
+Assert.assertTrue([].unshift(1) === 1);
+Assert.assertTrue(typeof [].push(1) === 'number');
+Assert.assertTrue(typeof [].unshift(1) === 'number');