Community
Participate
Working Groups
Using 3.1, create a new java project. Add a new scrapbook page that contains this source: int[] tab = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9 }; int sum = 0; for (int i : tab) { sum += i; } sum You get an error about syntax error.
Candidate for 3.1.1. The code snippet parser is missing the consumeEnhancedForStatement() method. If you remove the last line, you can execute the code. The fix is trivial.
Adding this method in the code snippet parser fixes the problem. protected void consumeEnhancedForStatement() { super.consumeEnhancedForStatement(); /* recovery */ recordLastStatementIfNeeded(); }
Created attachment 24361 [details] Proposed fix
Created attachment 24363 [details] Regression test
Agreed
Fixed and released in 3.1 maintenance stream. Regression test added in org.eclipse.jdt.core.tests.eval.DebugEvaluationTest.test063
Verified with 3.2 M1
Verified using M20050923-1430 for 3.1.1