What version of OpenRewrite are you using?
I am using
- OpenRewrite v8.16.1
- Maven plugin v6.25.0
- rewrite-recipe-bom 3.20.0
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project. I’m performing the Spring Boot 3.5 upgrade.
What is the smallest, simplest way to reproduce the problem?
class A {
Set<DayOfWeek> days = Set.of();
}
What did you expect to see?
The code should stay unchanged.
What did you see instead?
The code becomes
class A {
Set<DayOfWeek> days = EnumSet.noneOf(DayOfWeek.class);
}
I had declared an immutable Set, and now it became mutable. Moreover the benefit of the code change is debatable: less readable, and most likely without performance benefit (especially for the empty set).
Since this recipe implements an opinionated choice, it shouldn’t be executed as part of Spring Boot upgrades nor Java upgrades.
What is the full stack trace of any errors you encountered?
[WARNING] Changes have been made to src\main\java\…\A.java by:
[WARNING] org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5
[WARNING] org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4
[WARNING] org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3
[WARNING] org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2
[WARNING] org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1
[WARNING] org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0
[WARNING] org.openrewrite.java.migrate.UpgradeToJava17
[WARNING] org.openrewrite.java.migrate.Java8toJava11
[WARNING] org.openrewrite.java.migrate.UpgradeToJava8
[WARNING] org.openrewrite.java.migrate.UpgradeToJava7
[WARNING] org.openrewrite.java.migrate.UpgradeToJava6
[WARNING] org.openrewrite.java.migrate.util.UseEnumSetOf
I could remove the recipe from UpgradeToJava6. It seems this change was introduced in e18534b mid-October by @timtebeek.
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project. I’m performing the Spring Boot 3.5 upgrade.
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
The code should stay unchanged.
What did you see instead?
The code becomes
I had declared an immutable
Set, and now it became mutable. Moreover the benefit of the code change is debatable: less readable, and most likely without performance benefit (especially for the empty set).Since this recipe implements an opinionated choice, it shouldn’t be executed as part of Spring Boot upgrades nor Java upgrades.
What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?
I could remove the recipe from
UpgradeToJava6. It seems this change was introduced in e18534b mid-October by @timtebeek.