Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 395500

Summary: [organize imports] organize imports should not suggest non-generic classes when type parameter is present
Product: [Eclipse Project] JDT Reporter: Arne Bittig <arne.bit>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, noopur_gupta
Version: 3.8.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Arne Bittig CLA 2012-11-30 13:19:50 EST
When pressing ctrl-shift-o to organize imports on something like this...

    public class Test {
       private List<Object> myList;
    }

a window pops up asking me to select one of several possible imports named "List" (among them java.awt.List). For all but one of them, choosing it results in a compile error "The type List is not generic. It cannot be parameterized with arguments <Object>.

Could eclipse please not suggest classes that fit by name, but not by number of type parameters?
Comment 1 Noopur Gupta CLA 2013-09-25 06:02:33 EDT

*** This bug has been marked as a duplicate of bug 417961 ***
Comment 2 Dani Megert CLA 2013-10-17 03:54:23 EDT

*** This bug has been marked as a duplicate of bug 419618 ***