From 138c0e3e866df3abb8e5e83c1d043850eb59e4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 17 Mar 2020 15:04:25 +0100 Subject: [PATCH] Deprecate tokManagers for more module --- docs/pages/release_notes.md | 5 +++++ .../net/sourceforge/pmd/lang/cpp/CppTokenManager.java | 5 +++++ .../pmd/lang/ecmascript5/Ecmascript5TokenManager.java | 5 +++++ .../sourceforge/pmd/lang/matlab/MatlabTokenManager.java | 5 +++++ .../net/sourceforge/pmd/lang/modelica/ModelicaParser.java | 8 +++++++- .../pmd/lang/modelica/ModelicaTokenManager.java | 7 +++++++ .../pmd/lang/objectivec/ObjectiveCTokenManager.java | 5 +++++ 7 files changed, 39 insertions(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e28d7a7dc2..71b922c716 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -78,6 +78,11 @@ implementations, and their corresponding Parser if it exists (in the same packag * {% jdoc visualforce::lang.vf.VfTokenManager %} * {% jdoc plsql::lang.plsql.PLSQLTokenManager %} * {% jdoc jsp::lang.jsp.JspTokenManager %} +* {% jdoc modelica::lang.modelica.ModelicaTokenManager %} +* {% jdoc cpp::lang.cpp.CppTokenManager %} +* {% jdoc javascript::lang.ecmascript5.Ecmascript5TokenManager %} +* {% jdoc matlab::lang.matlab.MatlabTokenManager %} +* {% jdoc objectivec::lang.objectivec.ObjectiveCTokenManager %} ### External Contributions diff --git a/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppTokenManager.java b/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppTokenManager.java index c60c6e1d96..019139005d 100644 --- a/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppTokenManager.java +++ b/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppTokenManager.java @@ -6,12 +6,17 @@ package net.sourceforge.pmd.lang.cpp; import java.io.Reader; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.cpp.ast.CppParserTokenManager; /** * C++ Token Manager implementation. + * + * @deprecated This is internal API */ +@Deprecated +@InternalApi public class CppTokenManager implements TokenManager { private final CppParserTokenManager tokenManager; diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript5/Ecmascript5TokenManager.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript5/Ecmascript5TokenManager.java index bdfea305bc..004688dfbe 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript5/Ecmascript5TokenManager.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript5/Ecmascript5TokenManager.java @@ -6,13 +6,18 @@ package net.sourceforge.pmd.lang.ecmascript5; import java.io.Reader; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.SimpleCharStream; import net.sourceforge.pmd.lang.ecmascript5.ast.Ecmascript5ParserTokenManager; /** * Ecmascript 5 Token Manager implementation. + * + * @deprecated This is internal API */ +@Deprecated +@InternalApi public class Ecmascript5TokenManager implements TokenManager { private final Ecmascript5ParserTokenManager tokenManager; diff --git a/pmd-matlab/src/main/java/net/sourceforge/pmd/lang/matlab/MatlabTokenManager.java b/pmd-matlab/src/main/java/net/sourceforge/pmd/lang/matlab/MatlabTokenManager.java index 5b620f7664..fce6106025 100644 --- a/pmd-matlab/src/main/java/net/sourceforge/pmd/lang/matlab/MatlabTokenManager.java +++ b/pmd-matlab/src/main/java/net/sourceforge/pmd/lang/matlab/MatlabTokenManager.java @@ -6,13 +6,18 @@ package net.sourceforge.pmd.lang.matlab; import java.io.Reader; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.SimpleCharStream; import net.sourceforge.pmd.lang.matlab.ast.MatlabParserTokenManager; /** * Matlab Token Manager implementation. + * + * @deprecated This is internal API */ +@Deprecated +@InternalApi public class MatlabTokenManager implements TokenManager { private final MatlabParserTokenManager tokenManager; diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaParser.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaParser.java index a72144af07..526c3c54f4 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaParser.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaParser.java @@ -8,7 +8,9 @@ import java.io.Reader; import java.util.HashMap; import java.util.Map; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.AbstractParser; +import net.sourceforge.pmd.lang.LanguageVersionHandler; import net.sourceforge.pmd.lang.ParserOptions; import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.AbstractTokenManager; @@ -16,7 +18,11 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.SimpleCharStream; - +/** + * @deprecated This is internal API, use {@link LanguageVersionHandler#getParser(ParserOptions)}. + */ +@InternalApi +@Deprecated public class ModelicaParser extends AbstractParser { public ModelicaParser(final ParserOptions parserOptions) { super(parserOptions); diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaTokenManager.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaTokenManager.java index 5fc1a862da..b20685de24 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaTokenManager.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaTokenManager.java @@ -6,13 +6,20 @@ package net.sourceforge.pmd.lang.modelica; import java.io.Reader; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.AbstractTokenManager; import net.sourceforge.pmd.lang.ast.SimpleCharStream; import net.sourceforge.pmd.lang.modelica.ast.ModelicaParserTokenManager; +/** + * @deprecated This is internal API + */ +@Deprecated +@InternalApi public class ModelicaTokenManager implements TokenManager { + private final ModelicaParserTokenManager modelicaParserTokenManager; public ModelicaTokenManager(final Reader source) { diff --git a/pmd-objectivec/src/main/java/net/sourceforge/pmd/lang/objectivec/ObjectiveCTokenManager.java b/pmd-objectivec/src/main/java/net/sourceforge/pmd/lang/objectivec/ObjectiveCTokenManager.java index ec573e5d96..7362094a37 100644 --- a/pmd-objectivec/src/main/java/net/sourceforge/pmd/lang/objectivec/ObjectiveCTokenManager.java +++ b/pmd-objectivec/src/main/java/net/sourceforge/pmd/lang/objectivec/ObjectiveCTokenManager.java @@ -6,13 +6,18 @@ package net.sourceforge.pmd.lang.objectivec; import java.io.Reader; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.ast.SimpleCharStream; import net.sourceforge.pmd.lang.objectivec.ast.ObjectiveCParserTokenManager; /** * Objective-C Token Manager implementation. + * + * @deprecated This is internal API */ +@Deprecated +@InternalApi public class ObjectiveCTokenManager implements TokenManager { private final ObjectiveCParserTokenManager tokenManager;