aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:13:00 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:13:00 +0200
commitefa2e5ce8c9cc2d20ab7479d1caa4a2ae1de6e8a (patch)
tree7be97c63260610ad409b9dbd889fbe9bfaf5b434 /weaver
parent7824e7d3045b9db278a96a21e69110976767b32e (diff)
downloadaspectj-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 'weaver')
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java2
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java2
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java2
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java
index b91496ea7..96222fba2 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java
@@ -1785,7 +1785,7 @@ public class AtAjAttributes {
}
// sort by index
- Collections.sort(arguments, new Comparator<MethodArgument>() {
+ arguments.sort(new Comparator<MethodArgument>() {
public int compare(MethodArgument mo, MethodArgument mo1) {
if (mo.indexOnStack == mo1.indexOnStack) {
return 0;
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java
index bbad8ed6a..06735b523 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java
@@ -2593,7 +2593,7 @@ class BcelClassWeaver implements IClassWeaver {
}
private void weaveInAddedMethods() {
- Collections.sort(addedLazyMethodGens, new Comparator<LazyMethodGen>() {
+ addedLazyMethodGens.sort(new Comparator<LazyMethodGen>() {
public int compare(LazyMethodGen aa, LazyMethodGen bb) {
int i = aa.getName().compareTo(bb.getName());
if (i != 0) {
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
index a6809f26f..b80080ec1 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -548,7 +548,7 @@ public class BcelWeaver {
// this code may need
// a bit of alteration...
- Collections.sort(shadowMungerList, new Comparator<ShadowMunger>() {
+ shadowMungerList.sort(new Comparator<ShadowMunger>() {
public int compare(ShadowMunger sm1, ShadowMunger sm2) {
if (sm1.getSourceLocation() == null) {
return (sm2.getSourceLocation() == null ? 0 : 1);
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java
index 46f0958e6..f2e61c565 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java
@@ -1260,7 +1260,7 @@ public final class LazyClassGen {
lists.add(list);
List<Map.Entry<BcelShadow, Field>> entries = new ArrayList<>(tjpFields.entrySet());
- Collections.sort(entries, new Comparator<Map.Entry<BcelShadow, Field>>() {
+ entries.sort(new Comparator<Map.Entry<BcelShadow, Field>>() {
@Override
public int compare(Map.Entry<BcelShadow, Field> a, Map.Entry<BcelShadow, Field> b) {
return (a.getValue()).getName().compareTo((b.getValue()).getName());