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.
1 comment
Comment actions Permalink

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

Please sign in to leave a comment.