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

Wrong return type for method references #2966

Closed
MassimilianoPoggi opened this issue May 7, 2019 · 1 comment · Fixed by #3007
Closed

Wrong return type for method references #2966

MassimilianoPoggi opened this issue May 7, 2019 · 1 comment · Fixed by #3007
Labels

Comments

@MassimilianoPoggi
Copy link

MassimilianoPoggi commented May 7, 2019

The CtExecutableReference interface specifies that getType() should return the method return type for a reference to a method, however the current implementation of the transformation from the JDT model to the spoon model is incorrect (at least, it appears so to me): at line 585 in JDTTreeBuilderHelper.java the type of the newly-created ExecutableReference is set to the type declaring the method, rather than the method return type itself.

This bug breaks, for example, the Refactoring.changeMethodName(CtMethod) method, since the ExecutableReference does not match with the one returned from the method itself, and overall makes matching method references to their corresponding method pretty awkward, as it has to be done manually.

@monperrus
Copy link
Collaborator

Thanks a lot for the bug report. Could you write a pull request with a failing test case? That would be super useful.

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

Successfully merging a pull request may close this issue.

2 participants