3 quote from referenced link
source | link

I would extract methodextract method and make it

if ( blah )
{
    ...
}
else
{
   newMethod();
}

See "extract method" approach explained at Refactoring Catalog site:

You have a code fragment that can be grouped together.

Turn the fragment into a method whose name explains the purpose of the method.

void printOwing() {
    printBanner();

    //print details
    System.out.println ("name:    " + _name);
    System.out.println ("amount    " + getOutstanding());
}

                                                                                                         http://www.refactoring.com/catalog/arrow.gif

void printOwing() {
    printBanner();
    printDetails(getOutstanding());
}

void printDetails (double outstanding) {
    System.out.println ("name:    " + _name);
    System.out.println ("amount    " + outstanding);
}

I would extract method and make it

if ( blah )
{
    ...
}
else
{
   newMethod();
}

I would extract method and make it

if ( blah )
{
    ...
}
else
{
   newMethod();
}

See "extract method" approach explained at Refactoring Catalog site:

You have a code fragment that can be grouped together.

Turn the fragment into a method whose name explains the purpose of the method.

void printOwing() {
    printBanner();

    //print details
    System.out.println ("name:    " + _name);
    System.out.println ("amount    " + getOutstanding());
}

                                                                                                         http://www.refactoring.com/catalog/arrow.gif

void printOwing() {
    printBanner();
    printDetails(getOutstanding());
}

void printDetails (double outstanding) {
    System.out.println ("name:    " + _name);
    System.out.println ("amount    " + outstanding);
}
2 1) extract method += http://martinfowler.com/refactoring/catalog/extractMethod.html "as explained here" 2) uniform braces indentation
source | link

I would extract methodextract method and make it

if ( blah )
{
    ...
}
else  
{
   newMethod();
}

I would extract method and make it

if ( blah )
{
    ...
}
else {
   newMethod();
}

I would extract method and make it

if ( blah )
{
    ...
}
else 
{
   newMethod();
}
1
source | link

I would extract method and make it

if ( blah )
{
    ...
}
else {
   newMethod();
}