groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] 03/05: Java 8 refactor
Date Sat, 26 Oct 2019 08:09:15 GMT
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit f9a10272fd375bce59c16c8cab2ce9bab0814ee7
Author: Eric Milles <eric.milles@thomsonreuters.com>
AuthorDate: Fri Oct 25 10:59:11 2019 -0500

    Java 8 refactor
    
    (cherry picked from commit 909fd39fc1a2cb98ab93913ee5637dffa00bcafa)
---
 .../org/codehaus/groovy/control/ResolveVisitor.java     | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
index 50c93bd..e77d74b 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -533,18 +533,15 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
     private boolean setRedirect(ClassNode type, ClassNode classToCheck) {
         String typeName = type.getName();
 
-        Predicate<ClassNode> resolver = new Predicate<ClassNode>() {
-            @Override
-            public boolean test(ClassNode maybeOuter) {
-                if (!typeName.equals(maybeOuter.getName())) {
-                    ClassNode maybeNested = new ConstructedNestedClass(maybeOuter, typeName);
-                    if (resolveFromCompileUnit(maybeNested) || resolveToOuter(maybeNested))
{
-                        type.setRedirect(maybeNested);
-                        return true;
-                    }
+        Predicate<ClassNode> resolver = (ClassNode maybeOuter) -> {
+            if (!typeName.equals(maybeOuter.getName())) {
+                ClassNode maybeNested = new ConstructedNestedClass(maybeOuter, typeName);
+                if (resolveFromCompileUnit(maybeNested) || resolveToOuter(maybeNested)) {
+                    type.setRedirect(maybeNested);
+                    return true;
                 }
-                return false;
             }
+            return false;
         };
 
         if (resolver.test(classToCheck)) {


Mime
View raw message