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

Key: IDEABKL-2968
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Eugene Vigdorchik
Reporter: Keith Lea
Votes: 0
Watchers: 0
Available Workflow Actions

Mark as Stalled
Operations

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

Add Extract Statement refactoring to factor out common parts of sub-blocks (e.g. if/else body)

Created: 24 May 05 19:44   Updated: 24 May 05 21:44
Component/s: Editor. Intention Actions, Refactoring
Affects Version/s: None
Fix Version/s: None

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

Build: 3,341
Severity: Medium


 Description  « Hide
Given code:

void method(String p) {
if (p == null) { System.out.println("nothing"); } else { System.out.println("something"); }
}

I want to choose either System.out.println line, and choose "Extract Statement" to produce something like:

void method(String p) {
String obj;
if (p == null) { obj = "nothing"; } else { obj = "something"; }
System.out.println(obj);

This code has same semantics as above code, but cleaner syntax.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.