Community
Participate
Working Groups
I have this interface that's the newest offspring in a grand family of interfaces. It extends two older family members and adds just one single method. That method throws IOException, plus two other exceptions you've never heard about. The interface has a compilation error "IOException cannot be resolved". When I use "add import", "import java.io.IOException;" is added with no questions asked. Fine. Previously, when I had tried "organize imports" instead, nothing happened and the compilation error remained. I have tagged this situation in CVS, so I can reproduce it.
Andreas, can you please provide better steps to reproduce the problem. Organize import uses the AST and therefore requires some structural correctness of the CU. Without a test case it is hard to tell what caused the error.
Created attachment 1766 [details] Resonably short example that reproduces the problem.
Thanks for the test case. Martin, both add import and quick fix work, but not organize import. Please investigate.
20020911 The AST does not correctly resolve 'IOExpresion': 1. import the given source 2. set breakpoint in OrganizeImportsOperation.TypeReferenceProcessor.process 3. do organize imports 4. The first entry comming in is SimpleName. 'process' does a 'resolveBinding' on it. Strangly, the resolved binding goes to type X1 Moving to JCore
The compiler binding of the name IOException is X1. I don't understand why.
The method that binds TypeReference and its bindings is boggus. I am working on a fix.
Fixed and released in 2.1 stream.
Verified.