forked from phoedos/pmd
Rename java reader
This commit is contained in:
parent
dc8ac96013
commit
6142dc3978
@ -17,9 +17,9 @@ import net.sourceforge.pmd.util.document.Chars;
|
||||
* unicode escapes.
|
||||
*/
|
||||
@SuppressWarnings("PMD.AssignmentInOperand")
|
||||
public final class JavaInputReader extends BackslashEscapeReader {
|
||||
public final class JavaEscapeReader extends BackslashEscapeReader {
|
||||
|
||||
public JavaInputReader(Chars input) {
|
||||
public JavaEscapeReader(Chars input) {
|
||||
super(input);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public class CharStreamImplTest {
|
||||
return CharStream.create(new JavaccTokenDocument(TextDocument.readOnlyString(abcd)) {
|
||||
@Override
|
||||
public EscapeAwareReader newReader(Chars text) {
|
||||
return new JavaInputReader(text);
|
||||
return new JavaEscapeReader(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ import org.junit.Test;
|
||||
import net.sourceforge.pmd.util.document.Chars;
|
||||
|
||||
|
||||
public class JavaInputReaderTest {
|
||||
public class JavaEscapeReaderTest {
|
||||
|
||||
@NonNull
|
||||
public JavaInputReader readString(String input) {
|
||||
return new JavaInputReader(Chars.wrap(input, true));
|
||||
public JavaEscapeReader readString(String input) {
|
||||
return new JavaEscapeReader(Chars.wrap(input, true));
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ public class JavaInputReaderTest {
|
||||
public void testSimpleRead() throws IOException {
|
||||
|
||||
String input = "abcdede";
|
||||
try (JavaInputReader r = readString(input)) {
|
||||
try (JavaEscapeReader r = readString(input)) {
|
||||
|
||||
char[] chars = new char[12];
|
||||
|
||||
@ -39,7 +39,7 @@ public class JavaInputReaderTest {
|
||||
public void testNotAnEscape1Read() throws IOException {
|
||||
|
||||
String input = "abc\\dede";
|
||||
try (JavaInputReader r = readString(input)) {
|
||||
try (JavaEscapeReader r = readString(input)) {
|
||||
|
||||
char[] chars = new char[12];
|
||||
|
||||
@ -54,7 +54,7 @@ public class JavaInputReaderTest {
|
||||
public void testNotAnEscape1Read2() throws IOException {
|
||||
|
||||
String input = "abc\\\\\\dede";
|
||||
try (JavaInputReader r = readString(input)) {
|
||||
try (JavaEscapeReader r = readString(input)) {
|
||||
|
||||
char[] chars = new char[12];
|
||||
|
||||
@ -70,7 +70,7 @@ public class JavaInputReaderTest {
|
||||
|
||||
String input = "abc\\\\\\dede";
|
||||
// ^
|
||||
try (JavaInputReader r = readString(input)) {
|
||||
try (JavaEscapeReader r = readString(input)) {
|
||||
|
||||
char[] chars = new char[12];
|
||||
|
||||
@ -95,7 +95,7 @@ public class JavaInputReaderTest {
|
||||
public void testAnEscapeStopAtEnd() throws IOException {
|
||||
|
||||
String input = "abc\\\\\\u00a0dede";
|
||||
try (JavaInputReader r = readString(input)) {
|
||||
try (JavaEscapeReader r = readString(input)) {
|
||||
|
||||
char[] chars = new char[12];
|
||||
|
||||
@ -115,7 +115,7 @@ public class JavaInputReaderTest {
|
||||
public void testSeveralEscapes() throws IOException {
|
||||
|
||||
String input = "abc\\\\\\u00a0d\\uu00a0ede";
|
||||
try (JavaInputReader r = readString(input)) {
|
||||
try (JavaEscapeReader r = readString(input)) {
|
||||
|
||||
char[] chars = new char[20];
|
||||
|
||||
@ -135,7 +135,7 @@ public class JavaInputReaderTest {
|
||||
public void testAnEscapeInsideBlock() throws IOException {
|
||||
|
||||
String input = "abc\\\\\\u00a0dede\\u00a0";
|
||||
try (JavaInputReader r = readString(input)) {
|
||||
try (JavaEscapeReader r = readString(input)) {
|
||||
|
||||
char[] chars = new char[12];
|
||||
|
@ -16,7 +16,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.EscapeAwareReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaInputReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaEscapeReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument;
|
||||
import net.sourceforge.pmd.util.document.Chars;
|
||||
@ -48,7 +48,7 @@ final class JavaTokenDocument extends JavaccTokenDocument {
|
||||
|
||||
@Override
|
||||
public EscapeAwareReader newReader(Chars text) {
|
||||
return new JavaInputReader(text);
|
||||
return new JavaEscapeReader(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ import net.sourceforge.pmd.cpd.internal.JavaCCTokenizer;
|
||||
import net.sourceforge.pmd.lang.TokenManager;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.EscapeAwareReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaInputReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaEscapeReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument;
|
||||
import net.sourceforge.pmd.lang.jsp.ast.JspTokenKinds;
|
||||
@ -27,7 +27,7 @@ public class JSPTokenizer extends JavaCCTokenizer {
|
||||
return new JavaccTokenDocument(textDoc) {
|
||||
@Override
|
||||
public EscapeAwareReader newReader(Chars text) {
|
||||
return new JavaInputReader(text);
|
||||
return new JavaEscapeReader(text);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import net.sourceforge.pmd.cpd.internal.JavaCCTokenizer;
|
||||
import net.sourceforge.pmd.lang.TokenManager;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.EscapeAwareReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaInputReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaEscapeReader;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;
|
||||
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument;
|
||||
import net.sourceforge.pmd.lang.vf.ast.VfTokenKinds;
|
||||
@ -30,7 +30,7 @@ public class VfTokenizer extends JavaCCTokenizer {
|
||||
return new JavaccTokenDocument(textDoc) {
|
||||
@Override
|
||||
public EscapeAwareReader newReader(Chars text) {
|
||||
return new JavaInputReader(text);
|
||||
return new JavaEscapeReader(text);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user