Project: JDT
Bug 246627 [ast rewrite] Wrong indentation for statement inserted before SwitchCase
Reported: 2008-09-08 13:47:57 | Status: verified fixed

I20080617-2000 and HEAD ASTRewrite produces wrong indentation for a statement inserted before a SwitchCase: - have: switch (1) { case 1: System.out.println(); case 2: System.out.println(); } - format with Eclipse [built-in] formatter profile - enable warning for "'switch' case fall-through" - quick fix "Insert 'break' statement" => result: switch (1) { case 1: System.out.println(); break; case 2: System.out.println(); } => expected: same as when I format the result again: switch (1) { case 1: System.out.println(); break; case 2: System.out.println(); } The implementation in LocalCorrectionsSubProcessor.addFallThroughProposals(..) is trivial: listRewrite.insertBefore(ast.newBreakStatement(), switchCaseNode, null);

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java