spring-boot-migrator icon indicating copy to clipboard operation
spring-boot-migrator copied to clipboard

org.springframework.sbm.jee.jaxrs.recipes.ReplaceMediaTypeTest throws UnsupportedOperationException

Open fabapp2 opened this issue 3 years ago • 0 comments

Describe the bug When running ReplaceMediaTypeTest two UnsupportedOperationException are thrown

To Reproduce Run the test and check the log

Expected behavior

Screenshots

Stacktrace

[INFO] Running org.springframework.sbm.jee.jaxrs.recipes.ReplaceMediaTypeTest
21:02:39.850 [ForkJoinPool-1-worker-19] ERROR o.s.s.o.RewriteExecutionContext - Exception occured!
java.lang.UnsupportedOperationException: To change the return type of this new class, use withConstructorType(..)
        at org.openrewrite.java.tree.J$NewClass.withType(J.java:3732)
        at org.springframework.sbm.jee.jaxrs.recipes.ReplaceMediaType.lambda$new$5(ReplaceMediaType.java:147)
        at org.springframework.sbm.java.migration.recipes.RewriteConstructorInvocation$1.visitNewClass(RewriteConstructorInvocation.java:52)
        at org.springframework.sbm.java.migration.recipes.RewriteConstructorInvocation$1.visitNewClass(RewriteConstructorInvocation.java:45)
        at org.openrewrite.java.tree.J$NewClass.acceptJava(J.java:3737)
        at org.openrewrite.java.tree.J.accept(J.java:53)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:207)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:281)
        at org.openrewrite.java.JavaVisitor.visitReturn(JavaVisitor.java:1006)
        at org.openrewrite.java.tree.J$Return.acceptJava(J.java:4174)
        at org.openrewrite.java.tree.J.accept(J.java:53)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:207)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:281)
        at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1224)
        at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:362)
        at org.openrewrite.internal.ListUtils.lambda$map$0(ListUtils.java:138)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:120)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:138)
        at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:361)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:720)
        at org.openrewrite.java.tree.J.accept(J.java:53)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:207)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:281)
        at org.openrewrite.java.JavaVisitor.visitMethodDeclaration(JavaVisitor.java:804)
        at org.openrewrite.java.tree.J$MethodDeclaration.acceptJava(J.java:3026)
        at org.openrewrite.java.tree.J.accept(J.java:53)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:207)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:281)
        at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1224)
        at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:362)
        at org.openrewrite.internal.ListUtils.lambda$map$0(ListUtils.java:138)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:120)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:138)
        at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:361)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:720)
        at org.openrewrite.java.tree.J.accept(J.java:53)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:207)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:281)
        at org.openrewrite.java.JavaVisitor.visitClassDeclaration(JavaVisitor.java:442)
        at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:992)
        at org.openrewrite.java.tree.J.accept(J.java:53)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:207)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:281)
        at org.openrewrite.java.JavaVisitor.lambda$visitCompilationUnit$10(JavaVisitor.java:461)
        at org.openrewrite.internal.ListUtils.lambda$map$0(ListUtils.java:138)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:120)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:138)
        at org.openrewrite.java.JavaVisitor.visitCompilationUnit(JavaVisitor.java:461)
        at org.openrewrite.java.JavaVisitor.visitJavaSourceFile(JavaVisitor.java:449)
        at org.openrewrite.java.tree.J$CompilationUnit.acceptJava(J.java:1216)
        at org.openrewrite.java.tree.J.accept(J.java:53)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:207)
        at org.openrewrite.RecipeScheduler.lambda$scheduleVisit$5(RecipeScheduler.java:243)
        at org.openrewrite.RecipeScheduler.lambda$mapAsync$0(RecipeScheduler.java:50)
        at org.openrewrite.scheduling.ForkJoinScheduler.lambda$schedule$0(ForkJoinScheduler.java:41)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Desktop (please complete the following information): 0.11.2

fabapp2 avatar Jun 20 '22 19:06 fabapp2