History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-15461
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Dmitry Jemerov
Reporter: Keith Lea
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

"Inline Method refactoring is not supported when return statement interrupts the execution flow" is wrong

Created: 07 Mar 07 03:09   Updated: 12 Sep 07 17:06
Component/s: Refactoring
Fix Version/s: Diana Final

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 6,148
Severity: Medium


 Description  « Hide
Given this code:
class Tester {
  String callee(String x) {
    if (x == null) {
      return null;
    }
    return x;
  }

  void caller(String v) {
    String g = callee(v);
    System.out.println(g);
  }
}

Try to inline callee(). IDEA says it's not possible, but in fact it is:

class Tester {
  void caller(String v) {
    String g;
    if (v == null) {
      g = null;
    } else {
      g = v;
    }
    System.out.println(g);
  }
}


 All   Comments   Work Log   Change History      Sort Order:
Eugene Vigdorchik - 08 Mar 07 16:37
Yep, adding 'else' on method inline would solve the problem.