8.80.0 release (2026-04-21)
Total recipe count: 4332
info
This changelog only shows what recipes have been added, removed, or changed. OpenRewrite may do releases that do not include these types of changes. To see these changes, please go to the releases page.
New Recipes
- org.openrewrite.FindStyles: Find and report the styles attached to each source file. Styles are output as valid OpenRewrite style YAML that can be used directly in rewrite.yml configuration.
- org.openrewrite.apache.commons.PreferJavaStandardLibrary: Prefer the Java standard library instead of Apache Commons. These recipes replace various Apache Commons utilities with their JDK equivalents, where available in Java 11+.
- org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes$ReadFileToStringWithCharsetRecipe: Replace deprecated
FileUtils.readFileToString(File)withFileUtils.readFileToString(File, StandardCharsets.UTF_8). - org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes$ReadLinesWithCharsetRecipe: Replace deprecated
FileUtils.readLines(File)withFileUtils.readLines(File, StandardCharsets.UTF_8). - org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes$WriteAppendWithCharsetRecipe: Replace deprecated
FileUtils.write(File, CharSequence, boolean)withFileUtils.write(File, CharSequence, StandardCharsets.UTF_8, boolean). - org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes$WriteStringToFileAppendWithCharsetRecipe: Replace deprecated
FileUtils.writeStringToFile(File, String, boolean)withFileUtils.writeStringToFile(File, String, StandardCharsets.UTF_8, boolean). - org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes$WriteWithCharsetRecipe: Replace deprecated
FileUtils.write(File, CharSequence)withFileUtils.write(File, CharSequence, StandardCharsets.UTF_8, false). - org.openrewrite.github.GitHubActionsBestPractices: Applies best practices to GitHub Actions workflows, including enabling dependency caching, using cached distributions, finding missing timeouts, removing unused inputs, and preferring block-style job dependencies.
- org.openrewrite.github.PreferBlockStyleJobDependencies: Convert flow-style
needssequences (e.g.needs: [dep1, dep2]) to block-style in GitHub Actions workflow jobs when a job depends on more than one other job. Block style improves readability and produces cleaner diffs in source control. - org.openrewrite.hibernate.MigrateDialect: Migrate all Hibernate version-specific dialect classes to their generic equivalents. Version-specific dialects were deprecated in Hibernate 6.0 and removed in Hibernate 6.2.
- org.openrewrite.java.jackson.UpgradeJackson_2_3_ObjectNodeMethodRenames: Rename ObjectNode methods deprecated in Jackson 2 and removed in 3.x (
put(String, JsonNode)toset,putAlltosetAll). - org.openrewrite.java.migrate.AddSurefireFailsafeArgLine: Adds the specified arguments to the
argLineconfiguration of the Maven Surefire and Failsafe plugins, merging with any existing argLine value without duplicating arguments. - org.openrewrite.java.migrate.AddSurefireFailsafeArgLineForMockito: Adds
--add-opensJVM arguments required by Mockito and ByteBuddy to the Maven Surefire and Failsafe pluginargLineconfiguration. Only applied when the project depends on Mockito. - org.openrewrite.java.migrate.UpgradeBuildToJava25ForKotlin: Upgrades build files to Java 25 for Kotlin modules already on Kotlin 2.3 or later.
- org.openrewrite.java.migrate.guava.NoGuavaImmutableListCopyOf: Replaces
.common.collect.ImmutableList.copyOf(..)if the returned type is immediately down-cast. - org.openrewrite.java.migrate.guava.NoGuavaImmutableMapCopyOf: Replaces
.common.collect.ImmutableMap.copyOf(..)if the returned type is immediately down-cast. - org.openrewrite.java.migrate.guava.NoGuavaImmutableSetCopyOf: Replaces
.common.collect.ImmutableSet.copyOf(..)if the returned type is immediately down-cast. - org.openrewrite.java.migrate.lang.RenameUnderscoreIdentifier: Renames single-underscore identifiers to double-underscore in Java source files with source compatibility of Java 8 or below. In Java 9+,
_is a reserved keyword and causes a compile error. - org.openrewrite.java.migrate.search.ModuleHasKotlinSource: Marks all files in modules that contain at least one Kotlin source file (
.kt). Intended as a precondition to scope recipes to projects that actually compile Kotlin, as opposed to projects that merely pick upkotlin-stdlibtransitively. - org.openrewrite.java.spring.boot2.AddSpringBootStarterValidation: Add
spring-boot-starter-validationwhen validation constraints are used, unless the project already declares an explicit validation API dependency. - org.openrewrite.java.spring.boot3.RenameLogbackToLogbackSpring: Spring Boot only processes Spring-specific logback extensions (
<springProfile>,<springProperty>) when the configuration file is namedlogback-spring.xml. A plainlogback.xmlis loaded too early by logback itself, before Spring'sEnvironmentis ready, so these extensions are silently ignored. This recipe renameslogback.xmltologback-spring.xmlwhen Spring extensions are detected. - org.openrewrite.java.testing.junit5.UpdateMockWebServerDispatcher: In mockwebserver3 5.x,
Dispatcher.dispatch()returnsMockResponse, notMockResponse.Builder. Pre-pin the return type tomockwebserver3.MockResponseand wrap return expressions with.build(), so the subsequent blanketMockResponse→Buildertype change leavesdispatch()alone. - org.openrewrite.java.testing.mockito.AddMockitoSettingsWithWarnStrictness: Adds
@MockitoSettings(strictness = Strictness.WARN)to test classes that have@ExtendWith(MockitoExtension.class)but do not already have a@MockitoSettingsannotation. This preserves the lenient stubbing behavior from Mockito 1.x/2.x migrations and preventsUnnecessaryStubbingExceptionfrom strict stubbing defaults. - org.openrewrite.java.testing.mockito.AddMockitoSettingsWithWarnStrictnessForLegacyMockito: Adds
@MockitoSettings(strictness = Strictness.WARN)to test classes annotated with@ExtendWith(MockitoExtension.class)only when the module depends on a pre-3.0 version of Mockito. This preserves the lenient stubbing behavior from Mockito 1.x/2.x and preventsUnnecessaryStubbingExceptionerrors once MockitoExtension's strict stubbing default kicks in. - org.openrewrite.java.testing.testcontainers.MigrateToKafkaNative: Replace
confluentinc/cp-kafkawith the much fasterapache/kafka-nativeimage and migrate fromorg.testcontainers.containers.KafkaContainertoorg.testcontainers.kafka.KafkaContainer. - org.openrewrite.java.testing.testcontainers.ReplaceContainerImageName: Replace a Docker image name in
DockerImageName.parse(image)ornew DockerImageName(image)constructor arguments for a specific container class. - org.openrewrite.javascript.dependencies.remove-dependency: Removes a dependency from
package.jsonand updates the lock file by running the package manager. - org.openrewrite.quarkus.spring.ConfigurationPropertiesToConfigMapping: Converts Spring Boot @ConfigurationProperties classes to Quarkus @ConfigMapping interfaces. Changes the class to an interface, converts getter methods to interface method declarations, and removes fields, setters, and constructors.
- org.openrewrite.quarkus.spring.MongoRepositoryToPanacheMongoRepository: Transforms Spring Data
MongoRepository<T, ID>interfaces to QuarkusPanacheMongoRepository<T>, dropping the ID type parameter. - org.openrewrite.staticanalysis.RemoveMethodsOnlyCallSuper: Methods that override a parent method but only call
superwith the same arguments are redundant and should be removed. - org.openrewrite.staticanalysis.RemoveUnusedLabels: Remove labels that are not referenced by any
breakorcontinuestatement. - org.openrewrite.staticanalysis.SillyEqualsCheck: Detects
.equals()calls that compare incompatible types and will always returnfalse. Replaces.equals(null)with== nulland array.equals()withArrays.equals(). Flags comparisons between unrelated types or between arrays and non-arrays. - org.openrewrite.staticanalysis.SingleLineCommentSpacing: Ensures there is exactly one space after // in single-line comments when missing.
- org.openrewrite.staticanalysis.StaticAccessViaInstance: Accessing static fields or calling static methods on an instance reference is misleading. Static members should be accessed using the declaring class name instead.
- tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes$AssertThatContainsAllRecipe: Prefer
AbstractIterableAssert#containsAll(Iterable)over less explicit alternatives. - tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes$AssertThatContainsRecipe: Prefer
ObjectEnumerableAssert#contains(Object[])over less explicit alternatives. - tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes$AssertThatDoesNotContainRecipe: Prefer
ObjectEnumerableAssert#doesNotContain(Object[])over less explicit alternatives. - tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsAnyOfVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamContainsAnyOfVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsAnyOf")
IterableAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Iterable<T>> collector) {
return assertThat(stream.collect(collector)).containsAnyOf(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsAnyOf")
AbstractCollectionAssert<?, Collection<? extends T>, T, ObjectAssert<T>> before2(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Collection<T>> collector) {
return assertThat(stream.collect(collector)).containsAnyOf(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsAnyOf")
ListAssert<T> before3(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).containsAnyOf(Refaster.asVarargs(elements));
}
@AfterTemplate
@SuppressWarnings(value = "ObjectEnumerableContainsOneElement")
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).containsAnyOf(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsExactlyInAnyOrderVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamContainsExactlyInAnyOrderVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsExactlyInAnyOrder")
ListAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).containsExactlyInAnyOrder(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsExactlyInAnyOrder")
AbstractCollectionAssert<?, ?, T, ?> before2(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Multiset<T>> collector) {
return assertThat(stream.collect(collector)).containsExactlyInAnyOrder(Refaster.asVarargs(elements));
}
@AfterTemplate
@SuppressWarnings(value = "ObjectEnumerableContainsExactlyOneElement")
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).containsExactlyInAnyOrder(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsExactlyVarargsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamContainsExactlyVarargs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsExactly")
ListAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).containsExactly(Refaster.asVarargs(elements));
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).containsExactly(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsOnlyVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamContainsOnlyVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsOnly")
IterableAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Iterable<T>> collector) {
return assertThat(stream.collect(collector)).containsOnly(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsOnly")
AbstractCollectionAssert<?, Collection<? extends T>, T, ObjectAssert<T>> before2(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Collection<T>> collector) {
return assertThat(stream.collect(collector)).containsOnly(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsOnly")
ListAssert<T> before3(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).containsOnly(Refaster.asVarargs(elements));
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).containsOnly(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsSequenceVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamContainsSequenceVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsSequence")
ListAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).containsSequence(Refaster.asVarargs(elements));
}
@AfterTemplate
@SuppressWarnings(value = "ObjectEnumerableContainsOneElement")
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).containsSequence(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsSubsequenceVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamContainsSubsequenceVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContainsSubsequence")
ListAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).containsSubsequence(Refaster.asVarargs(elements));
}
@AfterTemplate
@SuppressWarnings(value = "ObjectEnumerableContainsOneElement")
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).containsSubsequence(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamContainsVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContains")
IterableAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Iterable<T>> collector) {
return assertThat(stream.collect(collector)).contains(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContains")
AbstractCollectionAssert<?, Collection<? extends T>, T, ObjectAssert<T>> before2(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Collection<T>> collector) {
return assertThat(stream.collect(collector)).contains(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamContains")
ListAssert<T> before3(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).contains(Refaster.asVarargs(elements));
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).contains(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamDoesNotContainSequenceVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamDoesNotContainSequenceVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamDoesNotContainSequence")
ListAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).doesNotContainSequence(Refaster.asVarargs(elements));
}
@AfterTemplate
@SuppressWarnings(value = "ObjectEnumerableDoesNotContainOneElement")
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).doesNotContainSequence(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamDoesNotContainVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamDoesNotContainVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamDoesNotContain")
IterableAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Iterable<T>> collector) {
return assertThat(stream.collect(collector)).doesNotContain(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamDoesNotContain")
AbstractCollectionAssert<?, Collection<? extends T>, T, ObjectAssert<T>> before2(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Collection<T>> collector) {
return assertThat(stream.collect(collector)).doesNotContain(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamDoesNotContain")
ListAssert<T> before3(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).doesNotContain(Refaster.asVarargs(elements));
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).doesNotContain(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamIsSubsetOfVarArgsRecipe: Recipe created for the following Refaster template:
static final class AssertThatStreamIsSubsetOfVarArgs<S, T extends S, U extends T> {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamIsSubsetOf")
IterableAssert<T> before(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Iterable<T>> collector) {
return assertThat(stream.collect(collector)).isSubsetOf(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamIsSubsetOf")
AbstractCollectionAssert<?, Collection<? extends T>, T, ObjectAssert<T>> before2(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends Collection<T>> collector) {
return assertThat(stream.collect(collector)).isSubsetOf(Refaster.asVarargs(elements));
}
@BeforeTemplate
@SuppressWarnings(value = "AssertThatStreamIsSubsetOf")
ListAssert<T> before3(Stream<S> stream, @Repeated
U elements, Collector<S, ?, ? extends List<T>> collector) {
return assertThat(stream.collect(collector)).isSubsetOf(Refaster.asVarargs(elements));
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
ListAssert<S> after(Stream<S> stream, @Repeated
U elements) {
return assertThat(stream).isSubsetOf(elements);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatIsBlankRecipe: Prefer
AbstractStringAssert#isBlank()over less explicit alternatives. - tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatIsEqualToIgnoringCaseRecipe: Prefer
AbstractStringAssert#isEqualToIgnoringCase(CharSequence)over less explicit alternatives. - tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatIsNotBlankRecipe: Prefer
AbstractStringAssert#isNotBlank()over less explicit alternatives. - tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatIsNotEqualToIgnoringCaseRecipe: Prefer
AbstractStringAssert#isNotEqualToIgnoringCase(CharSequence)over less explicit alternatives. - tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AbstractThrowableAssertHasMessageRecipe: Recipe created for the following Refaster template:
static final class AbstractThrowableAssertHasMessage {
@BeforeTemplate
AbstractThrowableAssert<?, ? extends Throwable> before(AbstractThrowableAssert<?, ? extends Throwable> abstractThrowableAssert, String message, @Repeated
Object parameters) {
return abstractThrowableAssert.hasMessage(message.formatted(parameters));
}
@AfterTemplate
AbstractThrowableAssert<?, ? extends Throwable> after(AbstractThrowableAssert<?, ? extends Throwable> abstractThrowableAssert, String message, @Repeated
Object parameters) {
return abstractThrowableAssert.hasMessage(message, parameters);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AbstractThrowableAssertWithFailMessageRecipe: Recipe created for the following Refaster template:
static final class AbstractThrowableAssertWithFailMessage {
@BeforeTemplate
AbstractThrowableAssert<?, ? extends Throwable> before(AbstractThrowableAssert<?, ? extends Throwable> abstractThrowableAssert, String message, @Repeated
Object args) {
return abstractThrowableAssert.withFailMessage(message.formatted(args));
}
@AfterTemplate
AbstractThrowableAssert<?, ? extends Throwable> after(AbstractThrowableAssert<?, ? extends Throwable> abstractThrowableAssert, String message, @Repeated
Object args) {
return abstractThrowableAssert.withFailMessage(message, args);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByHasMessageParametersRecipe: Recipe created for the following Refaster template:
static final class AssertThatThrownByHasMessageParameters {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatThrownByAsInstanceOfThrowable")
AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message, @Repeated
Object parameters) {
return assertThatExceptionOfType(exceptionType).isThrownBy(throwingCallable).withMessage(message, parameters);
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message, @Repeated
Object parameters) {
return assertThatThrownBy(throwingCallable).isInstanceOf(exceptionType).hasMessage(message, parameters);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIOExceptionHasMessageParametersRecipe: Recipe created for the following Refaster template:
static final class AssertThatThrownByIOExceptionHasMessageParameters {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatThrownByIOException")
AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatIOException().isThrownBy(throwingCallable).withMessage(message, parameters);
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatThrownBy(throwingCallable).isInstanceOf(IOException.class).hasMessage(message, parameters);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalArgumentExceptionHasMessageNotContainingAnyRecipe: Recipe created for the following Refaster template:
static final class AssertThatThrownByIllegalArgumentExceptionHasMessageNotContainingAny {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatThrownByIllegalArgumentException")
AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, @Repeated
CharSequence values) {
return assertThatIllegalArgumentException().isThrownBy(throwingCallable).withMessageNotContainingAny(values);
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, @Repeated
CharSequence values) {
return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalArgumentException.class).hasMessageNotContainingAny(values);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalArgumentExceptionHasMessageParametersRecipe: Recipe created for the following Refaster template:
static final class AssertThatThrownByIllegalArgumentExceptionHasMessageParameters {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatThrownByIllegalArgumentException")
AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatIllegalArgumentException().isThrownBy(throwingCallable).withMessage(message, parameters);
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalArgumentException.class).hasMessage(message, parameters);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalStateExceptionHasMessageParametersRecipe: Recipe created for the following Refaster template:
static final class AssertThatThrownByIllegalStateExceptionHasMessageParameters {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatThrownByIllegalStateException")
AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatIllegalStateException().isThrownBy(throwingCallable).withMessage(message, parameters);
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalStateException.class).hasMessage(message, parameters);
}
}
.
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByNullPointerExceptionHasMessageParametersRecipe: Recipe created for the following Refaster template:
static final class AssertThatThrownByNullPointerExceptionHasMessageParameters {
@BeforeTemplate
@SuppressWarnings(value = "AssertThatThrownByNullPointerException")
AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatNullPointerException().isThrownBy(throwingCallable).withMessage(message, parameters);
}
@AfterTemplate
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message, @Repeated
Object parameters) {
return assertThatThrownBy(throwingCallable).isInstanceOf(NullPointerException.class).hasMessage(message, parameters);
}
}
.
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionsDisjointRecipe: Prefer
Collections#disjoint(Collection, Collection)over non-JDK or less efficient alternatives. - tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$SetOfVarargsRecipe: Prefer
Set#of(Object[])over more contrived alternatives. - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$GreatestNaturalOrderRecipe: Prefer
Comparators#greatest(int, Comparator)withComparator#naturalOrder()over more contrived alternatives. - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$GreatestRecipe: Prefer
Comparators#greatest(int, Comparator)over more contrived alternatives. - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$LeastNaturalOrderRecipe: Prefer
Comparators#least(int, Comparator)withComparator#naturalOrder()over more contrived alternatives. - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$LeastRecipe: Prefer
Comparators#least(int, Comparator)over more contrived alternatives. - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$MaxOfVarargsRecipe: Avoid unnecessary creation of a
Streamto determine the maximum of a known collection of values. - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$MinOfVarargsRecipe: Avoid unnecessary creation of a
Streamto determine the minimum of a known collection of values. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderRecipe: Prefer
Files#newBufferedReader(Path)over more verbose or contrived alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderWithCharsetRecipe: Prefer
Files#newBufferedReader(Path, Charset)over more contrived alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewInputStreamPathOfRecipe: Prefer
Files#newInputStream(Path, OpenOption...)over less idiomatic alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewInputStreamToPathRecipe: Prefer
Files#newInputStream(Path, OpenOption...)over less idiomatic alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewOutputStreamPathOfRecipe: Prefer
Files#newOutputStream(Path, OpenOption...)over less idiomatic alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewOutputStreamToPathRecipe: Prefer
Files#newOutputStream(Path, OpenOption...)over less idiomatic alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$PathOfStringRecipe: Prefer the more idiomatic
Path#of(String, String...)overPaths#get(String, String...). - tech.picnic.errorprone.refasterrules.FileRulesRecipes$PathResolveSiblingPathRecipe: Prefer
Path#resolveSibling(Path)over more verbose alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$PathResolveSiblingStringRecipe: Prefer
Path#resolveSibling(String)over the more verbose alternatives. - tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSetVarArgsRecipe: Prefer
Sets#immutableEnumSet(Enum, Enum[])for enum collections to take advantage of the internally usedEnumSet. - tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListSortedCopyOfIteratorRecipe: Prefer
ImmutableList.sortedCopyOf(iterable).iterator()over less efficient alternatives. - tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListSortedCopyOfIteratorWithComparatorRecipe: Prefer
ImmutableList.sortedCopyOf(cmp, iterable).iterator()over less efficient alternatives. - tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapOfEntriesRecipe: Prefer
ImmutableMap#ofEntries(Map.Entry[])over alternatives that don't communicate the immutability of the resulting map at the type level. - tech.picnic.errorprone.refasterrules.JUnitRulesRecipes: Refaster rules related to JUnit expressions and statements. Source.
- tech.picnic.errorprone.refasterrules.JUnitRulesRecipes$ArgumentsEnumerationRecipe: Prefer statically imported
Arguments#argumentsoverArguments#ofcalls. - tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampDoubleRecipe: Prefer
Math#clamp(double, double, double)over more verbose alternatives. - tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampFloatRecipe: Prefer
Math#clamp(float, float, float)over more verbose alternatives. - tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampIntRecipe: Prefer
Math#clamp(long, int, int)over more verbose alternatives. - tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampLongRecipe: Prefer
Math#clamp(long, long, long)over more verbose alternatives. - tech.picnic.errorprone.refasterrules.RandomGeneratorRulesRecipes$RandomGeneratorNextDoubleWithOriginRecipe: Prefer
RandomGenerator#nextDouble(double origin, double bound)over alternatives that may silently yield an ununiform domain of values. - tech.picnic.errorprone.refasterrules.RandomGeneratorRulesRecipes$RandomGeneratorNextIntWithOriginRecipe: Prefer
RandomGenerator#nextInt(int origin, int bound)over alternatives that may silently yield values outside the intended domain. - tech.picnic.errorprone.refasterrules.RandomGeneratorRulesRecipes$RandomGeneratorNextLongWithOriginRecipe: Prefer
RandomGenerator#nextLong(long origin, long bound)over more contrived alternatives. - tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxJustArrayRecipe: Prefer
Flux#just(Object[])over more contrived alternatives. - tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamCollectLeastNaturalOrderStreamRecipe: Prefer
Comparators#least(int, Comparator)over alternatives that require space proportional to the size of the input stream, rather than space proportional to the result stream. - tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamCollectLeastStreamRecipe: Prefer
Comparators#least(int, Comparator)over alternatives that require space proportional to the size of the input stream, rather than space proportional to the result stream. - tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFindFirstRecipe: Prefer
Stream#findFirst()over more contrived alternatives. - tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamSortedRecipe: Prefer
Stream#sorted()over more contrived alternatives. - tech.picnic.errorprone.refasterrules.StringBuilderRulesRecipes: Refaster rules related to expressions dealing with
StringBuilders. Source. - tech.picnic.errorprone.refasterrules.StringBuilderRulesRecipes$StringBuilderRepeatRecipe: Warning: this rule is not behavior preserving: while the original code
throws a
NullPointerExceptionif the repeated string isnull, the replacement code will repeat the literal string"null". - tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringFormattedRecipe: Prefer
String#formatted(Object...)overString#format(String, Object...), as the former works more nicely with text blocks, while the latter does not appear advantageous in any circumstance (assuming one targets JDK 15+). - tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringJoinDelimiterVarargsRecipe: Prefer
String#join(CharSequence, CharSequence...)over less efficient alternatives. - tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$RequestHeadersUriSpecUriRecipe: Don't unnecessarily use
RequestHeadersUriSpec#uri(Function).
Removed Recipes
- org.openrewrite.github.PreferSecretsInheritWorkflow: Pass all secrets to a reusable workflow using
secrets: inherit. See Simplify using secrets with reusable workflows for details. - tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$DisjointCollectionsRecipe: Don't unnecessarily copy collections before passing them to
Collections#disjoint(Collection, Collection). - tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$DisjointSetsRecipe: Prefer
Collections#disjoint(Collection, Collection)over more contrived alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderPathOfRecipe: Prefer
Files#newBufferedReader(Path)over more verbose or contrived alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderPathOfWithCharsetRecipe: Prefer
Files#newBufferedReader(Path, Charset)over more contrived alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderToPathRecipe: Prefer
Files#newBufferedReader(Path)over more verbose or contrived alternatives. - tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderToPathWithCharsetRecipe: Prefer
Files#newBufferedReader(Path, Charset)over more contrived alternatives.