diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 1835c23513..22b8af37f0 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -200,6 +200,8 @@ package or made (package) private and are not accessible anymore. * {%jdoc java::types.ast.internal.LazyTypeResolver %} * {%jdoc java::types.JMethodSig#internalApi() %} has been removed. * {%jdoc java::types.TypeOps#isSameTypeInInference(java::types.JTypeMirror,java::types.JTypeMirror) %} (now package private) +* pmd-jsp + * {%jdoc jsp::ast.JspParser#getTokenBehavior() %} has been removed. **Newly internal classes, interfaces and methods** diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/InternalApiBridge.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/InternalApiBridge.java new file mode 100644 index 0000000000..abd8e3db3a --- /dev/null +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/InternalApiBridge.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.jsp.ast; + +import net.sourceforge.pmd.annotation.InternalApi; +import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument; + +/** + * @apiNote Internal API + */ +@InternalApi +public final class InternalApiBridge { + private InternalApiBridge() { + // internal + } + + public static JavaccTokenDocument.TokenDocumentBehavior getJspTokenBehavior() { + return JspParser.TOKEN_BEHAVIOR; + } +} diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/JspParser.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/JspParser.java index f508b21bc5..8aea39f5a2 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/JspParser.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/JspParser.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.jsp.ast; -import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument.TokenDocumentBehavior; @@ -15,7 +14,7 @@ import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeParserAdapter; */ public final class JspParser extends JjtreeParserAdapter { - private static final TokenDocumentBehavior TOKEN_BEHAVIOR = new TokenDocumentBehavior(JspTokenKinds.TOKEN_NAMES); + static final TokenDocumentBehavior TOKEN_BEHAVIOR = new TokenDocumentBehavior(JspTokenKinds.TOKEN_NAMES); @Override protected TokenDocumentBehavior tokenBehavior() { @@ -26,9 +25,4 @@ public final class JspParser extends JjtreeParserAdapter { protected ASTCompilationUnit parseImpl(CharStream cs, ParserTask task) throws ParseException { return new JspParserImpl(cs).CompilationUnit().makeTaskInfo(task); } - - @InternalApi - public static TokenDocumentBehavior getTokenBehavior() { - return TOKEN_BEHAVIOR; - } } diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/OpenTagRegister.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/OpenTagRegister.java index df00733685..ef9db4d4f9 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/OpenTagRegister.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/ast/OpenTagRegister.java @@ -9,8 +9,6 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.annotation.InternalApi; - /** * Utility class to keep track of unclosed tags. The mechanism is rather simple. * If a end tag (</x>) is encountered, it will iterate through the open @@ -21,7 +19,6 @@ import net.sourceforge.pmd.annotation.InternalApi; * @author Victor Bucutea * */ -@InternalApi class OpenTagRegister { private List tagList = new ArrayList<>(); diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/cpd/JSPTokenizer.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/cpd/JSPTokenizer.java index 1a6b8044ab..6ff273f3c7 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/cpd/JSPTokenizer.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/cpd/JSPTokenizer.java @@ -9,14 +9,14 @@ import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; import net.sourceforge.pmd.lang.document.TextDocument; -import net.sourceforge.pmd.lang.jsp.ast.JspParser; +import net.sourceforge.pmd.lang.jsp.ast.InternalApiBridge; import net.sourceforge.pmd.lang.jsp.ast.JspTokenKinds; public class JSPTokenizer extends JavaCCTokenizer { @Override protected TokenManager makeLexerImpl(TextDocument doc) { - return JspTokenKinds.newTokenManager(CharStream.create(doc, JspParser.getTokenBehavior())); + return JspTokenKinds.newTokenManager(CharStream.create(doc, InternalApiBridge.getJspTokenBehavior())); } }