-
-
Notifications
You must be signed in to change notification settings - Fork 407
[Refactoring] Driver improvement for temp to instance variable #18965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactoring] Driver improvement for temp to instance variable #18965
Conversation
…aro into refactoring/newdriver
src/Refactoring-Core/RBTemporaryToInstanceVariableRefactoring.class.st
Outdated
Show resolved
Hide resolved
|
|
||
| ^ ReVariablesNotReadBeforeWrittenCondition new | ||
| subtree: parseTree; | ||
| variables: temporaryVariableName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why variables: tempVarName and not variable? or variables: { tempVarName }
| { #category : 'transforming' } | ||
| RBTemporaryToInstanceVariableRefactoring >> privateTransform [ | ||
|
|
||
| self removeTemporaryOfClass: class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not really undersyand what is removeTemporyOfClass: doing so it is difficult for me to get further.
Trying to understand the logic: I think that there were something we should keep.
If one of the subclass got the same instance variable that the temp we want to convert, then we remove it from that class and defines it in the root class.
So why removing this logic.
Because now if a subclass has the variable with the same name we force the guy to do a pullUp.
May be this is better this way the developer has to see it.
src/Refactoring-Core/ReMultipleMethodsDontReferToTempVarsCondition.class.st
Outdated
Show resolved
Hide resolved
| #package : 'Refactoring-DataForTesting', | ||
| #tag : 'ForConvertingVariables' | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the scenario where a subclass has the same name as the temp that we want to convert.
|
|
||
| { #category : 'execution' } | ||
| ReConvertTemporaryToInstanceVariableDriver >> handleBreakingChanges [ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In latest Pharo you can remove this method because it is done in a different way in the superclass.
|
This test has a failing test that was not there before I think testExternalBasicToolsDependencies MacOSX64.System.Dependencies.Tests.SystemDependenciesTest Given Collections do not match! additions : #('Calypso-SystemTools-QueryBrowser') missing: #() |
Implemented fully a driver for ReTemporaryToInstanceVariableRefactoring (which was not used actually, now is) with also new driver tests that covers all the changes