-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add ChangeMethodParameter for modify parameters in Spring Batch method declaration #631
Add ChangeMethodParameter for modify parameters in Spring Batch method declaration #631
Conversation
f7f6a7e
to
d2ccfb6
Compare
Signed-off-by: Kun Chang <[email protected]>
d2ccfb6
to
e1675a8
Compare
Thanks a lot @ckcd ! Would it make sense to immediately add recipes for some of those updated Spring Batch data types? That way we have the context of why this was added and can try it out with an implementation. |
src/main/java/org/openrewrite/java/spring/ChangeMethodParameter.java
Outdated
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Kun Chang <[email protected]>
@timtebeek Thanks for your reply! I add a |
src/main/java/org/openrewrite/java/spring/ChangeMethodParameter.java
Outdated
Show resolved
Hide resolved
...pringBoot_3_0/java/org/openrewrite/java/spring/batch/UpgradeSkipPolicyParameterTypeTest.java
Show resolved
Hide resolved
...pringBoot_3_0/java/org/openrewrite/java/spring/batch/UpgradeSkipPolicyParameterTypeTest.java
Outdated
Show resolved
Hide resolved
...pringBoot_3_0/java/org/openrewrite/java/spring/batch/UpgradeSkipPolicyParameterTypeTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@timtebeek Thanks for your fix! For now I saw all checks are passed, is there anything I need to do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much appreciated the careful planning ahead to make this recipe already support types not yet used, and then putting it to work here for Spring Batch as well to prove it works. 🙏🏻
…d declaration (#631) * Add ChangeMethodParameter for modify parameters in method declaration Signed-off-by: Kun Chang <[email protected]> * Minor polish * Add correct year * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add UpgradeSkipPolicyParameterType for Spring Batch Signed-off-by: Kun Chang <[email protected]> * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix tests * Also show ability to change interface methods --------- Signed-off-by: Kun Chang <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…d declaration (openrewrite#631) * Add ChangeMethodParameter for modify parameters in method declaration Signed-off-by: Kun Chang <[email protected]> * Minor polish * Add correct year * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add UpgradeSkipPolicyParameterType for Spring Batch Signed-off-by: Kun Chang <[email protected]> * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix tests * Also show ability to change interface methods --------- Signed-off-by: Kun Chang <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add relevant context to description of AddSpringDependencyManagementPlugin * Adopt RemoveMethodInvocations from rewrite-java * Remove now-defunct rewrite-templating dependency * refactor: Update Gradle wrapper Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.gradle.UpdateGradleWrapper?organizationId=T3BlblJld3JpdGU%3D#defaults=W3sibmFtZSI6ImFkZElmTWlzc2luZyIsInZhbHVlIjoiRmFsc2UifV0= Co-authored-by: Moderne <[email protected]> * Fix method type following openrewrite/rewrite#4688 * Update method type as well when removing arguments * Fix incorrect path computation for Spring API endpoints (#632) * Fix incorrect path computation for Spring API endpoints The current logic did not cover the case where a `RequestMapping` with a path was defined on the Controller class, and no paths were defined in the `*Mapping` at the method level. * Do not disable the FindApiEndpointsTest * Simplify FindApiEndpoints and SpringRequestMapping * Add for now failing unit test * AnnotationMatcher does not support wildcards --------- Co-authored-by: Tim te Beek <[email protected]> * Add commons codec dependency upgrade * feat: Added recipe to comment deprecated and removed properties without alternative Refs: #634 * feat: Added licences in recipe and test files Refs: #634 * feat: Removed NotNull annotations Refs: #634 * Update src/test/java/org/openrewrite/java/spring/InlineCommentSpringPropertiesTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/test/java/org/openrewrite/java/spring/InlineCommentSpringPropertiesTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/main/java/org/openrewrite/java/spring/InlineCommentSpringProperties.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/main/java/org/openrewrite/java/spring/InlineCommentSpringProperties.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/test/java/org/openrewrite/java/spring/InlineCommentSpringPropertiesTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: Removed doubled import Refs: #634 * feat: Generated comment recipes for deprecated properties without replacement Refs: #634 * feat: Updated comment recipes with the reason Refs: #634 * Update src/test/java/org/openrewrite/java/spring/internal/GeneratePropertiesMigratorConfiguration.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove unused import in GeneratePropertiesMigratorConfiguration * Update assertions to ensure yaml comments are modeled as such * fixing SpringFoxToSpringDoc to use 1.x-appropriate springdoc artifact helps with #638 * ChangeSpringPropertyKey does not yet fully support glob * RenameBean Scanning Recipe Refactor (#630) * Refactored the RenameBean recipe into a scanning recipe to allow renaming usages that occur outside the file where the bean is defined. * Add missing language hints * Remove unused `fromDeclaration` methods --------- Co-authored-by: Hudson, Ryan <[email protected]> Co-authored-by: Tim te Beek <[email protected]> * Add MigrateSpringdocCommon recipe (#633) * Add MigrateSpringdocCommon recipe * Apply suggestions from bot Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix syntax messed up by bot * Add MigrateSpringdocCommon recipe * Apply suggestions from bot Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix syntax messed up by bot * Fix build fail on SpringBoot_1_5 * Fix rebase error * Move to Spring Boot 2.6 tests, to match inclusion in `spring-boot-26.yml` --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tim te Beek <[email protected]> * Add ChangeMethodParameter for modify parameters in Spring Batch method declaration (#631) * Add ChangeMethodParameter for modify parameters in method declaration Signed-off-by: Kun Chang <[email protected]> * Minor polish * Add correct year * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add UpgradeSkipPolicyParameterType for Spring Batch Signed-off-by: Kun Chang <[email protected]> * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix tests * Also show ability to change interface methods --------- Signed-off-by: Kun Chang <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Reuse recipe that comments out Yaml properties * Move try into getDeprecations * Limit comment wrangling to `CommentOutSpringPropertyKey` * Rename test to match renamed class * Generate removed property migrations * Regenerated properties for older Spring Boot version * Fix invalid property values --------- Signed-off-by: Kun Chang <[email protected]> Co-authored-by: Sam Snyder <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: Shannon Pamperl <[email protected]> Co-authored-by: Moderne <[email protected]> Co-authored-by: Adrien Loison <[email protected]> Co-authored-by: Andrei Shakirin <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Nick McKinney <[email protected]> Co-authored-by: Ryan Hudson <[email protected]> Co-authored-by: Hudson, Ryan <[email protected]> Co-authored-by: SiBorea <[email protected]> Co-authored-by: Curtis <[email protected]> Co-authored-by: Tim te Beek <[email protected]>
@timtebeek Thanks a lot! |
@timtebeek as we discussed, I put the new PR here, also I simplified the logic to only allow change parameter type.
please take a look at this if you are available, thanks a lot.
What's changed?
Add a
ChangeMethodParameter
recipe for modify parameters in method declaration.For now we have AddMethodParameter which is for add new parameter in method declaration, but didn't have the one to modify current parameters.
What's your motivation?
I want to find any recipe in java can replace a parameter's type, for example:
but currently we don't have. So I try to add this new recipe.
Checklist