Closed timtebeek closed 7 months ago
Also discussed here. In short I tried to run org.openrewrite.java.migrate.lombok.LombokValToFinalVar on https://public.moderne.io/organizations/spinnaker/fiat/master, as that uses lombok.val 8 times, while using Java 11 & Gradle. Same goes for https://public.moderne.io/organizations/apache/isis-app-demo/main, which uses lombok.val 3 times, also on Java 11 but built with Maven. Neither produced any changes when running the recipe through Moderne, even though the find-type recipe does locate the usage of lombok.val.
org.openrewrite.java.migrate.lombok.LombokValToFinalVar
lombok.val
When running the recipe directly through Maven on isis-app-demo I do see some changes locally, even before https://github.com/openrewrite/rewrite-migrate-java/commit/8b2ed720a9885b41129ac6314771368508ca41b3.
isis-app-demo
mvn -U org.openrewrite.maven:rewrite-maven-plugin:4.33.0:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:1.10.0-SNAPSHOT -DactiveRecipes=org.openrewrite.java.migrate.lombok.LombokValToFinalVar
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java index 0f16c8e..9b8ca09 100644 --- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java +++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java @@ -91,7 +91,7 @@ public static PetOwner withName(String name) { } public static PetOwner withName(String lastName, String firstName) { - val simpleObject = new PetOwner(); + final var simpleObject = new PetOwner(); simpleObject.setLastName(lastName); simpleObject.setFirstName(firstName); return simpleObject;
The import is not removed however.
There's a more recent run by @jkschneider , which does now show some changes, but again does not remove the import yet.
Retested: now works.
Also discussed here. In short I tried to run
org.openrewrite.java.migrate.lombok.LombokValToFinalVar
on https://public.moderne.io/organizations/spinnaker/fiat/master, as that uses lombok.val 8 times, while using Java 11 & Gradle. Same goes for https://public.moderne.io/organizations/apache/isis-app-demo/main, which useslombok.val
3 times, also on Java 11 but built with Maven. Neither produced any changes when running the recipe through Moderne, even though the find-type recipe does locate the usage of lombok.val.When running the recipe directly through Maven on
isis-app-demo
I do see some changes locally, even before https://github.com/openrewrite/rewrite-migrate-java/commit/8b2ed720a9885b41129ac6314771368508ca41b3.The import is not removed however.
There's a more recent run by @jkschneider , which does now show some changes, but again does not remove the import yet.