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 2a7930a commit f424310516252e309bc261df37f96dd3d4e70e4f @graemerocher graemerocher committed Feb 18, 2013
View
7 ...ls-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java
@@ -255,6 +255,7 @@ public static MethodNode addDelegateInstanceMethod(ClassNode classNode, Expressi
GrailsArtefactClassInjector.EMPTY_CLASS_ARRAY, methodBody);
methodNode.addAnnotations(declaredMethod.getAnnotations());
+
classNode.addMethod(methodNode);
return methodNode;
}
@@ -298,7 +299,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;
}
@@ -515,9 +516,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 f424310

Please sign in to comment.