Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Parameter Hints do not recognize correct method(in case of overloaded methods)
Parameter Hints do not recognize correct method [message #787529] Tue, 31 January 2012 17:24 Go to next message
David  Balažic is currently offline David BalažicFriend
Messages: 130
Registered: July 2009
Senior Member
	void test(int i){}
	void test(int i, boolean x){}
 
	void invoke() {
		test(3);
		test(6,true);
	}


When invoking Parameter Hints by pressing ctrl-shift-space inside the parameter list in either of the two invocations of the test() method, a popup choice appears offering both variants.

Is this on purpose?
Why is not the "correct" version chosen automatically?
Especially in longer parameter lists it is a bit hard to manually figure out the correct method.

Is it possible to get a visual hint, which method is matched by the actual code?

Regards,
David
(Using Indigo Service Release 1)
Re: Parameter Hints do not recognize correct method [message #787904 is a reply to message #787529] Wed, 01 February 2012 05:05 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 1/31/2012 10:54 PM, David Balažic wrote:
>
> void test(int i){}
> void test(int i, boolean x){}
>
> void invoke() {
> test(3);
> test(6,true);
> }
>
>
> When invoking Parameter Hints by pressing ctrl-shift-space inside the
> parameter list in either of the two invocations of the test() method, a
> popup choice appears offering both variants.
>
> Is this on purpose?
> Why is not the "correct" version chosen automatically?
Yes this is intentional, because you may want anyone of the overloaded
methods.

> Especially in longer parameter lists it is a bit hard to manually figure
> out the correct method.
>
> Is it possible to get a visual hint, which method is matched by the
> actual code?

You can place the caret on the method name in the method invocation and
press 'F2' to popup a hover containing the javadoc and the method signature.

--
Deepak Azad
http://wiki.eclipse.org/JDT/FAQ
Re: Parameter Hints do not recognize correct method [message #787986 is a reply to message #787904] Wed, 01 February 2012 07:54 Go to previous message
David  Balažic is currently offline David BalažicFriend
Messages: 130
Registered: July 2009
Senior Member
Deepak Azad wrote on Wed, 01 February 2012 06:05
On 1/31/2012 10:54 PM, David Balažic wrote:
>
> void test(int i){}
> void test(int i, boolean x){}
>
> void invoke() {
> test(3);
> test(6,true);
> }
>
>
> When invoking Parameter Hints by pressing ctrl-shift-space inside the
> parameter list in either of the two invocations of the test() method, a
> popup choice appears offering both variants.
>
> Is this on purpose?
> Why is not the "correct" version chosen automatically?
Yes this is intentional, because you may want anyone of the overloaded
methods.

> Especially in longer parameter lists it is a bit hard to manually figure
> out the correct method.
>
> Is it possible to get a visual hint, which method is matched by the
> actual code?

You can place the caret on the method name in the method invocation and
press 'F2' to popup a hover containing the javadoc and the method signature.

Yes, but this does not have the feature of Parameter Hints to highlight the parameter which is under the cursor.
Previous Topic:Importing JDT Package
Next Topic:Old eclipse does not work fine on Windows 7
Goto Forum:
  


Current Time: Thu Apr 25 19:50:15 GMT 2024

Powered by FUDForum. Page generated in 0.02897 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top