Determine generic nature of targeted methods in J.MethodInvocation
#4721
Labels
enhancement
New feature or request
J.MethodInvocation
#4721
What problem are you trying to solve?
For any method targeted by a
J.MethodInvocation
it should be easy to determine if the method's return type is generic.This is needed in some cases to implement migrations for language features.
As generics introduce a whole new level of complexity, it should be easy to leave such invocations untouched.
Bullets 1 and 2 are somehow decidable by analyzing the owning class or the parameters of the method.
For Bullet 3 the information are lost, as @knutwannheden describes here it is somehow decideable.
Describe the solution you'd like
I'd like to be able to get the information from the
J.MethodInvocation#getMethodType
.Maybe a new
Flag
would solve this problem and could also be used as shorthand aroundJ.ClassDeclaration
s.Have you considered any alternatives or workarounds?
See https://rewriteoss.slack.com/archives/C01A843MWG5/p1732217494169589
Additional context
Are you interested in contributing this feature to OpenRewrite?
Yes
The text was updated successfully, but these errors were encountered: