You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2021/09/08 18:46:11 UTC

[groovy] branch master updated (9a988c4 -> ac67f86)

This is an automated email from the ASF dual-hosted git repository.

emilles pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from 9a988c4  GROOVY-10166: "Type<X> -> Type<T>" has arg for T; "T -> Type" does not
     new e23480c  GROOVY-10049, GROOVY-10166: add test case
     new ac67f86  fix for NPE

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../groovy/classgen/asm/util/TypeUtil.java         |  2 +-
 .../groovy/transform/stc/GenericsSTCTest.groovy    | 23 +++++++++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

[groovy] 01/02: GROOVY-10049, GROOVY-10166: add test case

Posted by em...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e23480c2927083c042abe75921316a6203b6fe0c
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Wed Sep 8 13:45:53 2021 -0500

    GROOVY-10049, GROOVY-10166: add test case
---
 .../groovy/transform/stc/GenericsSTCTest.groovy    | 23 +++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/test/groovy/transform/stc/GenericsSTCTest.groovy b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
index 8b77ec2..f274efd 100644
--- a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
@@ -2542,9 +2542,30 @@ class GenericsSTCTest extends StaticTypeCheckingTestCase {
         '''
     }
 
-    // GROOVY-10196
+    // GROOVY-10049, GROOVY-10166
     void testShouldFindMethodEvenWithRepeatNames2() {
         assertScript '''
+            abstract class A<T extends C> {
+                T getC() {
+                }
+            }
+
+            class C<T extends A> {
+                T get() {
+                    A a = null
+                    a.c.get(1)
+                }
+                T get(int i) {
+                }
+            }
+
+            new C()
+        '''
+    }
+
+    // GROOVY-10196
+    void testShouldFindMethodEvenWithRepeatNames3() {
+        assertScript '''
             interface M<K,V> {
             }
             interface MM<K,V> extends M<K,List<V>> {

[groovy] 02/02: fix for NPE

Posted by em...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ac67f86a810bc434c171552601ae862af23269a8
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Wed Sep 8 13:46:00 2021 -0500

    fix for NPE
---
 src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java b/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
index 25c9296..3facc44 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
@@ -96,7 +96,7 @@ public abstract class TypeUtil {
     }
 
     public static boolean isPrimitiveType(ClassNode type) {
-        return PRIMITIVE_TYPE_TO_DESCRIPTION_MAP.containsKey(type.redirect());
+        return type != null && PRIMITIVE_TYPE_TO_DESCRIPTION_MAP.containsKey(type.redirect());
     }
 
     public static String getDescriptionByType(ClassNode type) {