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 203476 - Java "Create Method" fix is not offered when call site is argument to another method
Summary: Java "Create Method" fix is not offered when call site is argument to another...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.1
Hardware: Macintosh Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 01:37 UTC by dbell
Modified: 2016-07-07 07:16 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dbell 2011-10-11 01:37:25 UTC
[ BUILD # : 201110070600 ]
[ JDK VERSION : 1.6.26 ]

Usually, when I reference a nonexistent Java method in the editor, a hint
appears with a "Create Method" fix.

e.g.
Person person = ...
String name = getName(person);

If the method getName() with param "person" does not exist, a "Create method
"getName(com.example.Person)" in ..." hint is given.

However, consider this example:
String name = getName(getPerson());

If getName() exists, but getPerson() does not exist, no hint is given to create
getPerson().
Comment 1 dbell 2011-10-30 14:19:37 UTC
This seems to only happen if the call site is an argument to an external static method.
Comment 2 Jan Lahoda 2013-07-18 19:57:43 UTC
Fixed in jet-main:
http://hg.netbeans.org/jet-main/rev/1955590d6248
Comment 3 Quality Engineering 2013-07-20 02:13:46 UTC
Integrated into 'main-silver', will be available in build *201307192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/1955590d6248
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #203476: fuzzy resolving methods should take enclosing elements and static imported elements into account.
Comment 4 Mahene 2014-05-13 20:56:05 UTC
In Ubuntu 14.04 with Netbeans 8 and JDK 8 this type of code completion doesn't work, e.g.
assertThat(g.width(), is(3));
from a hamcrest test method where width() doesn't exist yet, Netbeans doesn't offer any hint.
Comment 5 Martin Balin 2016-07-07 07:16:39 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss