Source:
public Object visit(ASTName node, Object data) { Class<?> accessingClass = getEnclosingTypeDeclarationClass(node); String[] dotSplitImage = node.getImage().split("\\."); int startIndex = searchNodeNameForClass(node); ASTArguments astArguments = getSuffixMethodArgs(node); ASTArgumentList astArgumentList = getArgumentList(astArguments); int methodArgsArity = getArgumentListArity(astArgumentList); JavaTypeDefinition previousType; if (node.getType() != null) { previousType = JavaTypeDefinition.forClass(node.getType()); } else { if (dotSplitImage.length == 1 && astArguments != null) { List<MethodType> methods = getLocalApplicableMethods(node, dotSplitImage[0], null, methodArgsArity, accessingClass); previousType = getBestMethodReturnType(methods, astArgumentList, null); } else { previousType = getTypeDefinitionOfVariableFromScope(node.getScope(), dotSplitImage[0], accessingClass); } startIndex = 1; } if (node.getNameDeclaration() != null && previousType == null && node.getNameDeclaration().getNode() instanceof TypeNode) { Class<?> nodeType = ((TypeNode) node.getNameDeclaration().getNode()).getType(); if (nodeType != null) { node.setType(nodeType); return super.visit(node, data); } } for (int i = startIndex; i < dotSplitImage.length; ++i) { if (previousType == null) { break; } if (i == dotSplitImage.length - 1 && astArguments != null) { List<MethodType> methods = getApplicableMethods(previousType, dotSplitImage[i], new ArrayList<JavaTypeDefinition>(), methodArgsArity, accessingClass); previousType = getBestMethodReturnType(methods, astArgumentList, null); } else { previousType = getFieldType(previousType, dotSplitImage[i], accessingClass); } } if (previousType != null) { node.setTypeDefinition(previousType); } return super.visit(node, data); }

Target:
public Object visit(ASTName node, Object data) { Class<?> accessingClass = getEnclosingTypeDeclarationClass(node); String[] dotSplitImage = node.getImage().split("\\."); int startIndex = searchNodeNameForClass(node); ASTArguments astArguments = getSuffixMethodArgs(node); ASTArgumentList astArgumentList = getArgumentList(astArguments); int methodArgsArity = getArgumentListArity(astArgumentList); JavaTypeDefinition previousType; if (node.getType() != null) { previousType = JavaTypeDefinition.forClass(node.getType()); } else { if (dotSplitImage.length == 1 && astArguments != null) { List<MethodType> methods = getLocalApplicableMethods(node, dotSplitImage[0], null, methodArgsArity, accessingClass); previousType = getBestMethodReturnType(methods, astArgumentList, null); } else { previousType = getTypeDefinitionOfVariableFromScope(node.getScope(), dotSplitImage[0], accessingClass); } startIndex = 1; } if (node.getNameDeclaration() != null && previousType == null && node.getNameDeclaration().getNode() instanceof TypeNode) { Class<?> nodeType = ((TypeNode) node.getNameDeclaration().getNode()).getType(); if (nodeType != null) { node.setType(nodeType); return super.visit(node, data); } } for (int i = startIndex; i < dotSplitImage.length; ++i) { if (previousType == null) { break; } if (i == dotSplitImage.length - 1 && astArguments != null) { List<MethodType> methods = getApplicableMethods(previousType, dotSplitImage[i], Collections.<JavaTypeDefinition>emptyList(), methodArgsArity, accessingClass); previousType = getBestMethodReturnType(methods, astArgumentList, null); } else { previousType = getFieldType(previousType, dotSplitImage[i], accessingClass); } } if (previousType != null) { node.setTypeDefinition(previousType); } return super.visit(node, data); }