From 2af817968f9ed836edfc9694122d8bf4dfd35c38 Mon Sep 17 00:00:00 2001 From: Michal Kordas Date: Wed, 19 Aug 2015 19:47:14 +0200 Subject: [PATCH] Remove unused array declarations. #1555 Fixes `MismatchedArrayReadWrite` inspection violations in test code. Description: >Reports any array fields or variables whose contents are read but not written, or written but not read. Such mismatched reads and writes are pointless, and probably indicate dead, incomplete or erroneous code. --- .../java/com/puppycrawl/tools/checkstyle/MainTest.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java index 71b7c6423..62c8c0e08 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java @@ -435,8 +435,6 @@ public class MainTest { @Test public void testCreateListener_IllegalStateException() throws Exception { - Class[] param = new Class[1]; - param[0] = File.class; Method method = Main.class.getDeclaredMethod("createListener", String.class, String.class); method.setAccessible(true); try { @@ -454,8 +452,6 @@ public class MainTest { @Test public void testCreateListenerWithLocation_IllegalStateException() throws Exception { - Class[] param = new Class[1]; - param[0] = File.class; Method method = Main.class.getDeclaredMethod("createListener", String.class, String.class); method.setAccessible(true); String outDir = "myfolder123"; @@ -509,8 +505,6 @@ public class MainTest { @Test @SuppressWarnings("unchecked") public void testListFiles_notFile() throws Exception { - Class[] param = new Class[1]; - param[0] = File.class; Method method = Main.class.getDeclaredMethod("listFiles", File.class); method.setAccessible(true); @@ -526,8 +520,6 @@ public class MainTest { @Test @SuppressWarnings("unchecked") public void testListFiles_DirectoryWithNull() throws Exception { - Class[] param = new Class[1]; - param[0] = File.class; Method method = Main.class.getDeclaredMethod("listFiles", File.class); method.setAccessible(true);