This repository was archived by the owner on Dec 8, 2022. It is now read-only.
Refactor Internal Setter smell in BaseActivity class#768
Open
emaiannone wants to merge 1 commit intoAndlyticsProject:masterfrom
Open
Refactor Internal Setter smell in BaseActivity class#768emaiannone wants to merge 1 commit intoAndlyticsProject:masterfrom
emaiannone wants to merge 1 commit intoAndlyticsProject:masterfrom
Conversation
| } | ||
| if (skipDataReload) { | ||
| setSkipMainReload(true); | ||
| this.skipMainReload = true; |
Member
There was a problem hiding this comment.
actually this. isn't needed
Member
There was a problem hiding this comment.
- 19b9d6e#diff-591237715a12453bb434ffc23b215d9fR123 also calls the setter
- with both parts removed maybe even the setter method could be removed (haven't checked further possible usages of the method).
Author
There was a problem hiding this comment.
Hi @AndyScherzinger and thank you for your reply. I only applied a single example of MIM, I know that there might be some other instances, but I didn't want to apply too many changes at once.
Yes, whenever all references of setter are remove even the method itself could be remove, but currently aDoctor doesn't support this feature.
Member
|
Hi @emaiannone, thanks for taking an interest in Andlytics. I posted some comments to your code change. Cheers, |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I'm Emanuele Iannone, a master student at University of Salerno.
Since my bachelor's thesis I have been working on a code smell refactoring plugin called aDoctor, which is able to identify and fix energy-related problems in Android apps.
I launched it on your project, finding different instances of code smells. I chose one of them and let the plugin automatically fix it.
In this case I chose Internal Setter, that is present when non static method calls a setter method of an instance variable instead of directly changing its value. These kind of smell may have a non trivial impact on energy consumption, as shown in this paper:
https://www.sciencedirect.com/science/article/pii/S0950584918301678.Besides, this kind of refactoring does not impact on the functionalities of your app, so it is totally safe. Let me know if you are interested in this refactoring proposal.