From 6d6aa72e8f0a2c542a083391a5001e388facb215 Mon Sep 17 00:00:00 2001 From: stsypanov Date: Sat, 7 Jul 2018 21:05:07 +0300 Subject: [PATCH] improve performance of projection instantiation --- .../java/org/springframework/aop/framework/AdvisedSupport.java | 3 +-- .../org/springframework/util/ConcurrentReferenceHashMap.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java index 82fb163303..d2fa549c17 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java @@ -22,7 +22,6 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -94,7 +93,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised { * List of Advisors. If an Advice is added, it will be wrapped * in an Advisor before being added to this List. */ - private List advisors = new LinkedList<>(); + private List advisors = new ArrayList<>(); /** * Array updated on changes to the advisors list, which is easier diff --git a/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java b/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java index 8cc7602411..da2c17026f 100644 --- a/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java +++ b/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java @@ -653,7 +653,7 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen @SuppressWarnings("unchecked") private Reference[] createReferenceArray(int size) { - return (Reference[]) Array.newInstance(Reference.class, size); + return new Reference[size]; } private int getIndex(int hash, Reference[] references) {