@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2019 the original author or authors .
* Copyright 2002 - 202 1 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -19,6 +19,7 @@ package org.springframework.expression.spel.support;
@@ -19,6 +19,7 @@ package org.springframework.expression.spel.support;
import java.lang.reflect.Constructor ;
import java.util.ArrayList ;
import java.util.Arrays ;
import java.util.Comparator ;
import java.util.List ;
import org.springframework.core.MethodParameter ;
@ -59,11 +60,7 @@ public class ReflectiveConstructorResolver implements ConstructorResolver {
@@ -59,11 +60,7 @@ public class ReflectiveConstructorResolver implements ConstructorResolver {
Class < ? > type = context . getTypeLocator ( ) . findType ( typeName ) ;
Constructor < ? > [ ] ctors = type . getConstructors ( ) ;
Arrays . sort ( ctors , ( c1 , c2 ) - > {
int c1pl = c1 . getParameterCount ( ) ;
int c2pl = c2 . getParameterCount ( ) ;
return Integer . compare ( c1pl , c2pl ) ;
} ) ;
Arrays . sort ( ctors , Comparator . comparingInt ( Constructor : : getParameterCount ) ) ;
Constructor < ? > closeMatch = null ;
Constructor < ? > matchRequiringConversion = null ;