int alignIndent = -1; if (inits != null && !inits.isEmpty()) { if (cs.alignMultilineFor()) alignIndent = col; for (Iterator<? extends StatementTree> it = inits.iterator(); it.hasNext();) {
@Override public Boolean visitEnhancedForLoop(EnhancedForLoopTree node, Void p) { accept(FOR); boolean old = continuationIndent; try { continuationIndent = true; spaces(cs.spaceBeforeForParen() ? 1 : 0); accept(LPAREN); spaces(cs.spaceWithinForParens() ? 1 : 0); int alignIndent = cs.alignMultilineFor() ? col : -1; scan(node.getVariable(), p); wrapOperatorAndTree(cs.wrapFor(), alignIndent, cs.spaceBeforeColon() ? 1 : 0, cs.spaceAfterColon() ? 1 : 0, -1, node.getExpression()); spaces(cs.spaceWithinForParens() ? 1 : 0); accept(RPAREN); } finally { continuationIndent = old; } lastIndent = indent; CodeStyle.BracesGenerationStyle redundantForBraces = cs.redundantForBraces(); if (redundantForBraces == CodeStyle.BracesGenerationStyle.GENERATE && (startOffset > sp.getStartPosition(root, node) || endOffset < sp.getEndPosition(root, node))) redundantForBraces = CodeStyle.BracesGenerationStyle.LEAVE_ALONE; wrapStatement(cs.wrapForStatement(), redundantForBraces, cs.spaceBeforeForLeftBrace() ? 1 : 0, node.getStatement()); return true; }
currentIndent = getMultilineIndent(forTrees, path, token.offset(), currentIndent, cs.alignMultilineFor(), true); } else { currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN), forTrees.isEmpty() ? lastPos : getEndPosition(forTrees.getLast()), currentIndent);
toColExactly(cs.alignMultilineFor() ? col : out.leftMargin + cs.getContinuationIndentSize()); break; case WRAP_NEVER: toColExactly(cs.alignMultilineFor() ? col : out.leftMargin + cs.getContinuationIndentSize()); break; case WRAP_NEVER: