Use lambda.

Fix formatting.
This commit is contained in:
Gary Gregory 2020-02-22 08:56:50 -05:00
parent 01175ec911
commit 0697258b6a
1 changed files with 2 additions and 7 deletions

View File

@ -61,12 +61,7 @@
*/
public class MethodUtils {
private static final Comparator<Method> METHOD_BY_SIGNATURE = new Comparator<Method>() {
@Override
public int compare(final Method m1, final Method m2) {
return m1.toString ().compareTo (m2.toString ());
}
};
private static final Comparator<Method> METHOD_BY_SIGNATURE = (m1, m2) -> m1.toString().compareTo(m2.toString());
/**
* <p>{@link MethodUtils} instances should NOT be constructed in standard programming.
@ -699,7 +694,7 @@ public static Method getMatchingAccessibleMethod(final Class<?> cls,
}
// Sort methods by signature to force deterministic result
Collections.sort (matchingMethods, METHOD_BY_SIGNATURE);
Collections.sort(matchingMethods, METHOD_BY_SIGNATURE);
Method bestMatch = null;
for (final Method method : matchingMethods) {