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

Key: IDEA-17317
Type: New Feature New Feature
Status: Open Open
Assignee: Bas Leijdekkers
Reporter: Wim Deblauwe
Votes: 1
Watchers: 1
Operations

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

Add quickfix to convert multiple return values

Created: 05 Mar 08 11:53   Updated: 05 Mar 08 12:16
Component/s: Refactoring, Editor. Intention Actions, Code Analysis. Inspection

Build: 7,590


 Description  « Hide
There is an inspection called "Method with multiple return points". This is already good, but it would be better to have a quickfix or indended action to convert this into 1 return value. Example:
public boolean testReturn()
{
	if( isNeeded() )
	{
		return getResult();
	}
	else
	{
		blabla();
		return true;
	}
}

Gets converted to:

public boolean testReturn()
{
	boolean result;
	if( isNeeded() )
	{
		result = getResult();
	}
	else
	{
		blabla();
		result = true;
	}
	return result;
}


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