This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch refine-groovydoc
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 20e7c41780a28d6d99c0ea7f4fa8b2c2cf48d656
Author: Daniel Sun <sun...@apache.org>
AuthorDate: Sun Dec 16 23:17:19 2018 +0800

    Trivial refactoring: remove unnecessary condition
---
 .../org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index be7425b..e33d38e 100644
--- 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -4173,7 +4173,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
         if (exp instanceof VariableExpression) {
             VariableExpression var = (VariableExpression) exp;
             final Variable accessedVariable = var.getAccessedVariable();
-            if (accessedVariable != null && accessedVariable != exp && 
accessedVariable instanceof VariableExpression) {
+            if (accessedVariable != exp && accessedVariable instanceof 
VariableExpression) {
                 storeType((Expression) accessedVariable, cn);
             }
             if (accessedVariable instanceof Parameter) {
@@ -4836,7 +4836,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
                 checkOrMarkPrivateAccess(vexp, fieldNode, 
isLHSOfEnclosingAssignment(vexp));
                 return getType(fieldNode);
             }
-            if (variable != null && variable != vexp && variable instanceof 
VariableExpression) {
+            if (variable != vexp && variable instanceof VariableExpression) {
                 return getType((Expression) variable);
             }
             if (variable instanceof Parameter) {

Reply via email to