Permalink
Browse files

fix failing test. AST was missing type information for parameters, ca…

…using issues with object wrapping in Groovy 2.x and above
  • Loading branch information...
1 parent e947ef1 commit fd78e785eb865ef134c8e0e2f00fd7ecc459241d @graemerocher graemerocher committed Feb 18, 2013
@@ -276,6 +276,7 @@ public static MethodNode addDelegateInstanceMethod(ClassNode classNode, Expressi
GrailsArtefactClassInjector.EMPTY_CLASS_ARRAY, methodBody);
methodNode.addAnnotations(declaredMethod.getAnnotations());
+
classNode.addMethod(methodNode);
return methodNode;
}
@@ -319,7 +320,7 @@ public static ArgumentListExpression createArgumentListFromParameters(Parameter[
}
for (Parameter parameterType : parameterTypes) {
- arguments.addExpression(new VariableExpression(parameterType.getName()));
+ arguments.addExpression(new VariableExpression(parameterType.getName(), nonGeneric(parameterType.getType())));
}
return arguments;
}
@@ -536,9 +537,7 @@ public static ClassNode nonGeneric(ClassNode type) {
}
if (type.isArray()) {
- final ClassNode nonGen = ClassHelper.makeWithoutCaching(Object.class);
- nonGen.setUsingGenerics(false);
- return nonGen.makeArray();
+ return type.getComponentType().getPlainNodeReference().makeArray();
}
return type.getPlainNodeReference();

0 comments on commit fd78e78

Please sign in to comment.