From 8aec5bba7ea5d9c702db9a116d005ad81afbf1ad Mon Sep 17 00:00:00 2001 From: Michal Kordas Date: Sun, 23 Aug 2015 01:02:37 +0200 Subject: [PATCH] Review visibility and usages of protected fields. #1555 Fixes `ProtectedField` inspection violations in test code. Description: >Reports protected instance variables. Constants (i.e. variables marked static and final) are not reported. --- .../com/puppycrawl/tools/checkstyle/BaseCheckTestSupport.java | 1 - .../tools/checkstyle/comments/CompareTreesWithComments.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/BaseCheckTestSupport.java b/src/test/java/com/puppycrawl/tools/checkstyle/BaseCheckTestSupport.java index 84a2522cc..6cba93116 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/BaseCheckTestSupport.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/BaseCheckTestSupport.java @@ -39,7 +39,6 @@ public abstract class BaseCheckTestSupport { protected final ByteArrayOutputStream baos = new ByteArrayOutputStream(); protected final PrintStream stream = new PrintStream(baos); - protected final Properties props = new Properties(); public static DefaultConfiguration createCheckConfig(Class clazz) { return new DefaultConfiguration(clazz.getName()); diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/comments/CompareTreesWithComments.java b/src/test/java/com/puppycrawl/tools/checkstyle/comments/CompareTreesWithComments.java index 0aca3a34b..c2a977e87 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/comments/CompareTreesWithComments.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/comments/CompareTreesWithComments.java @@ -7,7 +7,7 @@ import com.puppycrawl.tools.checkstyle.api.Check; import com.puppycrawl.tools.checkstyle.api.DetailAST; public class CompareTreesWithComments extends Check { - protected static DetailAST expectedTree; + static DetailAST expectedTree; @Override public boolean isCommentNodesRequired() {