Community
Participate
Working Groups
BETA_JAVA7 branch as of 14 March 2011. The eclipse compiler fails to reject the new multi catch syntax on a 1.6 (or below) compliant project. The following should be rejected, but it is not: public class X { public static void main(String [] args) { try { } catch (NullPointerException | IllegalArgumentException e) { } } }
Created attachment 191118 [details] Proposed fix Working on 339864, I fixed this issue to see if this would fix the other one. Regression tests need to be added.
Shouldn't the message be something like "Multi-catch parameters not allowed for source level below 1.7". Using "Multi-catch" instead of Disjunctive could be better for the users. Otherwise, the patch looks good to me. I will add the test for this.
(In reply to comment #2) > Shouldn't the message be something like "Multi-catch parameters not allowed for > source level below 1.7". Using "Multi-catch" instead of Disjunctive could be > better for the users. Sure. Please also update the method name inside ProblemReporter to reflect this change.
Created attachment 191213 [details] Patch Patch updated with the error message as "Multi-catch" instead of Disjunctive type. Doesn't have the test yet.
Released in BETA_JAVA7 branch. Will add the test as part of bug 340022.
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.