diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java index 5111599f0800945014c1685a24af1643ce01d2f4..1bf540345587c3a0e7005295c690b2bcec6c876a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -67,7 +67,7 @@ abstract class AutowireUtils { } int c1pl = c1.getParameterTypes().length; int c2pl = c2.getParameterTypes().length; - return (new Integer(c1pl)).compareTo(c2pl) * -1; + return (c1pl < c2pl ? 1 : (c1pl > c2pl ? -1 : 0)); } }); } @@ -90,7 +90,7 @@ abstract class AutowireUtils { } int c1pl = fm1.getParameterTypes().length; int c2pl = fm2.getParameterTypes().length; - return (new Integer(c1pl)).compareTo(c2pl) * -1; + return (c1pl < c2pl ? 1 : (c1pl > c2pl ? -1 : 0)); } }); } diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveConstructorResolver.java b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveConstructorResolver.java index e82d64bc3d5f7a49521f059dc18aa1e48719b71a..e9eacdf67f07ed21f9ed6f12d9cb58c93726ffde 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveConstructorResolver.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveConstructorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -50,12 +50,12 @@ public class ReflectiveConstructorResolver implements ConstructorResolver { * */ @Override - public ConstructorExecutor resolve(EvaluationContext context, String typename, List argumentTypes) + public ConstructorExecutor resolve(EvaluationContext context, String typeName, List argumentTypes) throws AccessException { try { TypeConverter typeConverter = context.getTypeConverter(); - Class type = context.getTypeLocator().findType(typename); + Class type = context.getTypeLocator().findType(typeName); Constructor[] ctors = type.getConstructors(); Arrays.sort(ctors, new Comparator>() { @@ -63,7 +63,7 @@ public class ReflectiveConstructorResolver implements ConstructorResolver { public int compare(Constructor c1, Constructor c2) { int c1pl = c1.getParameterTypes().length; int c2pl = c2.getParameterTypes().length; - return (new Integer(c1pl)).compareTo(c2pl); + return (c1pl < c2pl ? -1 : (c1pl > c2pl ? 1 : 0)); } }); diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java index 7987f405b59c32283a52e3332f78b2daf4d13720..a00748e04c0008cdeb9e1bfec94605947ef7b496 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -135,7 +135,7 @@ public class ReflectiveMethodResolver implements MethodResolver { return 0; } } - return (new Integer(m1pl)).compareTo(m2pl); + return (m1pl < m2pl ? -1 : (m1pl > m2pl ? 1 : 0)); } }); }