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

Summary: Generics confuse auto completion
Product: java Reporter: s_fuhrm
Component: EditorAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Example where auto completion doesn't work.
Example where auto completion DOES work.

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.