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 253611 - Generics confuse auto completion
Summary: Generics confuse auto completion
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-21 09:49 UTC by s_fuhrm
Modified: 2015-08-06 01:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example where auto completion doesn't work. (178 bytes, text/x-java)
2015-07-21 09:49 UTC, s_fuhrm
Details
Example where auto completion DOES work. (171 bytes, text/x-java)
2015-07-21 09:51 UTC, s_fuhrm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description s_fuhrm 2015-07-21 09:49:27 UTC
Created attachment 154759 [details]
Example where auto completion doesn't work.

When adding a class with a generic that self-references itself, NetBeans doesn't support auto completion anymore for superclassing or implementing.

Please see the attached classes: 
* Foo shows the buggy behaviour (auto complete serializable), 
* Bar shows the correct behaviour for a stripped down case (auto complete serializable)

If you want it to "implements Serializable" and start typing, NetBeans won't propose suggestions and can't add imports.
This works for classes not having this kind of self-references / nested generics.

I suspect the parser to be confused by the construct.

-------

Expected behaviour:

when typing and after hitting CTRL+SHIFT after "Ser", I get proposed "java.io.Serializable" as a completion:

public class Foo<T extends List<T>> implements Serializable {

-------

Actual behaviour:

when typing and after hitting CTRL+SHIFT after "Ser", I get displayed "no suggestions":

public class Foo<T extends List<T>> implements Ser {

but if I remove the List generic, it works with auto completion:

public class Bar<T extends List> implements Serializable {
Comment 1 s_fuhrm 2015-07-21 09:51:11 UTC
Created attachment 154760 [details]
Example where auto completion DOES work.

Please note the missing generic parameter for list.
Comment 2 Jiri Prox 2015-07-21 09:56:11 UTC
reproducible
Comment 3 Dusan Balek 2015-08-05 15:07:12 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/5b65d63bfaeb
Comment 4 Quality Engineering 2015-08-06 01:24:50 UTC
Integrated into 'main-silver', will be available in build *201508060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5b65d63bfaeb
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #253611 - Generics confuse auto completion - fixed.