IDEA-8 -- extract method refactoring question.

Is there any way to extract an instance method (not static method) from one class to another? i.e. can you do comething like this

public class SomeClass

{

   
public void doSomething(Account account, User user)

{

     
int a = 5;

     
final float amount = getAmount();

     
processThis(account, user, amount);

}

}



public class SomeClassRefactored

{

   
public void doSomething(Account account, User user)

  
{

     
int a = 5;

     
final float amount = getAmount();

     
account.processTransaction(user, amount);

}

}


Thanks in advance.
0
Avatar
Permanently deleted user

Viraf Karai wrote:

Is there any way to extract an instance method (not static method) from one class to another? i.e. can you do comething like this

The Move refactoring should do this.

N.

0

请先登录再写评论。