IDEA-58664 Blank Lines Before method body also appear inside try/catch/finally's {}

Refined appliance conditions for 'blank lines before method body' setting
This commit is contained in:
Denis Zhdanov
2010-09-16 13:11:55 +04:00
parent 6f914ea733
commit d312fa9784
2 changed files with 38 additions and 1 deletions
@@ -350,4 +350,31 @@ public class JavaFormatterBlankLinesTest extends AbstractJavaFormatterTest {
"}"
);
}
public void testBeforeMethodBodyWithCodeBlockInside() {
// Inspired by IDEA-54747
getSettings().BLANK_LINES_BEFORE_METHOD_BODY = 3;
doTextTest(
"public class FormattingTest {\n" +
" public void foo() {\n" +
" System.out.println(\"\");\n" +
" try {\n" +
" } catch (Exception e) {\n" +
" }\n" +
" }\n" +
"}",
"public class FormattingTest {\n" +
" public void foo() {\n" +
"\n" +
"\n" +
"\n" +
" System.out.println(\"\");\n" +
" try {\n" +
" } catch (Exception e) {\n" +
" }\n" +
" }\n" +
"}"
);
}
}