-
Notifications
You must be signed in to change notification settings - Fork 77
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
Apply var to method invocations #236
Comments
@MBoegers Thanks for offering to work on this! Just reach out to us with questions right here in the issue comments or on Slack, if you prefer. |
@knutwannheden thanks for the offer, but first let me close #217 ;) |
I'll start with this one. |
While implementing the handling of |
* fix missing imports in VarBaseTest * add Tests to prove issue #236 us already covered (except generics) * add new Recipe to cover var for generics add test harness * add missing licences * Implement var for generic constructor invocations and move general method invocation to own recipe * Update UseVarKeywordTest to be compliant with child test UseVarForGenericsConstructorsTest * Modify Generic Method Invocations * Update name of UseVarForGenericMethodInvocations to reflect action * Fix yml recipe java-lang-var.yml * update tests to reflect shortcomings of open rewrite regarding generic method invocations * Apply suggestions from code review Co-authored-by: Joan Viladrosa <[email protected]> --------- Co-authored-by: Joan Viladrosa <[email protected]>
What problem are you trying to solve?
While developing basic
var
usage with #217 java reveals that local variable type inference is a big field, so we decided to split.One open area is applying
var
to variable declarations initialized by method invocations.What precondition(s) should be checked before applying this recipe?
var
is not applicable ifbyte
Describe the situation before applying the recipe
Describe the situation after applying the recipe
Have you considered any alternatives or workarounds?
An alternative would be to no support var in combination with methods
Any additional context
It may be a good idea to implement this as an independent recipe, this would increase separation of concern and make configuration easier.
Are you interested in contributing this recipe to OpenRewrite?
Yes, but need additional support understanding generics.
The text was updated successfully, but these errors were encountered: