-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use visitor for applying changes with locations #171
Conversation
* @return the modification that should be applied. | ||
*/ | ||
@Nullable | ||
public Modification visit(Change change) { |
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.
It is confusing to name this method visit
since it's not one of the standard visitor methods. How about:
public Modification visit(Change change) { | |
public Modification computeModification(Change change) { |
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.
Sure, that makes sense. 15ff010
} | ||
|
||
/** | ||
* Applies the change to the compilation unit. |
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.
This doesn't actually apply any change, right? It just computes the change (Modification
) to be applied?
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.
Yes exactly. I reworded the java doc to mention this, please let me know if I should update it. 2e2dd6b
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.
Hrm, I don't see the javadoc changes here; maybe the commit got lost somehow?
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.
Sorry for that, the change was on the javadoc for the class. Update the method javadoc as well 66edb7e
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.
one minor thing
} | ||
|
||
/** | ||
* Applies the change to the compilation unit. |
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.
Hrm, I don't see the javadoc changes here; maybe the commit got lost somehow?
This PR updates the logic for applying changes specified by
Location
instances using the visitor pattern architecture added in #169