From cc9634c2b248e8b98dbadb00a6f699293dd9178a Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Thu, 6 Sep 2012 00:00:28 +0400 Subject: [PATCH] EA-38862 Fixed - Update getSpacing for dealing with first nullable parameter in new IDEA --- idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java b/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java index 66da68db094..3365b6041ba 100644 --- a/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java +++ b/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java @@ -131,13 +131,16 @@ public class JetBlock extends AbstractBlock { } @Override - public Spacing getSpacing(Block child1, Block child2) { + public Spacing getSpacing(@Nullable Block child1, @NotNull Block child2) { Spacing spacing = mySpacingBuilder.getSpacing(this, child1, child2); if (spacing != null) { return spacing; } // TODO: extend SpacingBuilder API - afterInside(RBRACE, FUNCTION_LITERAL).spacing(...), beforeInside(RBRACE, FUNCTION_LITERAL).spacing(...) + if (!(child1 instanceof ASTBlock && child2 instanceof ASTBlock)) { + return null; + } IElementType parentType = this.getNode().getElementType(); IElementType child1Type = ((ASTBlock) child1).getNode().getElementType();