Community
Participate
Working Groups
The following program shows two nearly identical error messages, but see that the source range highlighted is inconsistent. // --------------- 8<---------------------- import java.io.*; public class X { public static void main(String[] args) { try { System.out.println(); Reader r = new FileReader(args[0]); r.read(); } catch(RuntimeException | Exception e) { e.printStackTrace(); } catch(FileNotFoundException | IOException e) { e.printStackTrace(); } } } class Y { public static void main(String[] args) { try { throw new DaughterOfFoo(); } catch(SonOfFoo | DaughterOfFoo e) { e.printStackTrace(); } } } class Foo extends Exception {} class SonOfFoo extends Foo {} class DaughterOfFoo extends Foo {} // -----------------------------8<---------------------- Junits already exist :) org.eclipse.jdt.core.tests.compiler.regression.TryStatement17Test.test010() shows the preferred behavior while org.eclipse.jdt.core.tests.compiler.regression.TryStatement17Test.test003() shows the less desirable behavior.
Created attachment 191721 [details] Proposed patch Made changes as to pinpoint the error like the preferred behavior.
Released in BETA_JAVA7 branch
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.