-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Migrate Refactoring for Generating Equal and Hash Methods #16786
Conversation
Add SycCmGenerateEqualAndHashCommand (based in Commander 2) Remove old SycGenerateEqualAndHashCommand using Commander 1. Add icon Add test class
It presents a selection dialog to confirm changes. Add tests
@balsa-sarenac can you have a look? Tx |
src/Refactoring-Core/RBGenerateEqualHashTransformation.class.st
Outdated
Show resolved
Hide resolved
src/Refactoring-DataForTesting/RBClassForGeneratingEqualAndHash.class.st
Outdated
Show resolved
Hide resolved
src/Refactoring-DataForTesting/RBClassForGeneratingEqualAndHashExistingImplementors.class.st
Outdated
Show resolved
Hide resolved
src/Refactoring-UI-Tests/ReGenerateEqualAndHashDriverTest.class.st
Outdated
Show resolved
Hide resolved
src/SystemCommands-ClassCommands/SycCmGenerateEqualAndHashCommand.class.st
Show resolved
Hide resolved
src/SystemCommands-ClassCommands/SycCmGenerateEqualAndHashCommand.class.st
Outdated
Show resolved
Hide resolved
Yes |
Sounds good to me. |
Thanks |
@hernanmd The renaming is not good:
|
Thanks for reporting, Christophe. We should probably discuss the Re prefix (as taken by Renraku) with @Ducasse. |
Ok, I checked. Those instance variables are on purpose, so I added a Manifest. |
Thank you for checking Hernan! |
yes, I think it would be better to use another prefix. When you agree on a prefix, you can issue a new PR for it. |
Why this is a problem to have two projects with the same prefix. |
Having the same prefix for different projects just add confusion even if technically, it does not change anything. |
This PR was merged but it had failing tests, among them:
|
I sadly can not even revert the PR as this is now so long ago that it was merged |
Description
This PR migrates the refactoring browser for generating #= and #hash methods to the new driver interface. The new interface provides a more streamlined and extensible approach for generating these methods, making it easier to maintain and enhance the functionality in the future.
Motivation
The existing implementation of the refactoring browser for generating #= and #hash methods was tightly coupled with the user interface (UI) code and did not prevent overwriting the existing implementation of such methods (#16361). By separating the core logic from the UI, we can improve the code's maintainability and testability and enable future enhancements or alternative user interfaces.
Implementation.
The implementation of this PR involves the following steps:
ReGenerateEqualAndHashDriver,
has been introduced. This interface defines the contract for generating #= and #hash methods, encapsulating the core logic for this functionality.RBGenerateEqualHashTransformation
for the underlying logic.SpSelectMultipleDialog
for selecting the variables used in the generated #= and #hash methods.ReGenerateEqualAndHashDriverTest