Merge branch 'deprecate-token-mgr-stuff' into tmp

This commit is contained in:
Clément Fournier
2020-03-20 18:07:42 +01:00
3 changed files with 15 additions and 0 deletions

View File

@ -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);

View File

@ -11,5 +11,10 @@ public interface TokenManager {
// TODO : Change the return to GenericToken in 7.0.0 - maybe even use generics TokenManager<T extends GenericToken>
Object getNextToken();
/**
* @deprecated For removal in 7.0.0
*/
@Deprecated
void setFileName(String fileName);
}

View File

@ -19,10 +19,18 @@ public abstract class AbstractTokenManager {
protected Map<Integer, String> 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;