Community
Participate
Working Groups
The following code snippet gives some extra error diagnostics when compiled in BETA_JAVA7 branch, as compared to when compiled with HEAD public class GlobalVariables_1 { public static Object o; public static int i; static { try { o= new Object(); } catch (Throwable e) { e.printStackTrace(); } try { i= (1 + 1) * (1 ++ 2); } catch (Throwable e) { e.printStackTrace(); } } } Extra errors are: Pb(240) Syntax error, insert "}" to complete Block Pb(240) Syntax error, insert "Finally" to complete TryStatement Pb(235) Syntax error on token "1", invalid ( Pb(240) Syntax error, insert ";" to complete BlockStatements This is illustrated by the failing test org.eclipse.jdt.core.tests.eval.NegativeVariableTest.testInitializerProblem() in BETA_JAVA7 branch.
Created attachment 189259 [details] Patch One new 1.7 grammar rule (CatchType ::= DisjunctiveType) get used also on 1.5, but their compliance in the grammar file has 1.7, causing the recovery to assume that it is illegal and thus the tests were failing. Removed the compliance for this rule and other rule where the compliance was added 1.5, though it would get used in 1.3 too.
Released the grammar changes and the resource file that got updated on the java7 branch.
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.