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

refactor: remove CtParameterReferenceImpl#declaringExecutable #1875

Merged

Conversation

monperrus
Copy link
Collaborator

By analyzing #1869, I realize that CtParameterReference and CtParameterReferenceImpl are badly designed. The problem is that CtParameterReference is stateful with a superfluous pointer to an executable reference:

The solution presented here it to remove the get/setDeclaringExecutable from interface CtParameterReference, and to remove the corresponding state in the implementation (field declaringExecutable).

This fixes the three problems described above. There are a few test changes, which are minor, they were simply directly unit-testing get/setDeclaringExecutable.

Once this one is merged, there will be other PRs for #1869.

@pvojtechovsky
Copy link
Collaborator

I agree that field CtParameterReferenceImpl#executable should be removed.

But would it be possible to KEEP CtParameterReference[Impl]#getDeclaringExecutable() ?? May be we can mark it @derived and compute it's value from the Spoon model?

@monperrus
Copy link
Collaborator Author

you're right. it's better for backward compatibility. done.

@pvojtechovsky
Copy link
Collaborator

Looks good to me. @monperrus are you done with this PR? Do you want to merge it soon (tomorrow morning) or should we wait for feedback of others here?

@spoon-bot
Copy link
Collaborator

API changes: 1 (Detected by Revapi)

Old API: fr.inria.gforge.spoon:spoon-core:jar:6.2.0-20180221.155557-103 / New API: fr.inria.gforge.spoon:spoon-core:jar:6.2.0-SNAPSHOT

Method was removed.
Old method CtParameterReference#setDeclaringExecutable(CtExecutableReference)
New none
Breaking binary: breaking

@monperrus
Copy link
Collaborator Author

monperrus commented Feb 22, 2018 via email

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

Successfully merging this pull request may close these issues.

3 participants