From b1772c28d0f025525b9baef62ddf948e39f60c11 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 11 Feb 2019 12:19:47 -0800 Subject: [PATCH] polish --- .../testing/util/AccumulatingFileFilter.java | 2 +- .../org/aspectj/testing/util/BridgeUtil.java | 20 +++++++------- .../java/org/aspectj/testing/util/Diffs.java | 6 ++--- .../org/aspectj/testing/util/FileUtil.java | 4 +-- .../org/aspectj/testing/util/LinkCheck.java | 26 +++++++++---------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/testing/src/test/java/org/aspectj/testing/util/AccumulatingFileFilter.java b/testing/src/test/java/org/aspectj/testing/util/AccumulatingFileFilter.java index e01f71874..3ee387a7f 100644 --- a/testing/src/test/java/org/aspectj/testing/util/AccumulatingFileFilter.java +++ b/testing/src/test/java/org/aspectj/testing/util/AccumulatingFileFilter.java @@ -22,7 +22,7 @@ import java.util.Vector; * accumulated. */ public class AccumulatingFileFilter extends ValidFileFilter { - Vector files = new Vector(); + Vector files = new Vector(); public final boolean accept(File f) { if (super.accept(f) && (accumulate(f))) { files.add(f); diff --git a/testing/src/test/java/org/aspectj/testing/util/BridgeUtil.java b/testing/src/test/java/org/aspectj/testing/util/BridgeUtil.java index f06e93850..a4672b23f 100644 --- a/testing/src/test/java/org/aspectj/testing/util/BridgeUtil.java +++ b/testing/src/test/java/org/aspectj/testing/util/BridgeUtil.java @@ -150,8 +150,8 @@ public class BridgeUtil { * * Use only for sorts, not to maintain maps. */ - public static final Comparator WEAK_File = new Comparator() { - public int compare(Object o1, Object o2) { + public static final Comparator WEAK_File = new Comparator() { + public int compare(File o1, File o2) { if ((o1 == o2) || (o1 == ISourceLocation.NO_FILE) || (o2 == ISourceLocation.NO_FILE) ) { @@ -182,8 +182,8 @@ public class BridgeUtil { * Ordering only uses line number. * Use only for sorts, not to maintain maps. */ - public static final Comparator WEAK_ISourceLocation = new Comparator() { - public int compare(Object o1, Object o2) { + public static final Comparator WEAK_ISourceLocation = new Comparator() { + public int compare(ISourceLocation o1, ISourceLocation o2) { if (o1 == o2) { return 0; } @@ -204,8 +204,8 @@ public class BridgeUtil { * uses WEAK_FILE on the sourceFile. * Use only for sorts, not to maintain maps. */ - public static final Comparator MEDIUM_ISourceLocation = new Comparator() { - public int compare(Object o1, Object o2) { + public static final Comparator MEDIUM_ISourceLocation = new Comparator() { + public int compare(ISourceLocation o1, ISourceLocation o2) { int result = WEAK_ISourceLocation.compare(o1, o2); if (0 != result) { return result; @@ -229,8 +229,8 @@ public class BridgeUtil { * and ignores message * so use only for sorts, not to maintain maps */ - public static final Comparator WEAK_IMessage = new Comparator() { - public int compare(Object o1, Object o2) { + public static final Comparator WEAK_IMessage = new Comparator() { + public int compare(IMessage o1, IMessage o2) { if (o1 == o2) { return 0; } @@ -258,8 +258,8 @@ public class BridgeUtil { * or if either is empty, i.e., none specified). * so use only for sorts, not to maintain maps */ - public static final Comparator MEDIUM_IMessage = new Comparator() { - public int compare(Object o1, Object o2) { + public static final Comparator MEDIUM_IMessage = new Comparator() { + public int compare(IMessage o1, IMessage o2) { int result = WEAK_IMessage.compare(o1, o2); if (0 != result) { return result; diff --git a/testing/src/test/java/org/aspectj/testing/util/Diffs.java b/testing/src/test/java/org/aspectj/testing/util/Diffs.java index a6edf0d87..eb09f9700 100644 --- a/testing/src/test/java/org/aspectj/testing/util/Diffs.java +++ b/testing/src/test/java/org/aspectj/testing/util/Diffs.java @@ -69,12 +69,12 @@ public class Diffs { /** * Compare IMessages based on kind and source location line (only). */ - public static final Comparator MESSAGE_LINEKIND = new Comparator() { + public static final Comparator MESSAGE_LINEKIND = new Comparator() { /** * Compare IMessages based on kind and source location line (only). * @throws NullPointerException if anything is null */ - public int compare(Object lhs, Object rhs) { + public int compare(IMessage lhs, IMessage rhs) { IMessage lm = (IMessage) lhs; IMessage rm = (IMessage) rhs; ISourceLocation ls = (lm == null ? null : lm.getSourceLocation()); @@ -444,7 +444,7 @@ public class Diffs { private static ArrayList getExcept( IMessage[] source, IMessage.Kind[] skip) { - ArrayList sink = new ArrayList(); + ArrayList sink = new ArrayList(); if (LangUtil.isEmpty(source)) { return sink; } diff --git a/testing/src/test/java/org/aspectj/testing/util/FileUtil.java b/testing/src/test/java/org/aspectj/testing/util/FileUtil.java index db77cbd10..86db6baa5 100644 --- a/testing/src/test/java/org/aspectj/testing/util/FileUtil.java +++ b/testing/src/test/java/org/aspectj/testing/util/FileUtil.java @@ -329,9 +329,9 @@ public class FileUtil { * @throws IllegalArgumentException if null == dir * @return a Collection of String of paths, including paths inside jars */ - public static Collection directoryToString(File dir, Collection results) { + public static Collection directoryToString(File dir, Collection results) { if (null == dir) throw new IllegalArgumentException("null dir"); - final Collection result = (results != null? results : new Vector()); + final Collection result = (results != null? results : new Vector()); if (isZipFile(dir)) { zipFileToString(dir, result); } else if (!dir.isDirectory()) { diff --git a/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java b/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java index 3f1ef92a1..0e81b24d3 100644 --- a/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java +++ b/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java @@ -157,10 +157,10 @@ public class LinkCheck { private final Messages messages; private final HTMLEditorKit.Parser parser; // XXX untested - stateful - private final ArrayList linksToCheck; // Link - private final ArrayList checkedUrls; // String (URL.toString) - private final ArrayList validRefs; // String (URL.toString) - private final ArrayList refsToCheck; // String (URL.toString) + private final ArrayList linksToCheck; + private final ArrayList checkedUrls; // String (URL.toString) + private final ArrayList validRefs; // String (URL.toString) + private final ArrayList refsToCheck; // String (URL.toString) private final Link.Check checkExists; private final Link.Check checkContents; @@ -172,10 +172,10 @@ public class LinkCheck { LangUtil.throwIaxIfNull(checkExists, "checkExists"); LangUtil.throwIaxIfNull(checkContents, "checkContents"); this.messages = new Messages(handler); - linksToCheck = new ArrayList(); - checkedUrls = new ArrayList(); - refsToCheck = new ArrayList(); - validRefs = new ArrayList(); + linksToCheck = new ArrayList(); + checkedUrls = new ArrayList(); + refsToCheck = new ArrayList(); + validRefs = new ArrayList(); parser = new HTMLEditorKit() { public HTMLEditorKit.Parser getParser() { return super.getParser(); @@ -207,13 +207,13 @@ public class LinkCheck { } public synchronized void run() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); while (0 < linksToCheck.size()) { messages.checkingLinks(linksToCheck.size()); list.clear(); list.addAll(linksToCheck); - for (Iterator iter = list.iterator(); iter.hasNext();) { - final Link link = (Link) iter.next(); + for (Iterator iter = list.iterator(); iter.hasNext();) { + final Link link = iter.next(); String urlString = link.url.toString(); if (!checkedUrls.contains(urlString)) { checkedUrls.add(urlString); @@ -224,8 +224,8 @@ public class LinkCheck { linksToCheck.removeAll(list); } // now check that all named references are accounted for - for (Iterator iter = refsToCheck.iterator(); iter.hasNext();) { - String ref = (String) iter.next(); + for (Iterator iter = refsToCheck.iterator(); iter.hasNext();) { + String ref = iter.next(); if (!validRefs.contains(ref)) { messages.namedReferenceNotFound(ref); } -- 2.39.5