Skip to main content



      Home
Home » Newcomers » Newcomers » Exchange method bracket problem
Exchange method bracket problem [message #1697391] Wed, 03 June 2015 10:46 Go to next message
Eclipse UserFriend
Hello everyone,

I often copy a row like this:

		MyClass myclass = new MyClass();
		myclass.setFieldOneOutOfTen("1");


Now lets say my class has a total of ten methods like oneOutOfTen, twoOutOfTen...

What I am doing is coping this line 10 times so I have

		MyClass myclass = new MyClass();
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldOneOutOfTen("1");


Then I double click the method name and press ctrl + space for proposals and chose the method I want. But then this line looks like this:

		MyClass myclass = new MyClass();
		myclass.setFieldOneOutOfTen("1");
		myclass.setFieldTwoOutOfTen(string)("1");


So I can enter the new argument but the ("1") is still there. Is it possible that eclipse uses the ("1") as arguments instead of creating the new argument brackets?

Hopefully you understand my problem. Its kind of difficult to describe.

Thanks for you help and many greetings,
Hauke
Re: Exchange method bracket problem [message #1697441 is a reply to message #1697391] Wed, 03 June 2015 21:28 Go to previous message
Eclipse UserFriend
On 06/03/2015 08:46 AM, Hauke Mising name wrote:
> Hello everyone,
>
> I often copy a row like this:
>
>
> MyClass myclass = new MyClass();
> myclass.setFieldOneOutOfTen("1");
>
>
> Now lets say my class has a total of ten methods like oneOutOfTen,
> twoOutOfTen...
>
> What I am doing is coping this line 10 times so I have
>
>
> MyClass myclass = new MyClass();
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldOneOutOfTen("1");
>
>
> Then I double click the method name and press ctrl + space for proposals
> and chose the method I want. But then this line looks like this:
>
>
> MyClass myclass = new MyClass();
> myclass.setFieldOneOutOfTen("1");
> myclass.setFieldTwoOutOfTen(string)("1");
>
>
> So I can enter the new argument but the ("1") is still there. Is it
> possible that eclipse uses the ("1") as arguments instead of creating
> the new argument brackets?
>
> Hopefully you understand my problem. Its kind of difficult to describe.
>
> Thanks for you help and many greetings,
> Hauke

The completion is telling you that a string argument goes there in the
context of how you engaged it. It will not see that you've already got a
string argument and then use that. Sorry.
Previous Topic:Steps for importing source code
Next Topic:Eclipse isn't working after themes installed
Goto Forum:
  


Current Time: Sat May 24 07:01:49 EDT 2025

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

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

Back to the top