aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2019-02-11 12:19:47 -0800
committerAndy Clement <aclement@pivotal.io>2019-02-11 12:19:47 -0800
commitb1772c28d0f025525b9baef62ddf948e39f60c11 (patch)
treefddeb8a770823b5a7a13bea39c8f8055f4d3a174
parent2d7ddbfe87a2469e66132749641d9ffa309182cd (diff)
downloadaspectj-b1772c28d0f025525b9baef62ddf948e39f60c11.tar.gz
aspectj-b1772c28d0f025525b9baef62ddf948e39f60c11.zip
polish
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/AccumulatingFileFilter.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/BridgeUtil.java20
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/Diffs.java6
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/FileUtil.java4
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/LinkCheck.java26
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<File> files = new Vector<File>();
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<File> WEAK_File = new Comparator<File>() {
+ 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<ISourceLocation> WEAK_ISourceLocation = new Comparator<ISourceLocation>() {
+ 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<ISourceLocation> MEDIUM_ISourceLocation = new Comparator<ISourceLocation>() {
+ 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<IMessage> WEAK_IMessage = new Comparator<IMessage>() {
+ 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<IMessage> MEDIUM_IMessage = new Comparator<IMessage>() {
+ 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<IMessage> MESSAGE_LINEKIND = new Comparator<IMessage>() {
/**
* 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<IMessage> sink = new ArrayList<IMessage>();
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<String> directoryToString(File dir, Collection results) {
if (null == dir) throw new IllegalArgumentException("null dir");
- final Collection result = (results != null? results : new Vector());
+ final Collection<String> 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<Link> linksToCheck;
+ private final ArrayList<String> checkedUrls; // String (URL.toString)
+ private final ArrayList<String> validRefs; // String (URL.toString)
+ private final ArrayList<String> 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<Link>();
+ checkedUrls = new ArrayList<String>();
+ refsToCheck = new ArrayList<String>();
+ validRefs = new ArrayList<String>();
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<Link> list = new ArrayList<Link>();
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<Link> 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<String> iter = refsToCheck.iterator(); iter.hasNext();) {
+ String ref = iter.next();
if (!validRefs.contains(ref)) {
messages.namedReferenceNotFound(ref);
}