openrewrite / rewrite-kotlin

Work-in-progress implementation of Kotlin language support for OpenRewrite.
Apache License 2.0
38 stars 11 forks source link

java.lang.StackOverflowError when using MethodMatcher #602

Open yanlin-yc opened 1 month ago

yanlin-yc commented 1 month ago

What version of OpenRewrite are you using?

I am using

How are you running OpenRewrite?

This happened when running the unit test for writing a new recipe.

I noticed the issue is reproducible when setting the matchOverrides flag to true for the MethodMatcher and also calling super.visitMethodInvocation at the same time when overriding visitMethodInvocationin the custom visitor.

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

import org.junit.jupiter.api.Test
import org.openrewrite.ExecutionContext
import org.openrewrite.java.MethodMatcher
import org.openrewrite.java.tree.J
import org.openrewrite.test.RewriteTest.toRecipe
import org.openrewrite.kotlin.Assertions.kotlin
import org.openrewrite.kotlin.KotlinIsoVisitor
import org.openrewrite.marker.SearchResult
import org.openrewrite.test.RewriteTest

class StackOverflowTest : RewriteTest {
    @Test
    fun `raises StackOverflowError`() = rewriteRun(
        { spec ->
            spec.recipe(
                toRecipe { _ ->
                    object : KotlinIsoVisitor<ExecutionContext>() {
                        override fun visitMethodInvocation(
                            method: J.MethodInvocation,
                            p: ExecutionContext
                        ): J.MethodInvocation {
                            val m = super.visitMethodInvocation(method, p)
                            return if (MethodMatcher("com.example.Foo *()", true).matches(method)) {
                                SearchResult.found(m)
                            } else {
                                m
                            }
                        }
                    }

                }
            )
        },
        kotlin(
            """
                package com.example

                import kotlin.random.Random

                class Foo {
                    fun foo(): Int { return 50 }
                }

                class Bar {
                    fun bar(): Boolean {
                        Foo().foo().let {
                            return Random.nextInt(0, 100) < it
                        }
                    }
                }
            """.trimIndent()
        )
    )
}

What did you expect to see?

Code is parsed and test should be running.

What did you see instead?

Test run failed.

What is the full stack trace of any errors you encountered?

java.lang.AssertionError: Failed to parse sources or run recipe

    at org.openrewrite.test.RewriteTest.lambda$defaultExecutionContext$10(RewriteTest.java:588)
    at org.openrewrite.RecipeScheduler$RecipeRunCycle.handleError(RecipeScheduler.java:308)
    at org.openrewrite.RecipeScheduler$RecipeRunCycle.lambda$editSources$4(RecipeScheduler.java:250)
    at org.openrewrite.RecipeScheduler$RecipeRunCycle.lambda$mapForRecipeRecursively$5(RecipeScheduler.java:334)
    at org.openrewrite.internal.InMemoryLargeSourceSet.lambda$edit$0(InMemoryLargeSourceSet.java:62)
    at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
    at org.openrewrite.internal.InMemoryLargeSourceSet.edit(InMemoryLargeSourceSet.java:61)
    at org.openrewrite.RecipeScheduler$RecipeRunCycle.mapForRecipeRecursively(RecipeScheduler.java:327)
    at org.openrewrite.RecipeScheduler$RecipeRunCycle.editSources(RecipeScheduler.java:200)
    at org.openrewrite.RecipeScheduler.scheduleRun(RecipeScheduler.java:76)
    at org.openrewrite.Recipe.run(Recipe.java:281)
    at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:344)
    at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:132)
    at com.airbnb.viaduct.rewriterecipes.StackOverflowTest.raises StackOverflowError(StackOverflowTest.kt:15)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
Caused by: org.openrewrite.internal.RecipeRunException: java.lang.StackOverflowError
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:329)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitBinary(JavaVisitor.java:367)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBinary(KotlinIsoVisitor.java:178)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBinary(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$Binary.acceptJava(J.java:640)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitReturn(JavaVisitor.java:1067)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitReturn(KotlinIsoVisitor.java:365)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitReturn(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$Return.acceptJava(J.java:4830)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.kotlin.KotlinVisitor.visitKReturn(KotlinVisitor.java:192)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitKReturn(KotlinIsoVisitor.java:72)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitKReturn(KotlinIsoVisitor.java:23)
    at org.openrewrite.kotlin.tree.K$KReturn.acceptKotlin(K.java:1314)
    at org.openrewrite.kotlin.tree.K.accept(K.java:58)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1340)
    at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:386)
    at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
    at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:385)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBlock(KotlinIsoVisitor.java:183)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBlock(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$Block.acceptJava(J.java:767)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitLambda(JavaVisitor.java:786)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitLambda(KotlinIsoVisitor.java:299)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitLambda(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$Lambda.acceptJava(J.java:3126)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1340)
    at org.openrewrite.java.JavaVisitor.lambda$visitContainer$36(JavaVisitor.java:1393)
    at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
    at org.openrewrite.java.JavaVisitor.visitContainer(JavaVisitor.java:1393)
    at org.openrewrite.java.JavaVisitor.visitMethodInvocation(JavaVisitor.java:907)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitMethodInvocation(KotlinIsoVisitor.java:319)
    at com.airbnb.viaduct.rewriterecipes.StackOverflowTest$raises StackOverflowError$1$1$1.visitMethodInvocation(StackOverflowTest.kt:24)
    at com.airbnb.viaduct.rewriterecipes.StackOverflowTest$raises StackOverflowError$1$1$1.visitMethodInvocation(StackOverflowTest.kt:19)
    at org.openrewrite.java.tree.J$MethodInvocation.acceptJava(J.java:3850)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1340)
    at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:386)
    at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
    at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:385)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBlock(KotlinIsoVisitor.java:183)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBlock(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$Block.acceptJava(J.java:767)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitMethodDeclaration(JavaVisitor.java:868)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitMethodDeclaration(KotlinIsoVisitor.java:314)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitMethodDeclaration(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$MethodDeclaration.acceptJava(J.java:3594)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1340)
    at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:386)
    at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
    at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:385)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBlock(KotlinIsoVisitor.java:183)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitBlock(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$Block.acceptJava(J.java:767)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.java.JavaVisitor.visitClassDeclaration(JavaVisitor.java:473)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitClassDeclaration(KotlinIsoVisitor.java:203)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitClassDeclaration(KotlinIsoVisitor.java:23)
    at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1219)
    at org.openrewrite.java.tree.J.accept(J.java:59)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:361)
    at org.openrewrite.kotlin.KotlinVisitor.lambda$visitCompilationUnit$2(KotlinVisitor.java:60)
    at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
    at org.openrewrite.kotlin.KotlinVisitor.visitCompilationUnit(KotlinVisitor.java:59)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitCompilationUnit(KotlinIsoVisitor.java:27)
    at org.openrewrite.kotlin.KotlinIsoVisitor.visitCompilationUnit(KotlinIsoVisitor.java:23)
    at org.openrewrite.kotlin.tree.K$CompilationUnit.acceptKotlin(K.java:266)
    at org.openrewrite.kotlin.tree.K.accept(K.java:58)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
    at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:184)
    at org.openrewrite.RecipeScheduler$RecipeRunCycle.lambda$editSources$3(RecipeScheduler.java:230)
    at io.micrometer.core.instrument.AbstractTimer.recordCallable(AbstractTimer.java:138)
    at org.openrewrite.table.RecipeRunStats.recordEdit(RecipeRunStats.java:68)
    at org.openrewrite.RecipeScheduler$RecipeRunCycle.lambda$editSources$4(RecipeScheduler.java:227)
    ... 81 more
Caused by: java.lang.StackOverflowError
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:160)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:165)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)
    at org.openrewrite.java.tree.TypeUtils.isOfTypeWithName(TypeUtils.java:169)

Are you interested in contributing a fix to OpenRewrite?

timtebeek commented 1 month ago

Thanks for the report @yanlin-yc ! Especially appreciate you writing a test to reproduce the issue. Did you use a debugger to see if you could pinpoint the cause of the issue as well? As much as we'd like to get to everything, any help towards a fix would be appreciated too if at all possible there.