Community
Participate
Working Groups
3.8 M3 Improve AST recovery for a TryStatement where the resource is missing a declared type. This is not a dup of bug 340837 (that one is about a complete absence of a TryStatement node). void foo() throws IOException { FileReader reader0 = new FileReader("file"); writer0 = new FileWriter("out"); try (FileReader reader = new FileReader("file"); writer = new FileWriter("out")) { int ch; while ((ch = reader.read()) != -1) { System.out.println(ch); } } } The 'writer = new FileWriter("out")' currently gets these errors on the second (incorrect) resource declaration: - writer cannot be resolved to a type - Syntax error on token "writer", VariableDeclaratorId expected after this => Would better be 'writer cannot be resolved to a variable', like for 'writer0'. The AST would better also consider 'writer' as variable name and the type as missing. Note: If I remove the type of 'FileReader reader' as well, then the recovery completely breaks down, and TryStatements has no resources any more.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.