Skip to content
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

Missing Encapsulate Attribute refactoring #459

Open
pedramnoori opened this issue May 5, 2023 · 0 comments
Open

Missing Encapsulate Attribute refactoring #459

pedramnoori opened this issue May 5, 2023 · 0 comments

Comments

@pedramnoori
Copy link

Problem

Missing Encapsulate Attribute refactoring while Move Attribute refactoring happened

Commit

graphhopper/graphhopper@7f80425

Refactorings involved

1- Extract And Move Method package toDetailsString() : String extracted from public toDetailsString() : String in class com.graphhopper.storage.GraphHopperStorage & moved to class com.graphhopper.storage.BaseGraph

2- Move Attribute private nodeCount : int from class com.graphhopper.storage.GraphHopperStorage to protected nodeCount : int from class com.graphhopper.storage.BaseGraph

Description

The replacement within the aforementioned Extract and Move Method is “nodeCount -> getNodes()”. The thing is the nodeCount attribute has been moved to the destination class (BaseGraph) and reported by RefactoringMiner. This attribute also got encapsulated in the getNodes() method within the destination class, but this is not reported by the RefactoringMiner. This is a case of Encapsulate Attribute on top of the Move Attribute Refactoring.

Also note that this change is a pure and justifiable modification. Having the Encapsulate Attribute Refactoring will allow the PurityChecker to report the Extract and Move Method refactoring as a pure case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant