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:48:05 UTC

(commons-jxpath) 26/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 151c7ae737e54c80f4621e06b37fb755ff27a714
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Sep 12 09:47:18 2024 -0400

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

diff --git a/src/test/java/org/apache/commons/jxpath/ri/model/XMLModelTestCase.java b/src/test/java/org/apache/commons/jxpath/ri/model/XMLModelTestCase.java
index 18798f2..2cfe0c5 100644
--- a/src/test/java/org/apache/commons/jxpath/ri/model/XMLModelTestCase.java
+++ b/src/test/java/org/apache/commons/jxpath/ri/model/XMLModelTestCase.java
@@ -17,7 +17,6 @@
 package org.apache.commons.jxpath.ri.model;
 
 import org.apache.commons.jxpath.AbstractFactory;
-import org.apache.commons.jxpath.IdentityManager;
 import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.JXPathException;
 import org.apache.commons.jxpath.JXPathTestCase;
@@ -266,13 +265,10 @@ public abstract class XMLModelTestCase extends JXPathTestCase {
     }
 
     public void testID() {
-        context.setIdentityManager(new IdentityManager() {
-            @Override
-            public Pointer getPointerByID(final JXPathContext context, final String id) {
-                NodePointer ptr = (NodePointer) context.getPointer("/");
-                ptr = ptr.getValuePointer(); // Unwrap the container
-                return ptr.getPointerByID(context, id);
-            }
+        context.setIdentityManager((context, id) -> {
+            NodePointer ptr = (NodePointer) context.getPointer("/");
+            ptr = ptr.getValuePointer(); // Unwrap the container
+            return ptr.getPointerByID(context, id);
         });
 
         assertXPathValueAndPointer(