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 240570

Summary: Code completion for java classes suggests irrelevant code
Product: editor Reporter: heintz
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: iluvtr
Priority: P3    
Version: 7.4   
Hardware: Macintosh (x86)   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Attachments: Code completion result for "Butto" with no "Butto*" classes imported.
Code completion settings

Description heintz 2014-01-16 22:59:53 UTC
Created attachment 144055 [details]
Code completion result for "Butto" with no "Butto*" classes imported.

When using code completion for a class which is not yet imported, the code completer gives very strange, highly irrelevant (and annoying) suggestions.

In a class in my Maven/Vaadin application, I write "Butto" and press ctrl+space, a long list of suggestions are given to me, the first being the final long sun.awt.XConstants.Button1MotionMask. First some 50 suggestions below is the first "class" suggestion, which is the com.vaadin.ui.Button class I want.

The suggestion of constants is new in Netbeans 7.4?) or at least the default behaviour and (imho) really degrades the usability of code completion. The code completion have really improved for javascript, css, etc the last releases. However, I'm sorry to say that my experience of the java code completion is that it have significantly degraded (although this is my only documented example).

I'm running a clean Netbeans 7.4 install in a newly installed Mac OS X 10.9.1 and I have attached the code completion result screenshot as well as my java code completions settings.
Comment 1 heintz 2014-01-16 23:00:28 UTC
Created attachment 144056 [details]
Code completion settings
Comment 2 Dusan Balek 2015-03-18 12:15:56 UTC
Improving mechanism that preselects the most relevant completion item.

http://hg.netbeans.org/jet-main/rev/c89c1852d185
Comment 3 Dusan Balek 2015-03-18 12:32:26 UTC
*** Bug 243463 has been marked as a duplicate of this bug. ***
Comment 4 Quality Engineering 2015-03-19 03:34:18 UTC
Integrated into 'main-silver', will be available in build *201503190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c89c1852d185
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #240570: Code completion for java classes suggests irrelevant code - fixed.