diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-15 16:13:00 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-15 16:13:00 +0200 |
commit | efa2e5ce8c9cc2d20ab7479d1caa4a2ae1de6e8a (patch) | |
tree | 7be97c63260610ad409b9dbd889fbe9bfaf5b434 /testing/src | |
parent | 7824e7d3045b9db278a96a21e69110976767b32e (diff) | |
download | aspectj-efa2e5ce8c9cc2d20ab7479d1caa4a2ae1de6e8a.tar.gz aspectj-efa2e5ce8c9cc2d20ab7479d1caa4a2ae1de6e8a.zip |
Collections.sort() can be replaced with List.sort()
Reports calls to Collections.sort(list, comparator) which could be replaced with list.sort(comparator).
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'testing/src')
3 files changed, 5 insertions, 5 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java index 81e2616ea..dbb5557cc 100644 --- a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -416,7 +416,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { List<LocalVariable> l = new ArrayList<>(); LocalVariable lv[] = lvt.getLocalVariableTable(); Collections.addAll(l, lv); - Collections.sort(l, new MyComparator()); + l.sort(new MyComparator()); return l; } 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 c9a58e99f..e95ab3184 100644 --- a/testing/src/test/java/org/aspectj/testing/util/Diffs.java +++ b/testing/src/test/java/org/aspectj/testing/util/Diffs.java @@ -452,7 +452,7 @@ public class Diffs { if (LangUtil.isEmpty(skip)) { sink.addAll(Arrays.asList(source)); - Collections.sort(sink, MESSAGE_LINEKIND); + sink.sort(MESSAGE_LINEKIND); return sink; } for (IMessage message : source) { @@ -467,7 +467,7 @@ public class Diffs { sink.add(message); } } - Collections.sort(sink, MESSAGE_LINEKIND); + sink.sort(MESSAGE_LINEKIND); return sink; } diff --git a/testing/src/test/java/org/aspectj/testing/util/LangUtil.java b/testing/src/test/java/org/aspectj/testing/util/LangUtil.java index ddf3a832a..23385db3a 100644 --- a/testing/src/test/java/org/aspectj/testing/util/LangUtil.java +++ b/testing/src/test/java/org/aspectj/testing/util/LangUtil.java @@ -941,11 +941,11 @@ public class LangUtil { ArrayList expected = new ArrayList(); expected.addAll(expectedListIn); - Collections.sort(expected, comparator); + expected.sort(comparator); ArrayList actual = new ArrayList(); actual.addAll(actualListIn); - Collections.sort(actual, comparator); + actual.sort(comparator); Iterator actualIter = actual.iterator(); Object act = null; |