Use Arrays.copyOf and Arrays.copyOfRange where possible
Closes gh-23393
This commit is contained in:
@@ -180,8 +180,7 @@ public abstract class AopProxyUtils {
|
||||
if (proxy instanceof DecoratingProxy) {
|
||||
nonUserIfcCount++;
|
||||
}
|
||||
Class<?>[] userInterfaces = new Class<?>[proxyInterfaces.length - nonUserIfcCount];
|
||||
System.arraycopy(proxyInterfaces, 0, userInterfaces, 0, userInterfaces.length);
|
||||
Class<?>[] userInterfaces = Arrays.copyOf(proxyInterfaces, proxyInterfaces.length - nonUserIfcCount);
|
||||
Assert.notEmpty(userInterfaces, "JDK proxy must implement one or more interfaces");
|
||||
return userInterfaces;
|
||||
}
|
||||
|
||||
@@ -395,9 +395,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
logger.debug("Bean with name '" + finalName + "' concluding interceptor chain " +
|
||||
"is not an advisor class: treating it as a target or TargetSource");
|
||||
}
|
||||
String[] newNames = new String[this.interceptorNames.length - 1];
|
||||
System.arraycopy(this.interceptorNames, 0, newNames, 0, newNames.length);
|
||||
this.interceptorNames = newNames;
|
||||
this.interceptorNames = Arrays.copyOf(this.interceptorNames, this.interceptorNames.length - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user