aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:06:32 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:06:32 +0200
commita85308ec103a69a86a8e02adf02112d472b00568 (patch)
treea1fe0ef9fe221292774ef280e4d8f0d55cf1555c /weaver
parent9cab74717265239e03d1aec53c5ec60a6d7d9718 (diff)
downloadaspectj-a85308ec103a69a86a8e02adf02112d472b00568.tar.gz
aspectj-a85308ec103a69a86a8e02adf02112d472b00568.zip
Manual array to collection copy
Reports the copying of array contents to a collection where each element is added individually using a for loop. Such constructs may be replaced by a call to Collection.addAll(Arrays.asList()) or Collections.addAll(). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java
index 3e9ac1b75..47984dfdf 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java
@@ -771,12 +771,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
GenericSignature.FormalTypeParameter[] extraFormals = getFormalTypeParametersFromOuterClass();
if (extraFormals.length > 0) {
List<FormalTypeParameter> allFormals = new ArrayList<>();
- for (FormalTypeParameter formalTypeParameter : formalsForResolution) {
- allFormals.add(formalTypeParameter);
- }
- for (FormalTypeParameter extraFormal : extraFormals) {
- allFormals.add(extraFormal);
- }
+ Collections.addAll(allFormals, formalsForResolution);
+ Collections.addAll(allFormals, extraFormals);
formalsForResolution = new GenericSignature.FormalTypeParameter[allFormals.size()];
allFormals.toArray(formalsForResolution);
}