Community
Participate
Working Groups
Created attachment 244068 [details] formatter preferences export Copy paste this in a file project (the formatting is correct): package snippet; public class Snippet { void meth() { try {} finally { if (true) try {} catch (Exception e) { try {} catch (Exception e2) { // If you omit this comment all fine } } finally { System.out.println("This finally block is indented wrongly"); } } } } Hit Ctrl+Shift+F and get: package snippet; public class Snippet { void meth() { try {} finally { if (true) try {} catch (Exception e) { try {} catch (Exception e2) { // If you omit this comment all fine } } finally { System.out.println("This finally block is indented wrongly"); } // notice this } } } That can be _very_ confusing in situations with nested try/finally (of course this a contrived example) If you omit the comment all is fine. I have previously filled some bugs with the comments handling - _there is definitely something fishy there_ - please have a look: https://bugs.eclipse.org/bugs/show_bug.cgi?id=422870 https://bugs.eclipse.org/bugs/show_bug.cgi?id=421748 https://bugs.eclipse.org/bugs/show_bug.cgi?id=419909 https://bugs.eclipse.org/bugs/show_bug.cgi?id=396686 I attach my formatting prefs
This problem no longer occurs after the formatter redesign. *** This bug has been marked as a duplicate of bug 303519 ***