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

Refaster: fix expression matching in absence of additional syntactic context #2805

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rickie
Copy link
Contributor

@rickie rickie commented Jan 5, 2022

@BeforeTemplate implementations of the form return someParam; are valid
constructs. With these changes such templates behave as expected, such that
someParam only matches expressions of the appropriate type, not references to
the type itself.

Copy link
Contributor

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach was tested extensively in the context of @rickie's Msc thesis 👍

@rickie
Copy link
Contributor Author

rickie commented Jul 4, 2022

Rebased and added a commit to be compatible with the latest changes.

@rickie rickie force-pushed the rossendrijver/refaster_simple_return branch from a1fd29b to e3d86cf Compare August 8, 2022 07:07
@rickie rickie force-pushed the rossendrijver/refaster_simple_return branch from e3d86cf to 29b528a Compare September 2, 2022 08:03
@rickie rickie force-pushed the rossendrijver/refaster_simple_return branch from 29b528a to e5a7be0 Compare January 9, 2023 07:52
@rickie
Copy link
Contributor Author

rickie commented Jan 9, 2023

Rebased and resolved conflict. This still is a nice improvement :).

@Stephan202
Copy link
Contributor

Some context, since one might ask "why would you want to define such a @BeforeTemplate?": by supporting this case, it becomes possible for Refaster to "wrap" all expressions of a given type. This proved useful in the context of Rick's MSc thesis, in which he used Error Prone and Refaster to implement an automated migration from RxJava to Project Reactor. (Shorter paper on the same topic.)

In case there are questions about this, I'm sure that @rickie will gladly answer them. ;)

@rickie rickie force-pushed the rossendrijver/refaster_simple_return branch from 79366f8 to 8bab354 Compare January 16, 2023 08:04
@rickie rickie force-pushed the rossendrijver/refaster_simple_return branch from 8bab354 to d334c28 Compare January 23, 2023 08:32
@rickie
Copy link
Contributor Author

rickie commented Jan 23, 2023

Rebased.

@rickie rickie force-pushed the rossendrijver/refaster_simple_return branch from d334c28 to fdc96e3 Compare June 8, 2023 07:48
@rickie rickie force-pushed the rossendrijver/refaster_simple_return branch from fdc96e3 to d3d6b1d Compare June 19, 2023 10:42
@rickie
Copy link
Contributor Author

rickie commented Jun 20, 2023

Rebased.

@cushon I'm curious to hear your thoughts on this PR. Do you have some time to look into this?

This is one of the PRs that we worked on in the context of my thesis as @Stephan202 mentioned in his previous comment.
We now even have a second paper published about this subject. If you have any questions about it, let me know!

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.

None yet

2 participants