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 2024/09/12 13:47:53 UTC

(commons-jxpath) 14/27: Use lambdas

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-jxpath.git

commit 3b583376f891805a0685020849359ce01c1f2736
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Sep 12 09:44:36 2024 -0400

    Use lambdas
---
 .../apache/commons/jxpath/ri/JXPathContextReferenceImpl.java | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java b/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java
index b5e4b2d..46f2ea6 100644
--- a/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java
+++ b/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java
@@ -20,7 +20,6 @@ import java.lang.ref.SoftReference;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -119,13 +118,10 @@ public class JXPathContextReferenceImpl extends JXPathContext {
             nodeFactoryArray =
                 (NodePointerFactory[]) nodeFactories.
                     toArray(new NodePointerFactory[nodeFactories.size()]);
-            Arrays.sort(nodeFactoryArray, new Comparator() {
-                @Override
-                public int compare(final Object a, final Object b) {
-                    final int orderA = ((NodePointerFactory) a).getOrder();
-                    final int orderB = ((NodePointerFactory) b).getOrder();
-                    return orderA - orderB;
-                }
+            Arrays.sort(nodeFactoryArray, (a, b) -> {
+                final int orderA = ((NodePointerFactory) a).getOrder();
+                final int orderB = ((NodePointerFactory) b).getOrder();
+                return orderA - orderB;
             });
         }
     }