Community
Participate
Working Groups
When working with "ordinary" local variables, quick fix / quick assist helps declaring those variables without explicitly needing to type the target type. For example: -------------------------------------------------------- import java.sql.Connection; public class Test { public static void main(String[] args) { Connection c = (Connection) new Object(); s = c.prepareStatement("statement"); } } -------------------------------------------------------- I can turn s into: - a local variable - a field - a parameter Choosing the local variable is most sensible here, producing -------------------------------------------------------- import java.sql.Connection; import java.sql.PreparedStatement; public class Test { public static void main(String[] args) { Connection c = (Connection) new Object(); PreparedStatement s = c.prepareStatement("statement"); } } -------------------------------------------------------- However, I cannot do the same thing when I start typing the try-with-resources statement: -------------------------------------------------------- import java.sql.Connection; public class Test { public static void main(String[] args) { Connection c = (Connection) new Object(); try (s = c.prepareStatement("statement")) { } } } -------------------------------------------------------- There's a whole list of suggested fixes that are all useless. From the user perspective, it's "obvious" that the only thing missing is the type "PreparedStatement".
Still a problem, tested with git-master from 2021-02-13. The error reported is "ParsingErrorInsertTokenAfter" which seems odd, "UnresolvedVariable" seems like a better error instead?