Summary: | VariableDeclarationExpression | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Timothy Halloran <hallorant> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | jeem |
Version: | 2.0 | ||
Target Milestone: | 2.0.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Timothy Halloran
2002-07-25 14:00:35 EDT
I will investigate. I think the for statement should be: { SingleVariableDeclaration | VariableDeclarationExpression } There is clearly something wrong with the initializers of the for statement. Sorry I was wrong. For inits of the for statement should be: { VariableDeclarationExpression | { Expression {, Expression }} This means that several local declarations (in the compiler's ast world) have to be converted to one VariableDeclarationExpression and not multiple VariableDeclaration Expression. Set target milestone. Fixed and released in 2.1 stream. Now the local declarations are converted to a single VariableDeclarationExpression, which contains multiple fragments. This is more consistent with the Java grammar. Thanks for the report. Fixed and released in 2.0.1 stream. The Javadoc comment for ForStatement.initializer says: "The list should consist of either a list of so called statement expressions (JLS2, 14.8), or a list of variable declaration expressions all with the same type. Otherwise, the for statement would have no Java source equivalent." It should be revised as well: "The list should consist of either a list of so called statement expressions (JLS2, 14.8), or a single <code>VariableDeclarationExpression</code>. Otherwise, the for statement would have no Java source equivalent." Changed Javadoc comment in 2.0.1 and 2.1 streams. Verified by adding regression test ASTConverterTest.test0357() Test is test0362 in 2.1 stream. Verified. Verified in 2.1 M1 |