Project: JDT
Bug 237081 [typing] Correct indentation wrong after if (test) try ... catch ...
Reported: 2008-06-13 10:20:23 | Status: resolved fixed

Build ID: I20080523-0100 Steps To Reproduce: 1. Copy the code below in a new java editor 2. Select all, and ctrl+I (Correct Indentation) 3. The global assignment statement should be aligned with the "if", while it is aligned with the "try" More information: import java.io.File; public class TestCorrectIndentation { private boolean _GLOBAL; public void foo() { try { File file = new File("foo"); if (file.exists()) try { // do stuff } catch (RuntimeException ex) { System.err.println("Impossible faire une URL pour le fichier " + file); } // one level of increment should not be there _GLOBAL = _GLOBAL && test(); } finally { // nothing } } private boolean test() { // TODO Auto-generated method stub return false; } }

Files changed in fix:
org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/JavaHeuristicScannerTest.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaIndenter.java