Closed radoslaw-panuszewski closed 5 months ago
Hi @radoslaw-panuszewski, thank you for the PR!
I've seen a similar issue before between 1.8.0
and 1.9.0
, but haven't been able to reproduce the problem. Do you have a public project where the error occurs so that I can take a look?
My concern is that updating to 1.9.20
might cause incompatibility with 1.9.0
. If so, we'll need multiple versions of the KotlinParser instead of bumping the version up to 1.9.20
.
Hi @radoslaw-panuszewski, thank you for the PR!
I've seen a similar issue before between
1.8.0
and1.9.0
, but haven't been able to reproduce the problem. Do you have a public project where the error occurs so that I can take a look?My concern is that updating to
1.9.20
might cause incompatibility with1.9.0
. If so, we'll need multiple versions of the KotlinParser instead of bumping the version up to1.9.20
.
Hi @traceyyoshima, I realized what was the problem in my configuration. Accidentally, the Gradle build with my custom recipe applied the spring-boot-dependencies
like this:
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.2.0"))
so after adding it to the rewrite
configuration:
rewrite("com.example.my-custom-recipe")
the platform dependency for spring-boot-dependencies
was transitively resolved and it constrained version of the kotlin-compiler-embeddable
to 1.9.20
.
After removing the platform dependency, the NoSuchMethodException
is no longer thrown. The kotlin-stdlib
is still in version 1.9.20
(because my recipe is written in Kotlin) but the kotlin-compiler-embeddable
is at 1.9.0
(because rewrite-kotlin
brings it transitively). It also works in the opposite way: rewrite-kotlin
built with Kotlin 1.9.20
can be applied for project using Kotlin 1.9.0
.
To conclude: my problem is already solved, but since I already opened this PR, maybe we can just merge it? 😉
@traceyyoshima @kunli2 @knutwannheden please take a look :)
What's changed?
1.9.22
rewrite-java
updated to the newest snapshot (8.13.0-SNAPSHOT
)What's your motivation?
Between Kotlin
1.9.0
and1.9.10
the signature ofFirSessionFactoryHelper.createSessionWithDependencies
method was changed. In our projects we use the newest Kotlin and./gradlew rewriteRun
fails withNoSuchMethodError
.Anything in particular you'd like reviewers to focus on?
According to the test case
AnnotationTest.arrayOfCallWithInAnnotation
theFirArrayOfCall
was replaced withFirArrayLiteral
. Do you think any additional handling is needed for that?Additional context
My local build resolved the snapshot dependency of
rewrite-java
so I fixed the compilation errors. Should I do that? I assumerewrite-kotlin
andrewrite-java
will be released together, right?Checklist
I've added unit tests to cover both positive and negative casesI've read and applied the recipe conventions and best practices