You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/02/22 13:56:54 UTC

[commons-lang] branch master updated: Use lambda.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 0697258  Use lambda.
0697258 is described below

commit 0697258b6aabceaed851e12c2ab7f7ff9297517f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Feb 22 08:56:50 2020 -0500

    Use lambda.
    
    Fix formatting.
---
 src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
index be48fb9..98e1b4d 100644
--- a/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
+++ b/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
@@ -61,12 +61,7 @@ import org.apache.commons.lang3.Validate;
  */
 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 class MethodUtils {
         }
 
         // 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) {