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/06/01 23:21:14 UTC

[commons-bcel] 04/04: 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-bcel.git

commit 0a5b0ff601161ff8ef43f8b4bcf6cf1e0fe21df1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jun 1 19:19:36 2020 -0400

    Use lambdas.
---
 src/examples/Mini/ASTFunDecl.java | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/examples/Mini/ASTFunDecl.java b/src/examples/Mini/ASTFunDecl.java
index fe509da..682207d 100644
--- a/src/examples/Mini/ASTFunDecl.java
+++ b/src/examples/Mini/ASTFunDecl.java
@@ -289,12 +289,10 @@ public class ASTFunDecl extends SimpleNode implements MiniParserTreeConstants, o
         reset();
     }
 
-    private static final InstructionFinder.CodeConstraint my_constraint = new InstructionFinder.CodeConstraint() {
-        public boolean checkCode(final InstructionHandle[] match) {
-            final BranchInstruction if_icmp = (BranchInstruction) match[0].getInstruction();
-            final GOTO goto_ = (GOTO) match[2].getInstruction();
-            return (if_icmp.getTarget() == match[3]) && (goto_.getTarget() == match[4]);
-        }
+    private static final InstructionFinder.CodeConstraint my_constraint = match -> {
+        final BranchInstruction if_icmp = (BranchInstruction) match[0].getInstruction();
+        final GOTO goto_ = (GOTO) match[2].getInstruction();
+        return (if_icmp.getTarget() == match[3]) && (goto_.getTarget() == match[4]);
     };
 
     /**