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 207606 - Code Completion generates wrong Method Parameters
Summary: Code Completion generates wrong Method Parameters
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.1
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-22 02:45 UTC by bht
Modified: 2012-04-06 08:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
testcase in zip file (13.69 KB, application/zip)
2012-01-22 02:45 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2012-01-22 02:45:23 UTC
Created attachment 115147 [details]
testcase in zip file

Please see the attached JUnit testcase.

This happens a lot and irritates especially peope who convert from Eclipse.

NetBeans is smart and matches types as much as possible, but it makes bad choices even when it actually has variables in scope that match the names of the method.

In other words, in a case where NetBeans cannot find local variables with both matching type and name, then it would be preferable to insert the name of the API not any variable in scope with a matching type.

The current implementation introduces subtle errors as can be seen in the testcase, and this is worse overall than a completely dumb implementation as in Eclipse.
Comment 1 Dusan Balek 2012-02-03 17:52:16 UTC
Particular example fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/291e9208a8b3

Please note, that you could switch the code completion parameter guessing off (Tools -> Options -> Editor -> Code Completion -> Java -> Guess Filled Method Arguments)
Comment 2 bht 2012-02-03 18:07:11 UTC
Thanks :)
Comment 3 Jiri Prox 2012-04-02 13:16:01 UTC
verified in trunk
Comment 4 Dusan Balek 2012-04-04 10:03:21 UTC
Transplanted into release71_fixes.

http://hg.netbeans.org/releases/rev/5400aa3f5096
http://hg.netbeans.org/releases/rev/2a82a445f246
Comment 5 Quality Engineering 2012-04-05 01:20:23 UTC
Integrated into 'releases', will be available in build *201204042205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/5400aa3f5096
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #207606: Code Completion generates wrong Method Parameters - fixed.
Comment 6 Jiri Prox 2012-04-06 08:18:32 UTC
verified in patch