Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Exchange method bracket problem
Exchange method bracket problem [message #1697391] Wed, 03 June 2015 14:46 Go to next message
Hauke Mising name is currently offline Hauke Mising nameFriend
Messages: 3
Registered: June 2011
Junior Member
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] Thu, 04 June 2015 01:28 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3799
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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: Sun Aug 25 00:26:02 GMT 2019

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

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

Back to the top