Community
Participate
Working Groups
I'm sorry, but I couldn't make a good summary for this bug. Please feel free to change it! I had imported javax.crypto.KeyGenerator in my java file. Then, I was writing the following code: abc.KeyGenerator keygen = new abc.KeyGenerator(); Ctrl+Clicking on KeyGenerator in the above statement would take me to the source of javax.crypto.KeyGenerator. It should have went to abc.KeyGenerator. Actually, the above statement was syntactically wrong because my KeyGenerator did not have a default constructor. The syntax error seems to be causing this problem.
What I could reproduce is that a code resolve on 'abc.KeyGenerator()' returns 2 results. I didn't see the problem that the wrong type was opened directly. But also returning 2 results could be improved. The type is clearly known here. package p; public class Bar { abc.KeyGenerator keygen = new abc.KeyGenerator(); } Moving to jdt.core.
Created attachment 72670 [details] Proposed fix
Released for 3.4M1 Test added ResolveTests#testDuplicateTypeDeclaration8() When an unknown constructor of a valid type is selected then the type is returned.
Verified for 3.4M1 using build I20070802-0800.
The test case I used to reproduce the problem is: package abc; public class KeyGenerator { KeyGenerator(String str) {} } package p; public class Bar { abc.KeyGenerator keygen = new abc.KeyGenerator(); } Select the constructor call in Bar and hit F3...