Deprecate CharStream and impls

This commit is contained in:
Clément Fournier
2020-01-22 17:06:37 +01:00
parent 11c2b201c1
commit 2c670339d8
3 changed files with 14 additions and 2 deletions

View File

@ -129,6 +129,12 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr
methods on {% jdoc apex::lang.apex.ast.ApexParserVisitor %} and its implementations. methods on {% jdoc apex::lang.apex.ast.ApexParserVisitor %} and its implementations.
Use {% jdoc apex::lang.apex.ast.ApexNode %} instead, now considers comments too. Use {% jdoc apex::lang.apex.ast.ApexNode %} instead, now considers comments too.
* {% jdoc core::lang.ast.CharStream %}, {% jdoc core::lang.ast.JavaCharStream %},
{% jdoc core::lang.ast.SimpleCharStream %}: these are APIs used by our JavaCC
implementations and that will be moved/refactored for PMD 7.0.0. They should not
be used, extended or implemented directly.
##### For removal ##### For removal
* pmd-core * pmd-core

View File

@ -42,6 +42,9 @@
<replace file="${target}/net/sourceforge/pmd/lang/ast/dummy/CharStream.java" <replace file="${target}/net/sourceforge/pmd/lang/ast/dummy/CharStream.java"
token="net.sourceforge.pmd.lang.ast.dummy" token="net.sourceforge.pmd.lang.ast.dummy"
value="net.sourceforge.pmd.lang.ast" /> value="net.sourceforge.pmd.lang.ast" />
<replace file="${target}/net/sourceforge/pmd/lang/ast/dummy/CharStream.java"
token="interface"
value="@Deprecated @net.sourceforge.pmd.annotation.InternalApi interface" />
<move overwrite="true" <move overwrite="true"
file="${target}/net/sourceforge/pmd/lang/ast/dummy/CharStream.java" file="${target}/net/sourceforge/pmd/lang/ast/dummy/CharStream.java"
tofile="${target}/net/sourceforge/pmd/lang/ast/CharStream.java" /> tofile="${target}/net/sourceforge/pmd/lang/ast/CharStream.java" />
@ -59,7 +62,7 @@
value="net.sourceforge.pmd.lang.ast" /> value="net.sourceforge.pmd.lang.ast" />
<replace file="${target}/net/sourceforge/pmd/lang/ast/dummy/JavaCharStream.java" <replace file="${target}/net/sourceforge/pmd/lang/ast/dummy/JavaCharStream.java"
token="class JavaCharStream" token="class JavaCharStream"
value="class JavaCharStream implements CharStream" /> value="@Deprecated @net.sourceforge.pmd.annotation.InternalApi class JavaCharStream implements CharStream" />
<move overwrite="true" <move overwrite="true"
file="${target}/net/sourceforge/pmd/lang/ast/dummy/JavaCharStream.java" file="${target}/net/sourceforge/pmd/lang/ast/dummy/JavaCharStream.java"
tofile="${target}/net/sourceforge/pmd/lang/ast/JavaCharStream.java" /> tofile="${target}/net/sourceforge/pmd/lang/ast/JavaCharStream.java" />
@ -77,7 +80,7 @@
value="net.sourceforge.pmd.lang.ast" /> value="net.sourceforge.pmd.lang.ast" />
<replace file="${target}/net/sourceforge/pmd/lang/ast/dummy/SimpleCharStream.java" <replace file="${target}/net/sourceforge/pmd/lang/ast/dummy/SimpleCharStream.java"
token="public class SimpleCharStream" token="public class SimpleCharStream"
value="public class SimpleCharStream implements CharStream" /> value="@Deprecated @net.sourceforge.pmd.annotation.InternalApi public class SimpleCharStream implements CharStream" />
<move overwrite="true" <move overwrite="true"
file="${target}/net/sourceforge/pmd/lang/ast/dummy/SimpleCharStream.java" file="${target}/net/sourceforge/pmd/lang/ast/dummy/SimpleCharStream.java"
tofile="${target}/net/sourceforge/pmd/lang/ast/SimpleCharStream.java" /> tofile="${target}/net/sourceforge/pmd/lang/ast/SimpleCharStream.java" />

View File

@ -8,6 +8,7 @@ import java.io.IOException;
import java.io.Reader; import java.io.Reader;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.lang.ast.SimpleCharStream; import net.sourceforge.pmd.lang.ast.SimpleCharStream;
/** /**
@ -16,6 +17,8 @@ import net.sourceforge.pmd.lang.ast.SimpleCharStream;
* *
* @author Andreas Dangel * @author Andreas Dangel
*/ */
@Deprecated
@InternalApi
public class CppCharStream extends SimpleCharStream { public class CppCharStream extends SimpleCharStream {
private static final Pattern CONTINUATION = Pattern.compile("\\\\\\n|\\\\\\r\\n"); private static final Pattern CONTINUATION = Pattern.compile("\\\\\\n|\\\\\\r\\n");