You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2019/12/16 03:04:27 UTC

[groovy] 02/04: minor edits

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 01e484e2f3a97ecc42cef56e2575b94897ab9986
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Sat Dec 14 13:04:33 2019 -0600

    minor edits
    
    (cherry picked from commit 51b14ea4a07f2640f6e8d1d31810ce8c9d24d714)
---
 src/main/java/org/codehaus/groovy/ast/GenericsType.java | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/ast/GenericsType.java b/src/main/java/org/codehaus/groovy/ast/GenericsType.java
index ed0d938..d63e59f 100644
--- a/src/main/java/org/codehaus/groovy/ast/GenericsType.java
+++ b/src/main/java/org/codehaus/groovy/ast/GenericsType.java
@@ -285,20 +285,15 @@ public class GenericsType extends ASTNode {
     }
 
     /**
-     * Iterates over each generics bound of this generics specification, and checks
-     * that the generics defined by the bound are compatible with the generics specified
-     * by the type.
-     * @param classNode the classnode the bounds should be compared with
-     * @return true if generics from bounds are compatible
+     * Compares the bounds of this generics specification against the given type
+     * for compatibility.  Ex: String would satisfy &lt;? extends CharSequence>.
      */
     private boolean checkGenerics(final ClassNode classNode) {
         ClassNode lowerBound = getLowerBound();
-        ClassNode[] upperBounds = getUpperBounds();
         if (lowerBound != null) {
-            if (!lowerBound.redirect().isUsingGenerics()) {
-                return compareGenericsWithBound(classNode, lowerBound);
-            }
+            return compareGenericsWithBound(classNode, lowerBound);
         }
+        ClassNode[] upperBounds = getUpperBounds();
         if (upperBounds != null) {
             for (ClassNode upperBound : upperBounds) {
                 if (!compareGenericsWithBound(classNode, upperBound)) {