public void visitForLoop(ForStatement forLoop) { resolveOrFail(forLoop.getVariableType(), forLoop); super.visitForLoop(forLoop); }
@Override public void visitForLoop(final ForStatement forLoop) { super.visitForLoop(forLoop); Expression collectionExpression = forLoop.getCollectionExpression(); if (!(collectionExpression instanceof ClosureListExpression)) { final ClassNode collectionType = getType(forLoop.getCollectionExpression()); ClassNode forLoopVariableType = forLoop.getVariableType(); ClassNode componentType; if (Character_TYPE.equals(ClassHelper.getWrapper(forLoopVariableType)) && STRING_TYPE.equals(collectionType)) { // we allow auto-coercion here componentType = forLoopVariableType; } else { componentType = inferLoopElementType(collectionType); } forLoop.getVariable().setType(componentType); forLoop.getVariable().setOriginType(componentType); } }
collectionExpression.visit(this); final ClassNode collectionType = getType(collectionExpression); ClassNode forLoopVariableType = forLoop.getVariableType(); ClassNode componentType; if (Character_TYPE.equals(ClassHelper.getWrapper(forLoopVariableType)) && STRING_TYPE.equals(collectionType)) {
private static OffsetRange getForLoopRange(ForStatement forLoop, BaseDocument doc, int cursorOffset) { return getRange(forLoop.getVariableType(), doc, cursorOffset); }
public void visitForLoop(ForStatement forLoop) { resolveOrFail(forLoop.getVariableType(), forLoop); super.visitForLoop(forLoop); }
public void visitForLoop(ForStatement forLoop) { resolveOrFail(forLoop.getVariableType(), forLoop); super.visitForLoop(forLoop); }
public void visitForLoop(ForStatement forLoop) { resolveOrFail(forLoop.getVariableType(), forLoop); super.visitForLoop(forLoop); }
public void visitForLoop(ForStatement forLoop) { resolveOrFail(forLoop.getVariableType(), forLoop); super.visitForLoop(forLoop); }
public void visitForLoop(ForStatement forLoop) { resolveOrFail(forLoop.getVariableType(), forLoop); super.visitForLoop(forLoop); }
@Override public void visitForLoop(ForStatement forLoop) { if (FindTypeUtils.isCaretOnClassNode(path, doc, cursorOffset)) { addOccurrences(forLoop.getVariableType(), (ClassNode) FindTypeUtils.findCurrentNode(path, doc, cursorOffset)); } else { final Parameter forLoopVar = forLoop.getVariable(); final String varName = forLoopVar.getName(); if (leaf instanceof Variable) { if (varName.equals(((Variable) leaf).getName())) { occurrences.add(forLoopVar); } } else if (leaf instanceof ForStatement) { if (varName.equals(((ForStatement) leaf).getVariable().getName())) { occurrences.add(forLoopVar); } } } super.visitForLoop(forLoop); }
@Override public void run() { loc(forLoop); literal(forLoop.getStatementLabel()); literal(forLoop.getVariableType()); literal(forLoop.getVariable().getName()); visit(forLoop.getCollectionExpression()); visitWithSafepoint(forLoop.getLoopBlock()); } });
return ((Parameter) node).getDeclaringClass(); } else if (node instanceof ForStatement) { return ((ForStatement) node).getVariableType().getDeclaringClass(); } else if (node instanceof CatchStatement) { return ((CatchStatement) node).getVariable().getDeclaringClass();
name = ((Parameter) node).getName(); } else if (node instanceof ForStatement) { name = ((ForStatement) node).getVariableType().getNameWithoutPackage(); } else if (node instanceof CatchStatement) { name = ((CatchStatement) node).getVariable().getName();
return ((Parameter) node).getType(); } else if (node instanceof ForStatement) { return ((ForStatement) node).getVariableType(); } else if (node instanceof CatchStatement) { return ((CatchStatement) node).getVariable().getOriginType();
return ((ForStatement) leaf).getVariableType(); } else { return ((ForStatement) leaf).getVariable();