Skip to content

MethodType parameter names not retained#5923

Merged
timtebeek merged 11 commits intomainfrom
preserve-method-parameter-names
Aug 18, 2025
Merged

MethodType parameter names not retained#5923
timtebeek merged 11 commits intomainfrom
preserve-method-parameter-names

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented Aug 16, 2025

@timtebeek timtebeek marked this pull request as ready for review August 16, 2025 21:56
@knutwannheden
Copy link
Copy Markdown
Contributor

I think there may have been a bug in the type table writer, so that it didn't write out parameter names. I fixed that when I added annotation support.

@timtebeek
Copy link
Copy Markdown
Member Author

They'd helpful, but this test still failed over the weekend and is using direct classpath dependencies right, not classpathFromResources?

@knutwannheden
Copy link
Copy Markdown
Contributor

They'd helpful, but this test still failed over the weekend and is using direct classpath dependencies right, not classpathFromResources?

I didn't actually check. Your comment just reminded me of this issue.

@timtebeek timtebeek changed the title MethodType parameter names not retained for Guava method MethodType parameter names not retained Aug 18, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Aug 18, 2025
timtebeek and others added 2 commits August 18, 2025 13:26
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@timtebeek timtebeek merged commit 380c942 into main Aug 18, 2025
1 check passed
@timtebeek timtebeek deleted the preserve-method-parameter-names branch August 18, 2025 11:27
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Aug 18, 2025
dcsekar pushed a commit to dcsekar/rewrite that referenced this pull request Aug 18, 2025
* MethodType parameter names not retained for Guava method

* Show a possible solution with reflection by Claude

* Remove special handling for int/String

* Pass in `-parameters` instead

* Revert formatting changes

* Replicate change to other Java parser versions

* Move test method and use assertj-core which is already present

* Revert to `get(0)` when running on Java 8, 11 & 17

* Only enable test on Java 11+ for now

* Minimize accidental changes between Java 8 and 11 parsers

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working java parser

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants