Community
Participate
Working Groups
Build id: I20050923-1000 When debugging into code that parses Java source into a model, the following statement: for (Object o : i) { o.toString(); } appears as follows when selecting the matching ForeachStatement instance into the variables view of the debugger: for (Object o; : i) { o.toString(); } (note the extraneous ; after o). This must be related to printStatement, which calls Statement.print, hence gets the terminator whereas it should not.
yes, this is related to the fact that Object o is considered as a local declaration and therefore it is printed as a statement. We would need to change the printStatement(...) implementation of the ForeachStatement not to use the print method for the local declaration. But this is for debugging purpose anyway, so is it really worth it?
I'll fix it. We simply cannot use the print method for the local variable declaration in the foreach.
Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.compiler.parser.DietRecoveryTest.test113.
Verified for 3.2 M3 using build I20051031-0010