From ee8c84d2dcedcb0e7b432fc4a6ca3aba66bfdac5 Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 13 Feb 2003 05:47:01 +0000 Subject: [PATCH] resolving unused-imports warnings --- .../src/org/aspectj/testing/Tester.java | 3 +- .../testing/drivers/HarnessSelectionTest.java | 3 -- .../org/aspectj/testing/util/TestUtil.java | 32 +++++++++++++------ .../aspectj/testing/util/TestUtilTest.java | 1 - 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/testing-client/src/org/aspectj/testing/Tester.java b/testing-client/src/org/aspectj/testing/Tester.java index 66aae9443..6d4a278ae 100644 --- a/testing-client/src/org/aspectj/testing/Tester.java +++ b/testing-client/src/org/aspectj/testing/Tester.java @@ -11,9 +11,8 @@ * ******************************************************************/ -package org.aspectj.testing; // XXX move to its own client package +package org.aspectj.testing; -import org.aspectj.bridge.AbortException; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.Message; diff --git a/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessSelectionTest.java b/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessSelectionTest.java index a167f7d87..f6e65ebed 100644 --- a/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessSelectionTest.java +++ b/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessSelectionTest.java @@ -16,10 +16,8 @@ package org.aspectj.testing.drivers; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.MessageHandler; import org.aspectj.bridge.MessageUtil; -import org.aspectj.testing.drivers.Harness.RunResult; import org.aspectj.testing.harness.bridge.AbstractRunSpec; import org.aspectj.testing.harness.bridge.AjcTest; -import org.aspectj.testing.harness.bridge.AjcTest.Spec; import org.aspectj.testing.run.IRunStatus; import org.aspectj.testing.run.RunValidator; import org.aspectj.testing.util.BridgeUtil; @@ -30,7 +28,6 @@ import org.aspectj.util.LangUtil; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Hashtable; import java.util.List; diff --git a/testing-util/src/org/aspectj/testing/util/TestUtil.java b/testing-util/src/org/aspectj/testing/util/TestUtil.java index b33e1fac9..553684eb3 100644 --- a/testing-util/src/org/aspectj/testing/util/TestUtil.java +++ b/testing-util/src/org/aspectj/testing/util/TestUtil.java @@ -28,7 +28,6 @@ import java.io.InputStream; import java.io.PrintStream; import java.io.StringReader; import java.io.StringWriter; -import java.io.Writer; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; @@ -209,7 +208,18 @@ public final class TestUtil { /** * If there is an expected dir, expect each file in its subtree * to match a corresponding actual file in the base directory. - * @return boolean + * This does NOT check that all actual files have corresponding + * expected files. + * This ignores directory paths containing "CVS". + * @param handler the IMessageHandler sink for error messages + * @param expectedBaseDir the File path to the directory + * containing expected files, all of which are compared + * with any corresponding actual files + * @param actualBaseDir the File path to the base directory + * from which to find any actual files corresponding + * to expected files. + * @return true if all files in the expectedBaseDir directory tree + * have matching files in the actualBaseDir directory tree. */ public static boolean sameDirectoryContents( final IMessageHandler handler, @@ -217,7 +227,6 @@ public final class TestUtil { final File actualBaseDir, final boolean fastFail) { LangUtil.throwIaxIfNull(handler, "handler"); - FileUtil.throwIaxUnlessCanReadDir(actualBaseDir, "actualBaseDir"); if (!FileUtil.canReadDir(expectedBaseDir)) { MessageUtil.fail(handler, " expected dir not found: " + expectedBaseDir); return false; @@ -229,7 +238,10 @@ public final class TestUtil { String[] paths = FileUtil.listFiles(expectedBaseDir); boolean result = true; for (int i = 0; i < paths.length; i++) { - if (!sameFiles(handler, expectedBaseDir, actualBaseDir, paths[i]) && !result) { + if (-1 != paths[i].indexOf("CVS")) { + continue; + } + if (!sameFiles(handler, expectedBaseDir, actualBaseDir, paths[i]) && result) { result = false; if (fastFail) { break; @@ -241,14 +253,15 @@ public final class TestUtil { //------------ File-comparison utilities (XXX need their own class...) /** - * Compare two files, line by line, and report differences as one FAIL message + * Test interface to + * compare two files, line by line, and report differences as one FAIL message * if a handler is supplied. This preprocesses .class files by disassembling. * @param handler the IMessageHandler for any FAIL messages (null to ignore) * @param expectedFile the File path to the canonical file * @param actualFile the File path to the actual file, if any * @return true if the input files are the same, based on per-line comparisons */ - public static boolean sameFiles ( + static boolean sameFiles ( IMessageHandler handler, File expectedFile, File actualFile) { @@ -256,7 +269,8 @@ public final class TestUtil { } /** - * Compare two files, line by line, and report differences as one FAIL message + * Test interface to + * compare two files, line by line, and report differences as one FAIL message * if a handler is supplied. This preprocesses .class files by disassembling. * This method assumes that the files are at the same offset from two * respective base directories. @@ -266,7 +280,7 @@ public final class TestUtil { * @param path the String path offset from the base directories * @return true if the input files are the same, based on per-line comparisons */ - public static boolean sameFiles ( + static boolean sameFiles ( IMessageHandler handler, File expectedBaseDir, File actualBaseDir, @@ -279,7 +293,7 @@ public final class TestUtil { /** * This does the work, selecting a lineator subclass and converting public * API's to JDiff APIs for comparison. - * Currently, all jdiff interfaces are method-local, so this class with load + * Currently, all jdiff interfaces are method-local, so this class will load * without it; if we do use it, we can avoid the duplication. */ private static boolean doSameFile( diff --git a/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java b/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java index 73da9cf83..e884fb143 100644 --- a/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java +++ b/testing-util/testsrc/org/aspectj/testing/util/TestUtilTest.java @@ -13,7 +13,6 @@ package org.aspectj.testing.util; -import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.MessageHandler; import org.aspectj.bridge.MessageUtil; import org.aspectj.util.FileUtil; -- 2.39.5