Spacing (@Nullable Block child1, @NotNull Block child2, FormattingContext context) { if (child1 instanceof SyntheticGroovyBlock) return getSpacing(((SyntheticGroovyBlock)child1).getLastChild(), child2, context); if (child2 instanceof SyntheticGroovyBlock) return getSpacing(child1, ((SyntheticGroovyBlock)child2).getFirstChild(), context); if (child1 instanceof GroovyBlock && child2 instanceof GroovyBlock) { if (((GroovyBlock)child1).getNode() == ((GroovyBlock)child2).getNode()) { return Spacing.getReadOnlySpacing(); } Spacing spacing = new GroovySpacingProcessor(((GroovyBlock)child1), (GroovyBlock)child2, context).getSpacing(); if (spacing != null) { return spacing; } return GroovySpacingProcessorBasic.getSpacing(((GroovyBlock)child1), ((GroovyBlock)child2), context); } return null; }