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

MigrateRequestMappingOnFeignClient will not take effect when the @RequestMapping configuration is a string with only one value. #666

Closed
BingyanL9 opened this issue Jan 15, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@BingyanL9
Copy link

What version of OpenRewrite are you using?

I am using

  • OpenRewrite v5.47.3
  • Maven plugin v3.8.1
  • rewrite-module v6.0.0

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a single module project.

            <plugin>
                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <version>5.47.3</version>
                <configuration>
                    <activeRecipes>
                        <!--   中间件团队提供的  -->
<!--                        <recipe>org.openrewrite.java.migrate.MXBeanRule</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.UseJavaUtilBase64</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.javax.AddJaxbDependencies</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.javax.AddJaxwsDependencies</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.javax.AddInjectDependencies</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.javax.AddCommonAnnotationsDependencies</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.lombok.UpdateLombokToJava11</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.cobertura.RemoveCoberturaMavenPlugin</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.InternalBindPackages</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedSecurityManagerMethods</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.UpgradePluginsForJava11</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedPolicy</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.ReferenceCloneMethod</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.ThreadStopDestroy</recipe>-->
<!--                        <recipe>org.openrewrite.scala.migrate.UpgradeScala_2_12</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.ArrayStoreExceptionToTypeNotPresentException</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.IllegalArgumentExceptionToAlreadyConnectedException</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedRuntimeTraceMethods</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedToolProviderConstructor</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedModifierAndConstantBootstrapsConstructors</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.lang.StringFormatted</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.DeprecatedJavaxSecurityCert</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.DeprecatedLogRecordThreadID</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedLegacySunJSSEProviderName</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.Jre17AgentMainPreMainPublic</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.DeprecatedCountStackFramesMethod</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedZipFinalizeMethods</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedSSLSessionGetPeerCertificateChainMethodImpl</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.SunNetSslPackageUnavailable</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedRMIConnectorServerCredentialTypesConstant</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedFileIOFinalizeMethods</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.UpgradePluginsForJava17</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.AddLombokMapstructBinding</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemoveIllegalSemicolons</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.lang.ThreadStopUnsupported</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.net.URLConstructorsToURIRecipes</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.util.UseLocaleOf</recipe>-->
<!--                        <recipe>org.openrewrite.staticanalysis.ReplaceDeprecatedRuntimeExecMethods</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.UpgradePluginsForJava21</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.DeleteDeprecatedFinalize</recipe>-->
<!--                        <recipe>org.openrewrite.java.migrate.RemovedSubjectMethods</recipe>-->
<!--&lt;!&ndash;                        &lt;!&ndash;   中间件团队提供的  &ndash;&gt;&ndash;&gt;-->
                        <!--   迁移Junit4 ->  Junit5 -->
<!--                        <recipe>org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3</recipe>-->
                        <recipe>org.openrewrite.java.spring.cloud2022.UpgradeSpringCloud_2022</recipe>
                        <recipe>org.openrewrite.java.spring.cloud2022.MigrateRequestMappingOnFeignClient</recipe>
                        <!--   迁移Junit4 ->  Junit5 -->
                        <!--   迁移spring boot -->
<!--                        <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe>-->
                        <!--   迁移spring boot -->
                        <!--   迁移swagger to openapi-->
<!--                        <recipe>org.openrewrite.openapi.swagger.SwaggerToOpenAPI</recipe>-->

                        <!--   迁移swagger to openapi -->
<!--                        <recipe>org.openrewrite.java.logging.slf4j.ParameterizedLogging</recipe>-->

                        <!--   迁移http4 to http5 -->
<!--                        <recipe>org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.MigrateAuthScope</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.MigrateRequestConfig</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.NewStatusLine</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.StatusLine</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_DeprecatedMethods</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_TimeUnit</recipe>-->
<!--                        <recipe>org.openrewrite.apache.httpclient5.UsernamePasswordCredentials</recipe>-->
                    </activeRecipes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-migrate-java</artifactId>
                        <version>RELEASE</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-testing-frameworks</artifactId>
                        <version>2.24.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-spring</artifactId>
                        <version>6.0.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-openapi</artifactId>
                        <version>0.11.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-logging-frameworks</artifactId>
                        <version>2.18.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-apache</artifactId>
                        <version>1.10.0</version>
                    </dependency>
                </dependencies>
            </plugin>

What is the smallest, simplest way to reproduce the problem?

@FeignClient(name = "xxx", url = "xxx")
@RequestMapping({"/platform/promoteProduct"})

What did you expect to see?

@FeignClient(name = "xxx", url = "xxx", path="/platform/promoteProduct")
@BingyanL9 BingyanL9 added the bug Something isn't working label Jan 15, 2025
@timtebeek timtebeek self-assigned this Jan 15, 2025
@timtebeek
Copy link
Contributor

Thanks for the report @BingyanL9 ! Should be fixed with 58357dd
Do note that this assumes a single path element; we would need to structure the recipe if more than one path element is provided and to be migrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants