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 3546ce01b5..a9e1581f54 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 @@ -36,7 +36,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 0e2e9408ac..a1f2e2801e 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;