Skip to content

Commit fd78e78

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 e947ef1 commit fd78e78

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
@@ -276,6 +276,7 @@ Modifier.PUBLIC, returnType, copyParameters(parameterTypes),
276276
GrailsArtefactClassInjector.EMPTY_CLASS_ARRAY, methodBody);
277277
methodNode.addAnnotations(declaredMethod.getAnnotations());
278278

279+
279280
classNode.addMethod(methodNode);
280281
return methodNode;
281282
}
@@ -319,7 +320,7 @@ public static ArgumentListExpression createArgumentListFromParameters(Parameter[
319320
}
320321

321322
for (Parameter parameterType : parameterTypes) {
322-
arguments.addExpression(new VariableExpression(parameterType.getName()));
323+
arguments.addExpression(new VariableExpression(parameterType.getName(), nonGeneric(parameterType.getType())));
323324
}
324325
return arguments;
325326
}
@@ -536,9 +537,7 @@ public static ClassNode nonGeneric(ClassNode type) {
536537
}
537538

538539
if (type.isArray()) {
539-
final ClassNode nonGen = ClassHelper.makeWithoutCaching(Object.class);
540-
nonGen.setUsingGenerics(false);
541-
return nonGen.makeArray();
540+
return type.getComponentType().getPlainNodeReference().makeArray();
542541
}
543542

544543
return type.getPlainNodeReference();

0 commit comments

Comments
 (0)