Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 129298 - Create method is not provided if argument of missing method has bound generic
Create method is not provided if argument of missing method has bound generic
Product: java
Classification: Unclassified
Component: Hints
All All
: P4 with 2 votes (vote)
Assigned To: Svata Dedic
Depends on:
  Show dependency treegraph
Reported: 2008-03-05 14:29 UTC by Jiri Prox
Modified: 2016-07-07 07:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
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;

-> 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

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo