From 623ba4c92e7c342b6ce9af355c0e2dda9920ccba Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 Apr 2020 20:41:54 +0200 Subject: [PATCH] [javascript] Internalize AST constructors --- docs/pages/release_notes.md | 3 +- .../ecmascript/ast/ASTArrayComprehension.java | 9 ++--- .../ast/ASTArrayComprehensionLoop.java | 10 +++--- .../lang/ecmascript/ast/ASTArrayLiteral.java | 18 +++++++--- .../lang/ecmascript/ast/ASTAssignment.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTAstRoot.java | 8 ++--- .../pmd/lang/ecmascript/ast/ASTBlock.java | 9 ++--- .../ecmascript/ast/ASTBreakStatement.java | 9 ++--- .../lang/ecmascript/ast/ASTCatchClause.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTComment.java | 9 ++--- .../ast/ASTConditionalExpression.java | 9 ++--- .../ecmascript/ast/ASTContinueStatement.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTDoLoop.java | 9 ++--- .../lang/ecmascript/ast/ASTElementGet.java | 9 ++--- .../ecmascript/ast/ASTEmptyExpression.java | 9 ++--- .../ecmascript/ast/ASTEmptyStatement.java | 6 +++- .../ast/ASTExpressionStatement.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTForInLoop.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTForLoop.java | 9 ++--- .../lang/ecmascript/ast/ASTFunctionCall.java | 9 ++--- .../lang/ecmascript/ast/ASTFunctionNode.java | 9 ++--- .../lang/ecmascript/ast/ASTIfStatement.java | 9 ++--- .../ecmascript/ast/ASTInfixExpression.java | 9 ++--- .../ecmascript/ast/ASTKeywordLiteral.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTLabel.java | 9 ++--- .../ecmascript/ast/ASTLabeledStatement.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTLetNode.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTName.java | 9 ++--- .../lang/ecmascript/ast/ASTNewExpression.java | 9 ++--- .../lang/ecmascript/ast/ASTNumberLiteral.java | 9 ++--- .../lang/ecmascript/ast/ASTObjectLiteral.java | 18 +++++++--- .../ecmascript/ast/ASTObjectProperty.java | 9 ++--- .../ast/ASTParenthesizedExpression.java | 9 ++--- .../lang/ecmascript/ast/ASTPropertyGet.java | 9 ++--- .../lang/ecmascript/ast/ASTRegExpLiteral.java | 9 ++--- .../ecmascript/ast/ASTReturnStatement.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTScope.java | 9 ++--- .../lang/ecmascript/ast/ASTStringLiteral.java | 9 ++--- .../lang/ecmascript/ast/ASTSwitchCase.java | 9 ++--- .../ecmascript/ast/ASTSwitchStatement.java | 9 ++--- .../ecmascript/ast/ASTThrowStatement.java | 9 ++--- .../lang/ecmascript/ast/ASTTryStatement.java | 9 ++--- .../ecmascript/ast/ASTUnaryExpression.java | 9 ++--- .../ast/ASTVariableDeclaration.java | 9 ++--- .../ast/ASTVariableInitializer.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTWhileLoop.java | 9 ++--- .../lang/ecmascript/ast/ASTWithStatement.java | 9 ++--- .../lang/ecmascript/ast/ASTXmlDotQuery.java | 9 ++--- .../lang/ecmascript/ast/ASTXmlExpression.java | 9 ++--- .../lang/ecmascript/ast/ASTXmlMemberGet.java | 9 ++--- .../pmd/lang/ecmascript/ast/ASTXmlString.java | 9 ++--- .../ast/AbstractEcmascriptNode.java | 16 ++++++--- .../ast/AbstractInfixEcmascriptNode.java | 6 +++- .../ecmascript/ast/DestructuringNode.java | 2 +- .../lang/ecmascript/ast/EcmascriptNode.java | 4 ++- .../lang/ecmascript/ast/EcmascriptParser.java | 2 +- .../ast/EcmascriptParserVisitor.java | 2 +- .../ast/EcmascriptParserVisitorAdapter.java | 2 +- .../ecmascript/ast/EcmascriptTreeBuilder.java | 36 ++++++++++--------- .../ecmascript/ast/TrailingCommaNode.java | 6 +++- 60 files changed, 315 insertions(+), 229 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 320b997bb8..fa98c0332a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -80,7 +80,7 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr As part of the changes we'd like to do to AST classes for 7.0.0, we would like to hide some methods and constructors that rule writers should not have access to. -The following usages are now deprecated in the **Visualforce** and **PLSQL** ASTs: +The following usages are now deprecated in the **Javascript**, **Visualforce** and **PLSQL** ASTs: * Manual instantiation of nodes. **Constructors of node classes are deprecated** and marked {% jdoc core::annotation.InternalApi %}. Nodes should only be obtained from the parser, @@ -101,6 +101,7 @@ The following usages are now deprecated in the **Visualforce** and **PLSQL** AST These deprecations are added to the following language modules in this release. Please look at the package documentation to find out the full list of deprecations. +* Javascript: **{% jdoc_package javascript::lang.ecmascript.ast %}** * Visualforce: **{% jdoc_package visualforce::lang.vf.ast %}** * PL/SQL: **{% jdoc_package plsql::lang.plsql.ast %}** diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehension.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehension.java index bac1b7ce85..c19b626cd5 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehension.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehension.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ArrayComprehension; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTArrayComprehension extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTArrayComprehension(ArrayComprehension arrayComprehension) { super(arrayComprehension); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehensionLoop.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehensionLoop.java index c815518225..c7007f5982 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehensionLoop.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayComprehensionLoop.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,15 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ArrayComprehensionLoop; -public class ASTArrayComprehensionLoop extends AbstractEcmascriptNode { +import net.sourceforge.pmd.annotation.InternalApi; +public class ASTArrayComprehensionLoop extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTArrayComprehensionLoop(ArrayComprehensionLoop arrayComprehensionLoop) { super(arrayComprehensionLoop); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayLiteral.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayLiteral.java index 0365dce7b2..eb70858d21 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayLiteral.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTArrayLiteral.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,17 +6,18 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ArrayLiteral; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTArrayLiteral extends AbstractEcmascriptNode implements DestructuringNode, TrailingCommaNode { private boolean trailingComma; + @Deprecated + @InternalApi public ASTArrayLiteral(ArrayLiteral arrayLiteral) { super(arrayLiteral); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); @@ -33,7 +34,14 @@ public class ASTArrayLiteral extends AbstractEcmascriptNode } @Override + @Deprecated + @InternalApi public void setTrailingComma(boolean trailingComma) { - this.trailingComma = trailingComma; + setTrailingCommaExists(trailingComma); + } + + @Override + protected void setTrailingCommaExists(boolean b) { + this.trailingComma = b; } } diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAssignment.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAssignment.java index df21972ad1..802e9a729f 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAssignment.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAssignment.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.Assignment; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTAssignment extends AbstractInfixEcmascriptNode { + @Deprecated + @InternalApi public ASTAssignment(Assignment asssignment) { super(asssignment); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAstRoot.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAstRoot.java index 7d752fbbb1..f019aebd23 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAstRoot.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTAstRoot.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,16 +6,16 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.AstRoot; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.ast.RootNode; public class ASTAstRoot extends AbstractEcmascriptNode implements RootNode { + @Deprecated + @InternalApi public ASTAstRoot(AstRoot astRoot) { super(astRoot); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBlock.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBlock.java index 0664e036ee..20d29018fa 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBlock.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBlock.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.Block; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTBlock extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTBlock(Block block) { super(block); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBreakStatement.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBreakStatement.java index 0553a6d88d..6c976b370c 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBreakStatement.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTBreakStatement.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,15 +6,16 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.BreakStatement; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTBreakStatement extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTBreakStatement(BreakStatement breakStatement) { super(breakStatement); super.setImage(breakStatement.getBreakLabel() != null ? breakStatement.getBreakLabel().getIdentifier() : null); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTCatchClause.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTCatchClause.java index c9986c6a2d..6ddfd31e55 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTCatchClause.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTCatchClause.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.CatchClause; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTCatchClause extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTCatchClause(CatchClause catchClause) { super(catchClause); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTComment.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTComment.java index 35d8f676a0..bc509a043d 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTComment.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTComment.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.Comment; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTComment extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTComment(Comment comment) { super(comment); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTConditionalExpression.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTConditionalExpression.java index 9168d32d97..379b05676e 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTConditionalExpression.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTConditionalExpression.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ConditionalExpression; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTConditionalExpression extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTConditionalExpression(ConditionalExpression conditionalExpression) { super(conditionalExpression); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTContinueStatement.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTContinueStatement.java index fa0f1e818d..5c133dd09c 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTContinueStatement.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTContinueStatement.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,15 +6,16 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ContinueStatement; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTContinueStatement extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTContinueStatement(ContinueStatement continueStatement) { super(continueStatement); super.setImage(continueStatement.getLabel() != null ? continueStatement.getLabel().getIdentifier() : null); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTDoLoop.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTDoLoop.java index a3030807ff..532b5edd98 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTDoLoop.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTDoLoop.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.DoLoop; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTDoLoop extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTDoLoop(DoLoop doLoop) { super(doLoop); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTElementGet.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTElementGet.java index c7f735e682..b41998c1f9 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTElementGet.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTElementGet.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ElementGet; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTElementGet extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTElementGet(ElementGet elementGet) { super(elementGet); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyExpression.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyExpression.java index e6c8a9ab40..afcab8437c 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyExpression.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyExpression.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.EmptyExpression; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTEmptyExpression extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTEmptyExpression(EmptyExpression emptyExpression) { super(emptyExpression); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyStatement.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyStatement.java index 7972311bc0..1b53091ad8 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyStatement.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTEmptyStatement.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,7 +6,11 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.EmptyStatement; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTEmptyStatement extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTEmptyStatement(EmptyStatement emptyStatement) { super(emptyStatement); } diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTExpressionStatement.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTExpressionStatement.java index 0757f9329d..de2a5acb65 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTExpressionStatement.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTExpressionStatement.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -7,14 +7,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.Token; import org.mozilla.javascript.ast.ExpressionStatement; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTExpressionStatement extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTExpressionStatement(ExpressionStatement expressionStatement) { super(expressionStatement); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForInLoop.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForInLoop.java index beba25df6b..d148c56ff7 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForInLoop.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForInLoop.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ForInLoop; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTForInLoop extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTForInLoop(ForInLoop forInLoop) { super(forInLoop); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForLoop.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForLoop.java index d81b640e63..d2d4cc3b78 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForLoop.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTForLoop.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.ForLoop; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTForLoop extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTForLoop(ForLoop forLoop) { super(forLoop); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionCall.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionCall.java index 2e975149e9..b527d45747 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionCall.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionCall.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.FunctionCall; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTFunctionCall extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTFunctionCall(FunctionCall functionCall) { super(functionCall); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionNode.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionNode.java index 19de0add06..599fddae59 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionNode.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTFunctionNode.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,15 +6,16 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.FunctionNode; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTFunctionNode extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTFunctionNode(FunctionNode functionNode) { super(functionNode); super.setImage(functionNode.getName()); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTIfStatement.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTIfStatement.java index 06541a5b4f..82eb5ad242 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTIfStatement.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTIfStatement.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.IfStatement; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTIfStatement extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTIfStatement(IfStatement ifStatement) { super(ifStatement); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTInfixExpression.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTInfixExpression.java index bbf8842263..31213ab076 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTInfixExpression.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTInfixExpression.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,14 +6,15 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.InfixExpression; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTInfixExpression extends AbstractInfixEcmascriptNode { + @Deprecated + @InternalApi public ASTInfixExpression(InfixExpression infixExpression) { super(infixExpression); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTKeywordLiteral.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTKeywordLiteral.java index 9d797fe6d4..c32c3f5470 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTKeywordLiteral.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTKeywordLiteral.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -9,15 +9,16 @@ import java.util.Locale; import org.mozilla.javascript.Token; import org.mozilla.javascript.ast.KeywordLiteral; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTKeywordLiteral extends AbstractEcmascriptNode { + @Deprecated + @InternalApi public ASTKeywordLiteral(KeywordLiteral keywordLiteral) { super(keywordLiteral); super.setImage(Token.typeToName(keywordLiteral.getType()).toLowerCase(Locale.ROOT)); } - /** - * Accept the visitor. - */ @Override public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { return visitor.visit(this, data); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTLabel.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTLabel.java index 6cd6466a67..0280e58c1b 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTLabel.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/ASTLabel.java @@ -1,4 +1,4 @@ -/** +/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ @@ -6,15 +6,16 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.Label; +import net.sourceforge.pmd.annotation.InternalApi; + public class ASTLabel extends AbstractEcmascriptNode