From 30886544c53df5c9bd99a5e6fd70a2ce4609c2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Fri, 20 Mar 2020 18:00:16 +0100 Subject: [PATCH] Deprecations to clean up CPD --- .../src/main/java/net/sourceforge/pmd/lang/Parser.java | 2 ++ .../main/java/net/sourceforge/pmd/lang/TokenManager.java | 5 +++++ .../sourceforge/pmd/lang/ast/AbstractTokenManager.java | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/Parser.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/Parser.java index f4d7e4e280..7ece070e1a 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/Parser.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/Parser.java @@ -29,7 +29,9 @@ public interface Parser { * @param source * Reader that provides the source code to tokenize. * @return A TokenManager for reading token. + * @deprecated For removal in 7.0.0 */ + @Deprecated TokenManager getTokenManager(String fileName, Reader source); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/TokenManager.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/TokenManager.java index e0e67c78cc..edb26311d1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/TokenManager.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/TokenManager.java @@ -11,5 +11,10 @@ public interface TokenManager { // TODO : Change the return to GenericToken in 7.0.0 - maybe even use generics TokenManager Object getNextToken(); + + /** + * @deprecated For removal in 7.0.0 + */ + @Deprecated void setFileName(String fileName); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractTokenManager.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractTokenManager.java index 96c8e60c3d..c40f925ab0 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractTokenManager.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractTokenManager.java @@ -19,10 +19,18 @@ public abstract class AbstractTokenManager { protected Map suppressMap = new HashMap<>(); protected String suppressMarker = PMD.SUPPRESS_MARKER; + /** + * @deprecated For removal in 7.0.0 + */ + @Deprecated public static void setFileName(String fileName) { AbstractTokenManager.fileName.set(fileName); } + /** + * @deprecated For removal in 7.0.0 + */ + @Deprecated public static String getFileName() { String fileName = AbstractTokenManager.fileName.get(); return fileName == null ? "(no file name provided)" : fileName;