We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b0a3a6f + 963cc09 commit bd3d7dbCopy full SHA for bd3d7db
spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java
@@ -52,14 +52,8 @@
52
abstract class AutowireUtils {
53
54
private static final Comparator<Executable> EXECUTABLE_COMPARATOR = (e1, e2) -> {
55
- boolean p1 = Modifier.isPublic(e1.getModifiers());
56
- boolean p2 = Modifier.isPublic(e2.getModifiers());
57
- if (p1 != p2) {
58
- return (p1 ? -1 : 1);
59
- }
60
- int c1pl = e1.getParameterCount();
61
- int c2pl = e2.getParameterCount();
62
- return Integer.compare(c2pl, c1pl);
+ int result = Boolean.compare(Modifier.isPublic(e2.getModifiers()), Modifier.isPublic(e1.getModifiers()));
+ return result != 0 ? result : Integer.compare(e2.getParameterCount(), e1.getParameterCount());
63
};
64
65
0 commit comments