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 251899 - Offer hints for incompatible parameters
Summary: Offer hints for incompatible parameters
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-16 21:07 UTC by cezariusz
Modified: 2015-04-28 14:47 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Missing hint on incompatible parameters. (5.99 KB, image/png)
2015-04-16 21:09 UTC, cezariusz
Details
Hint to create the missing method. (7.75 KB, image/png)
2015-04-16 21:10 UTC, cezariusz
Details
Eclipse offers both hints and even more. (19.11 KB, image/png)
2015-04-16 21:14 UTC, cezariusz
Details
Eclipse also offers more hints when the method doesn't exist (14.88 KB, image/png)
2015-04-16 21:15 UTC, cezariusz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cezariusz 2015-04-16 21:07:10 UTC
Product Version: NetBeans IDE Dev (Build 201504150001)
Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b18
System: Windows 7 version 6.1 running on amd64; Cp1250; pl_PL (nb)

When I try to call a method which doesn't exist, there is a hint to create this method. But when the method exists, but have incompatible parameters, no hints are offered. Editor should offer at least the following two hints:
1. Change method signature to match the parameters.
2. Create an overloaded method with matching parameters.

Testcase:

public class CreateMethod {

	public void method(String str) {
	}
	
	public void demo() {
		method(1);
		noMethod(1);
	}
    
}

For "noMethod" there is a hint, for "method" there isn't. I have to change "method" to for example "method2", use hint to create it, and then refactor to rename it back to "method".
Comment 1 cezariusz 2015-04-16 21:09:04 UTC
Created attachment 153243 [details]
Missing hint on incompatible parameters.
Comment 2 cezariusz 2015-04-16 21:10:13 UTC
Created attachment 153244 [details]
Hint to create the missing method.
Comment 3 cezariusz 2015-04-16 21:14:23 UTC
Created attachment 153245 [details]
Eclipse offers both hints and even more.
Comment 4 cezariusz 2015-04-16 21:15:43 UTC
Created attachment 153246 [details]
Eclipse also offers more hints when the method doesn't exist
Comment 5 Dusan Balek 2015-04-17 15:58:08 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/8e69bbfdc411
Comment 6 Quality Engineering 2015-04-20 11:58:15 UTC
Integrated into 'main-silver', will be available in build *201504201004* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8e69bbfdc411
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #251899: Offer hints for incompatible parameters - fixed.
Comment 7 cezariusz 2015-04-28 14:47:17 UTC
Verified with 201504280001