Tiny improvements regarding ArrayList creation
Closes gh-23047
This commit is contained in:
parent
f492e37370
commit
7ef8cc9faf
|
|
@ -92,8 +92,8 @@ public class InlineList extends SpelNodeImpl {
|
|||
return this.constant;
|
||||
}
|
||||
else {
|
||||
List<Object> returnValue = new ArrayList<>();
|
||||
int childCount = getChildCount();
|
||||
List<Object> returnValue = new ArrayList<>(childCount);
|
||||
for (int c = 0; c < childCount; c++) {
|
||||
returnValue.add(getChild(c).getValue(expressionState));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,8 +56,7 @@ public class AnnotationExceptionHandlerMethodResolver extends AbstractExceptionH
|
|||
Map<Class<? extends Throwable>, Method> result = new HashMap<>();
|
||||
for (Map.Entry<Method, MessageExceptionHandler> entry : methods.entrySet()) {
|
||||
Method method = entry.getKey();
|
||||
List<Class<? extends Throwable>> exceptionTypes = new ArrayList<>();
|
||||
exceptionTypes.addAll(Arrays.asList(entry.getValue().value()));
|
||||
List<Class<? extends Throwable>> exceptionTypes = new ArrayList<>(Arrays.asList(entry.getValue().value()));
|
||||
if (exceptionTypes.isEmpty()) {
|
||||
exceptionTypes.addAll(getExceptionsFromMethodSignature(method));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue