Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch
Description
Following the discussion at http://groovy.329449.n5.nabble.com/Question-about-ClassNode-tp3382159p3382159.html, here's a patch fixing the direct calls to ClassNode(Class). All tests pass but :
in VariableExpressionTest#testIsDynamicTypedExplicitObject, we have the following code :
VariableExpression intExpression = new VariableExpression("foo", new ClassNode(Object.class)); assertFalse(intExpression.isDynamicTyped());
Replacing new ClassNode(Object.class) with ClassHelper.OBJECT_TYPE would cause the test to fail because ClassHelper.OBJECT_TYPE and ClassHelper.DYNAMIC_TYPE share the same reference.
2d, I had to alter the immutable annotation test because ClassHelper.make includes generic type information where new ClassNode() didn't. It does not change the logic though.