From 6142dc39785dfaf44fd71b0b9ee3a9a9027b1d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 18 Apr 2020 16:56:50 +0200 Subject: [PATCH] Rename java reader --- ...InputReader.java => JavaEscapeReader.java} | 4 ++-- .../ast/impl/javacc/CharStreamImplTest.java | 2 +- ...derTest.java => JavaEscapeReaderTest.java} | 20 +++++++++---------- .../pmd/lang/java/ast/JavaTokenDocument.java | 4 ++-- .../net/sourceforge/pmd/cpd/JSPTokenizer.java | 4 ++-- .../net/sourceforge/pmd/cpd/VfTokenizer.java | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) rename pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/{JavaInputReader.java => JavaEscapeReader.java} (96%) rename pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/{JavaInputReaderTest.java => JavaEscapeReaderTest.java} (88%) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaInputReader.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaEscapeReader.java similarity index 96% rename from pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaInputReader.java rename to pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaEscapeReader.java index 3c1915c7d3..57101082b3 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaInputReader.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaEscapeReader.java @@ -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); } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStreamImplTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStreamImplTest.java index 2d57cae381..b2cd262fd8 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStreamImplTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/CharStreamImplTest.java @@ -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); } }); } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaInputReaderTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaEscapeReaderTest.java similarity index 88% rename from pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaInputReaderTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaEscapeReaderTest.java index 7086c6f1cd..cac67177c8 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaInputReaderTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaEscapeReaderTest.java @@ -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]; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaTokenDocument.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaTokenDocument.java index a1d74fe154..92416a814f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaTokenDocument.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaTokenDocument.java @@ -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 diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPTokenizer.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPTokenizer.java index 48a62f5131..1465435a22 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPTokenizer.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPTokenizer.java @@ -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); } }; } diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfTokenizer.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfTokenizer.java index ba239ef3cf..312481b653 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfTokenizer.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfTokenizer.java @@ -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); } }; }