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 129298

Summary: Create method is not provided if argument of missing method has bound generic
Product: java Reporter: Jiri Prox <jiriprox>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P4    
Version: 7.1.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jiri Prox 2008-03-05 14:29:52 UTC
Product Version: NetBeans IDE 6.1 Beta (Build 200803050202)
Java: 1.6.0_10-ea; Java HotSpot(TM) Client VM 11.0-b11
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)

Create method hint is not provided if argument of missing method has bound generic type.

Steps to reproduce:

1) have a code:
    public void test() {
        List<? extends Runnable> aa = null;
        nonExisting(aa);
    }

-> no create method hint is provided
Comment 1 Jan Becicka 2008-05-15 13:22:42 UTC
Max volunteered :)
Comment 2 jrose 2009-01-09 23:57:31 UTC
This bug is a recurring pain for me, because my code has lots of parameters of type Class<?>.  As a workaround, I temporarily delete the <?> or cast to a 
raw type Class, let the hint generate my method, and then add back the parameter.  Seems like the kind of useless work that should be automated.

(Also, it would be good to provide me a way of controlling where the inserted methods go; the default location is almost always wrong.)
Comment 3 locked 2012-05-09 18:43:23 UTC
Product Version: NetBeans IDE 7.1.1 (Build 201202271535)

This is really very annoying. I hardly use ANY collections without generics so that this bug hits me more and more often.

Just use the below class and check the quick hints. The first 2 work as expected, the foo(b) just report an error ...

public class Test {
    public static void main(String[] args) {
        List<String> a;
        List<? extends String> b;
        foo(); // works to create method with quick hint
        foo(a);  // works to create method with quick hint
        foo(b); // only reports an error
    }
}

PS: changed version to 7.1.1 and target to TBD
Comment 4 Martin Balin 2016-07-07 07:16:15 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss