-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add checking so no invalid extract local variable proposals are offer…
…ed (#1177) * Add checking so no invalid extract local variable proposals are offered - fix ExtractTempRefactoring.checkFinalConditions() to recognize an empty edit and set refactoring status to info with failure message - also fix the method to register it has been run and to save the refactoring status code - fix QuickAssistProcessor.getExtractVariableProposal() to run the checkFinalConditions() method of the extract temp refactorings and to not offer a proposal if the status is not OK - add new tests to ExtractTempTests and AssistQuickFixTest
- Loading branch information
Showing
13 changed files
with
186 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test119_out.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test122_out.java
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/cannotExtract/A_testFail43.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package p; //19, 9, 19, 88 | ||
|
||
public class A { | ||
private Object elementName; | ||
private Object parent; | ||
|
||
public Object getElementName() { | ||
return elementName; | ||
} | ||
|
||
private class UtilClass { | ||
public static int combineHashCodes(int a, int b) { | ||
return a + b; | ||
} | ||
} | ||
@Override | ||
public int hashCode() { | ||
int k = this.parent == null ? super.hashCode() : | ||
UtilClass.combineHashCodes(getElementName().hashCode(), this.parent.hashCode()); | ||
return k; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.