Skip to content

Commit

Permalink
Don't create new ArrayList subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Mar 7, 2019
1 parent a91a034 commit 99c40ff
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.jboss.jandex.AnnotationInstance.create;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -211,11 +212,7 @@ public void transform(TransformationContext context) {
annotationsToAdd.add(create(
CDI_NAMED_ANNOTATION,
annotation.target(),
new ArrayList<AnnotationValue>() {
{
add(AnnotationValue.createStringValue("value", value));
}
}));
Collections.singletonList(AnnotationValue.createStringValue("value", value))));
}
}
}
Expand Down Expand Up @@ -243,11 +240,7 @@ private boolean addCDINamedAnnotation(TransformationContext context,
annotationsToAdd.add(create(
CDI_NAMED_ANNOTATION,
context.getTarget(),
new ArrayList<AnnotationValue>() {
{
add(AnnotationValue.createStringValue("value", beanName));
}
}));
Collections.singletonList(AnnotationValue.createStringValue("value", beanName))));

return true;
}
Expand Down

0 comments on commit 99c40ff

Please sign in to comment.