ASTNode (@NotNull final List<? super Block> result, ASTNode child, final Indent indent, final int childrenIndent, @Nullable final Wrap childWrap) { final ArrayList<Block> localResult = new ArrayList<>(); processChild(localResult, child, AlignmentStrategy.getNullStrategy(), null, Indent.getNoneIndent()); child = child.getTreeNext(); ChildAlignmentStrategyProvider alignmentStrategyProvider = getStrategyProvider(); while (child != null) { if (FormatterUtil.containsWhiteSpacesOnly(child)) { child = child.getTreeNext(); continue; } Indent childIndent = getIndentForCodeBlock(child, childrenIndent); AlignmentStrategy alignmentStrategyToUse = alignmentStrategyProvider.getNextChildStrategy(child); final boolean isRBrace = isRBrace(child); child = processChild(localResult, child, alignmentStrategyToUse, childWrap, childIndent); if (isRBrace) { result.add(createCodeBlockBlock(localResult, indent, childrenIndent)); return child; } if (child != null) { child = child.getTreeNext(); } } result.add(createCodeBlockBlock(localResult, indent, childrenIndent)); return null; }