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 271225 - Better Subtype Suggestion for Bound Generic Method Parameters
Summary: Better Subtype Suggestion for Bound Generic Method Parameters
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: Dev
Hardware: PC Windows 8.1
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-03 07:34 UTC by audinue
Modified: 2017-08-03 07:34 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description audinue 2017-08-03 07:34:51 UTC
NetBeans already supported the subtype suggestion for bound generic class parameters.

For example:

class Event {}

class UpdateEvent extends Event {}

class DrawEvent extends Event {}

interface System<T extends Event> {}

class DrawSystem implements System<| Ctrl+Space here


It lists DrawEvent, Event and UpdateEvent. Great!

This feature really helps the discoverability of our API.

However this is not the case for bound generic method parameters.

For example:

class Component {}

class Bounds extends Component {}

class Movement extends Component {}

class Entity {
    
    public <T extends Component> T get(Class<T> type) { return null; }
    
    void test() {
       get(| Ctrl+Space here
    }
}

It lists unrelated stuff.