Repository: groovy
Updated Branches:
  refs/heads/native-lambda 62c835b4e -> 152b94d95


Refine `prependThis` via using `getPlainNodeReference`


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/152b94d9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/152b94d9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/152b94d9

Branch: refs/heads/native-lambda
Commit: 152b94d95d62d6953ef1c61c73c350824bdbc21a
Parents: 62c835b
Author: sunlan <[email protected]>
Authored: Wed Jan 17 16:33:55 2018 +0800
Committer: sunlan <[email protected]>
Committed: Wed Jan 17 16:33:55 2018 +0800

----------------------------------------------------------------------
 .../groovy/classgen/asm/sc/StaticTypesLambdaWriter.java        | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/152b94d9/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
 
b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
index 892927e..a88006c 100644
--- 
a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
+++ 
b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
@@ -264,11 +264,7 @@ public class StaticTypesLambdaWriter extends LambdaWriter {
     }
 
     private Parameter prependThis(List<Parameter> methodParameterList) {
-        ClassNode classNode = controller.getClassNode();
-
-        // FIXME the following code `classNode.setUsingGenerics(false)` is 
used to avoid the error:
-        // ERROR MESSAGE: A transform used a generics containing ClassNode 
Test1 for the method public static int doCall(Test1 __this, java.lang.Integer 
e)  { ... } directly. You are not supposed to do this. Please create a new 
ClassNode referring to the old ClassNode and use the new ClassNode instead of 
the old one. Otherwise the compiler will create wrong descriptors and a 
potential NullPointerException in TypeResolver in the OpenJDK. If this is not 
your own doing, please report this bug to the writer of the transform.
-        classNode.setUsingGenerics(false);
+        ClassNode classNode = 
controller.getClassNode().getPlainNodeReference();
 
         Parameter thisParameter = new Parameter(classNode, THIS);
         thisParameter.setOriginType(classNode);

Reply via email to