This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push: new 22dc9f3 GROOVY-8535: FieldNode constructor appears to call setType incorrectly 22dc9f3 is described below commit 22dc9f353971efe5d03adbc6c7376032d82836c1 Author: Paul King <pa...@asert.com.au> AuthorDate: Fri Feb 1 15:42:45 2019 +1000 GROOVY-8535: FieldNode constructor appears to call setType incorrectly --- src/main/java/org/codehaus/groovy/ast/FieldNode.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/codehaus/groovy/ast/FieldNode.java b/src/main/java/org/codehaus/groovy/ast/FieldNode.java index 6799a14..cae3dcf 100644 --- a/src/main/java/org/codehaus/groovy/ast/FieldNode.java +++ b/src/main/java/org/codehaus/groovy/ast/FieldNode.java @@ -25,8 +25,6 @@ import java.lang.reflect.Field; /** * Represents a field (member variable) - * - * @author <a href="mailto:ja...@coredevelopers.net">James Strachan</a> */ public class FieldNode extends AnnotatedNode implements Opcodes, Variable { @@ -37,7 +35,7 @@ public class FieldNode extends AnnotatedNode implements Opcodes, Variable { private Expression initialValueExpression; private boolean dynamicTyped; private boolean holder; - private ClassNode originType = ClassHelper.DYNAMIC_TYPE; + private ClassNode originType; public static FieldNode newStatic(Class theClass, String name) throws SecurityException, NoSuchFieldException { Field field = theClass.getField(name); @@ -48,11 +46,7 @@ public class FieldNode extends AnnotatedNode implements Opcodes, Variable { public FieldNode(String name, int modifiers, ClassNode type, ClassNode owner, Expression initialValueExpression) { this.name = name; this.modifiers = modifiers; - this.type = type; - if (this.type == ClassHelper.DYNAMIC_TYPE && initialValueExpression != null) - this.setType(initialValueExpression.getType()); this.setType(type); - this.originType = type; this.owner = owner; this.initialValueExpression = initialValueExpression; } @@ -179,6 +173,7 @@ public class FieldNode extends AnnotatedNode implements Opcodes, Variable { public boolean isClosureSharedVariable() { return false; } + /** * @deprecated */ @@ -189,7 +184,7 @@ public class FieldNode extends AnnotatedNode implements Opcodes, Variable { public ClassNode getOriginType() { return originType; } - + public void setOriginType(ClassNode cn) { originType = cn; }