Bug 219099 - Content assist does not not offer multiple choices for ambiguous static imports
Summary: Content assist does not not offer multiple choices for ambiguous static imports
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-15 09:48 EST by Stefan Fleiter CLA
Modified: 2008-04-29 05:10 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix (7.46 KB, patch)
2008-04-01 09:32 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Fleiter CLA 2008-02-15 09:48:20 EST
Build ID: M20071023-1652

Steps To Reproduce:
1. add EasyMock and EasyMock Class Extension to your projects' libraries (http://www.easymock.org)
2. under Window/Preferences/Java/Editor/Content Assist/Favorites add new types org.easymock.EasyMock and org.easymock.classextension.EasyMock
3. create a class, write a main method (f.e.) and type "replay" and press ctrl space to start content assist
4. Only one Method "replay(Object... mocks) void - EasyMock" is shown, both types configured above have a method matching this, but you can't choose between them since there is only one row

More information:
org.easymock.EasyMock is choosen, but there is no possibility to change this but changing the generated import statement by hand.

When writing Tests with EasyMock you sometimes need the classextension and sometimes not, so you should choose
when writing the actual test.

The bug in eclipse makes this unnecessarily hard.
Comment 1 David Audel CLA 2008-04-01 09:32:03 EDT
Simple test case:
1) create test/p/ZZZA.java
package test.p;
public class ZZZA {
    public static int foo(int i){return 0;};
}
2) create test/p/ZZZB.java
package test.p;
public class ZZZB {
    public static int foo(int i){return 0;};
}
3) add ot favorites "test.p.ZZZA.*" and "test.p.ZZZB.*".
4) create test/Test.java
package test;
public class Test {
    public void method() {
        foo| // do ctrl+space at |
    }
}
5) do ctrl+space at |

only one method is proposed.
Comment 2 David Audel CLA 2008-04-01 09:32:36 EDT
Created attachment 94359 [details]
Proposed fix
Comment 3 David Audel CLA 2008-04-01 09:38:41 EDT
Released for 3.4M7.

Tests added
  CompletionTests#testFavoriteImports032() -> testFavoriteImports033()
Comment 4 Eric Jodet CLA 2008-04-29 05:10:21 EDT
Verified for 3.4M7 using I20080427-2000.