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 258464 - extends / implements should not restrict the completion list
Summary: extends / implements should not restrict the completion list
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-21 12:09 UTC by emi
Modified: 2016-08-30 08:38 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 emi 2016-03-21 12:09:24 UTC
If I have a new class, NetBeans is smart enough not to show an interface in the completion popup after 'extends' and not to show a class in the completion popup after 'implements'.

But I believe NetBeans is a bit TOO smart here.

I sometimes don't know if what I need is an interface or class, I just want to subclass it somehow.

So, I write something like:

public class MyClass implements MySuperThi^

and then I am surprised why nothing shows up in the completion popup for "MySuperThi". 

What I sometimes assume is that perhaps I forgot to add a Maven dependency?

But the correct answer is that MySuperThing is a class not an interface.

What I would prefer NetBeans to do is:

1. When it shows the completion the 1st time is should be like now and display only the matching classes/interfaces.

2. If the previous results are empty OR if I force show the completion the second time (with Ctrl+Space) then it should relax the extends/implements rule and show everything, be it interface or class.
 Then, if I select a class and I have mistakenly typed 'implements' it should replace that with 'extends'.
 If I select an interface but I have mistakenly typed 'extends' it should replace that with 'implements'.