Summary: | AST: IllegalArgumentException on creation | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Martin Aeschlimann <martinae> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.0 | ||
Target Milestone: | 2.1 M2 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Martin Aeschlimann
2002-10-21 11:04:02 EDT
This sounds like positions unset in case of a syntax error. I will investigate. It is a bug in the closing position for an initializer. The recovery is not closing the first initializer from this code: try { int id= 2; } catch (CoreException e) { } This is converted into three fields: 1) an initializer { int id = 2; } 2) a field (CoreException e) 3) An initializer {} The first initializer doesn't contain valid positions. I need to investigate why it is not closed on the first closing brace ('}' in front of the catch. Note that the resulting tree is completely wrong. It does not match the source at all for everything after the first method. This is a bug in the recovery. The int id = 2; resets the current element to the recovery type and then the recovery initializer is never closed properly. Removing this line int id = 2; fixes the problem. Need to investigate why the int id = 2; is considered as a field declaration without first closing the block inside the recovered initializer. I would expect int id = 2; to be treated as a local variable declaration inside the initializer and not a field declaration. Fixed and released in 2.1 stream. The bug was in the recovery. |