Bug 240570 - Code completion for java classes suggests irrelevant code
Summary: Code completion for java classes suggests irrelevant code
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.4
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: Dusan Balek
: 243463 (view as bug list)
Depends on:
Reported: 2014-01-16 22:59 UTC by heintz
Modified: 2015-03-19 03:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Code completion result for "Butto" with no "Butto*" classes imported. (176.54 KB, image/png)
2014-01-16 22:59 UTC, heintz
Code completion settings (87.94 KB, image/png)
2014-01-16 23:00 UTC, heintz

Note You need to log in before you can comment on or make changes to this bug.
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.

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.