Skip to content

Commit f424310

Browse files
committed
fix failing test. AST was missing type information for parameters, causing issues with object wrapping in Groovy 2.x and above
1 parent 2a7930a commit f424310

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ Modifier.PUBLIC, returnType, copyParameters(parameterTypes),
255255
GrailsArtefactClassInjector.EMPTY_CLASS_ARRAY, methodBody);
256256
methodNode.addAnnotations(declaredMethod.getAnnotations());
257257

258+
258259
classNode.addMethod(methodNode);
259260
return methodNode;
260261
}
@@ -298,7 +299,7 @@ public static ArgumentListExpression createArgumentListFromParameters(Parameter[
298299
}
299300

300301
for (Parameter parameterType : parameterTypes) {
301-
arguments.addExpression(new VariableExpression(parameterType.getName()));
302+
arguments.addExpression(new VariableExpression(parameterType.getName(), nonGeneric(parameterType.getType())));
302303
}
303304
return arguments;
304305
}
@@ -515,9 +516,7 @@ public static ClassNode nonGeneric(ClassNode type) {
515516
}
516517

517518
if (type.isArray()) {
518-
final ClassNode nonGen = ClassHelper.makeWithoutCaching(Object.class);
519-
nonGen.setUsingGenerics(false);
520-
return nonGen.makeArray();
519+
return type.getComponentType().getPlainNodeReference().makeArray();
521520
}
522521

523522
return type.getPlainNodeReference();

0 commit comments

Comments
 (0)