Optimized parameter length comparisons for constructor/method sorting
Issue: SPR-12385
This commit is contained in:
@@ -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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user