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

Backwards-incompatible change to ListUtils.map() breaks gradle plugin #4730

Closed
centic9 opened this issue Nov 28, 2024 · 3 comments
Closed

Backwards-incompatible change to ListUtils.map() breaks gradle plugin #4730

centic9 opened this issue Nov 28, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@centic9
Copy link

centic9 commented Nov 28, 2024

It seems the change to ListUtils.map() at f4ca982 breaks the Gradle plugin.

When trying to apply JUnit4to5Migration it fails with an exception, see details below.

According to https://github.com/openrewrite/rewrite-gradle-plugin/blob/main/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java#L1392 the Gradle plugin is still trying to use the old version of "map()".

What version of OpenRewrite are you using?

Gradle-plugin: id 'org.openrewrite.rewrite' version '6.27.1'
Dependency: rewrite("org.openrewrite.recipe:rewrite-testing-frameworks:2.23.0")
Gradle: 8.5

How are you running OpenRewrite?

Via a simple Gradle project

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

The following Gradle file triggers the problem for me

plugins {
	id 'org.openrewrite.rewrite' version '6.27.1'
}

apply plugin: 'java'

repositories {
	mavenCentral()
}

dependencies {
	testImplementation 'org.junit.vintage:junit-vintage-engine:5.11.3'
	testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
	testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'

	rewrite("org.openrewrite.recipe:rewrite-testing-frameworks:2.23.0")
}

rewrite {
	// https://docs.openrewrite.org/recipes/java/testing/junit5/junit4to5migration
	activeRecipe("org.openrewrite.java.testing.junit5.JUnit4to5Migration")
	setExportDatatables(true)
}

What did you expect to see?

I expect Gradle task rewriteRun to be executed successfully

What did you see instead?

Error: NoSuchMethodError: 'java.util.List org.openrewrite.internal.ListUtils.map(java.util.List,

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

Caused by: java.lang.NoSuchMethodError: 'java.util.List org.openrewrite.internal.ListUtils.map(java.util.List, java.util.function.UnaryOperator)'
        at org.openrewrite.gradle.isolated.DefaultProjectParser.listResults(DefaultProjectParser.java:1392)
        at org.openrewrite.gradle.isolated.DefaultProjectParser.run(DefaultProjectParser.java:420)
        at org.openrewrite.gradle.DelegatingProjectParser.lambda$run$2(DelegatingProjectParser.java:115)
        at org.openrewrite.gradle.DelegatingProjectParser.unwrapInvocationException(DelegatingProjectParser.java:164)
        at org.openrewrite.gradle.DelegatingProjectParser.run(DelegatingProjectParser.java:114)
        at org.openrewrite.gradle.RewriteRunTask.run(RewriteRunTask.java:36)

Are you interested in contributing a fix to OpenRewrite?

likely can't invest enough time here for now

@centic9 centic9 added the bug Something isn't working label Nov 28, 2024
@centic9
Copy link
Author

centic9 commented Nov 28, 2024

Downgrading to rewrite("org.openrewrite.recipe:rewrite-testing-frameworks:2.22.0") makes it work again.

@timtebeek
Copy link
Contributor

hi! Yes pinning back works, or recompiling your recipe jars. We're considering a roll back; you can follow along here:

@timtebeek timtebeek moved this to In Progress in OpenRewrite Nov 28, 2024
@timtebeek timtebeek self-assigned this Nov 28, 2024
@timtebeek
Copy link
Contributor

Fixed in https://github.com/openrewrite/rewrite-recipe-bom/releases/tag/v2.23.1
Thanks again for the prompt warning!

@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Nov 28, 2024
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