This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 200831 - Code completion doesn't work for <? super Class> generics
Summary: Code completion doesn't work for <? super Class> generics
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 12:20 UTC by Alexander Kouznetsov
Modified: 2011-08-16 13:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2011-08-10 12:20:30 UTC
Consider the following code fragment:

public abstract class GenericsAutocompletion<T extends Collection> {
    
    abstract void abstractMethod();
    
    public static void method(GenericsAutocompletion<? super List> arg) {
    }
    
    public static void main(String[] args) {
        method(new |);
    }
}

Invoke code completion (Ctrl-Space) after new operator at '|' symbol and press Enter, the line becomes like this:

        method(new GenericsAutocompletion<List>);

The problem is the selection in the list is incorrect. It is AbstractMethodError, not the list of super to List. And code completion doesn't go further to abstractMethod implementation.

This code is quite common in JavaFX with EventHandlers so this is highly visible NetBeans issue.
Comment 1 Dusan Balek 2011-08-15 15:16:10 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/637806a8e939
Comment 2 Quality Engineering 2011-08-16 13:55:29 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/637806a8e939
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #200831: Code completion doesn't work for <? super Class> generics - fixed.