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
- io.quarkus.updates.core.quarkus330.RenameEnableMetrics:
- 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.apache.commons.lang.DefaultIfBlankToJdk: Replace
StringUtils#defaultIfBlank(s, fallback)withs == null || s.isBlank() ? fallback : s. - org.openrewrite.apache.commons.lang.IsBlankToJdk: Replace any
StringUtils#isBlank(String)and#isNotBlank(String)withs == null || s.isBlank()ands != null && !s.isBlank(). - 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.github.security.AnonymousJobs: Find jobs that lack descriptive names, making them harder to identify in workflow runs. Jobs without
nameproperties default to their job ID, which may not be descriptive. Based on zizmor's anonymous-definition audit. - org.openrewrite.github.security.ArtifactSecurity: Find workflows that may persist credentials through artifact uploads. This occurs when checkout actions don't disable credential persistence and upload actions include sensitive paths that may contain credentials, SSH keys, or configuration files. Based on zizmor's
artipackedaudit. - org.openrewrite.github.security.BotConditions: Find workflow conditions that check for bot actors in ways that can be spoofed. Bot actor names (like
dependabot[bot]) can be easily spoofed by creating accounts with similar names. Useactor_idwith numeric comparison instead for secure bot validation. Based on zizmor'sbot-conditionsaudit. - org.openrewrite.github.security.CachePoisoning: Detects potential cache poisoning vulnerabilities in workflows that use caching and publish artifacts. When workflows use caches during artifact publishing, attackers may be able to poison the cache with malicious content that gets included in published artifacts. Based on zizmor's cache-poisoning audit.
- org.openrewrite.github.security.DangerousTriggers: Detects use of fundamentally insecure workflow triggers like
pull_request_targetandworkflow_run. These triggers run with elevated privileges and are almost always used insecurely, potentially allowing code injection from untrusted sources. Based on zizmor's dangerous-triggers audit. - org.openrewrite.github.security.ExcessivePermissions: Find overly broad permissions in GitHub Actions workflows. Flags 'write-all' permissions and excessive write permissions that could be scoped more narrowly for security. Based on zizmor's excessive-permissions audit.
- org.openrewrite.github.security.ForbiddenUses: Find usage of forbidden or dangerous GitHub Actions that have known security vulnerabilities or follow suspicious patterns. Based on zizmor's forbidden-uses audit.
- org.openrewrite.github.security.GitHubEnv: Detects dangerous usage of
GITHUB_ENVandGITHUB_PATHenvironment files in workflows with risky triggers likepull_request_targetorworkflow_run. Writing to these files can allow code injection when the content includes user-controlled data. Based on zizmor's github-env audit. - org.openrewrite.github.security.HardcodedCredentials: Detects hardcoded credentials in GitHub Actions container configurations. Container registry passwords should use secrets instead of hardcoded values. Based on zizmor's hardcoded-container-credentials audit.
- org.openrewrite.github.security.InsecureCommands: Detects when insecure workflow commands are enabled via
ACTIONS_ALLOW_UNSECURE_COMMANDS. This environment variable enables dangerous workflow commands that can lead to code injection vulnerabilities. Based on zizmor's insecure-commands audit. - org.openrewrite.github.security.Obfuscation: Find workflows that use obfuscated action references or expressions that may be attempting to hide malicious behavior. This includes action paths with
'.','..', empty components, or expressions that use quote manipulation to hide their true intent. Based on zizmor'sobfuscationaudit. - org.openrewrite.github.security.RefVersionMismatch: Find GitHub Actions that are pinned to commit SHAs but have version comments that may not match the actual pinned version. This can lead to confusion about which version is actually being used and potential security issues if the comment misleads developers about the pinned version. Based on zizmor's
ref-version-mismatchaudit. - org.openrewrite.github.security.SecretsInherit: Detects when reusable workflows unconditionally inherit all parent secrets via
secrets: inherit. This practice can lead to over-privileged workflows and potential secret exposure to called workflows that may not need access to all secrets. Consider explicitly passing only required secrets. Based on zizmor's secrets-inherit audit. - org.openrewrite.github.security.SelfHostedRunner: Find workflows that use
self-hostedrunners, which may have security implications in public repositories due to potential persistence between workflow runs and lack of isolation. Self-hosted runners should be properly secured and ideally ephemeral. Based on zizmor'sself-hosted-runneraudit. - org.openrewrite.github.security.TemplateInjection: Find GitHub Actions workflows vulnerable to template injection attacks. These occur when user-controllable input (like pull request titles, issue bodies, or commit messages) is used directly in
runcommands orscriptinputs without proper escaping. Attackers can exploit this to execute arbitrary code. Based on zizmor'stemplate-injectionaudit. - org.openrewrite.github.security.TrustedPublishing: Find workflows that use manual credentials for publishing instead of OIDC trusted publishing. Trusted publishing eliminates the need for long-lived API tokens and provides better security through short-lived, automatically-rotated tokens. Based on zizmor's use-trusted-publishing audit.
- org.openrewrite.github.security.UndocumentedPermissions: Add documentation comments for permissions blocks in GitHub Actions workflows. Documenting permissions helps reviewers understand why specific permissions are needed and ensures security-conscious development practices. Based on zizmor's undocumented-permissions audit.
- org.openrewrite.github.security.UnpinnedActions: Pin GitHub Actions to specific commit SHAs for security and reproducibility. Actions pinned to tags or branches can be changed by the action author, while SHA pins are immutable. Based on zizmor's unpinned-uses audit.
- org.openrewrite.github.security.UnpinnedDockerImages: Pin Docker images to specific digest hashes for security and reproducibility. Images pinned to tags can be changed by the image author, while digest pins are immutable. Based on zizmor's unpinned-images audit.
- org.openrewrite.gradle.SortDependencies: Sort dependencies in
build.gradleandbuild.gradle.ktsfiles. Dependencies are sorted alphabetically by configuration name (e.g.api,implementation), then by groupId, then by artifactId. - org.openrewrite.gradle.SyncGradleExtPropertiesWithBom: Downloads a BOM and compares its properties against Gradle ext properties. When the BOM defines a higher version for a property, the ext property is updated to match (or removed if
removeRedundantOverridesis enabled). - org.openrewrite.gradle.UseAssignmentForPropertySyntax: Converts deprecated Groovy DSL property assignment syntax from space/method-call form (e.g.,
description 'text'ordescription('text')) to assignment form (description = 'text') for well-known Gradle project and task properties. See the Gradle 8.14 upgrade guide for more information. - org.openrewrite.gradle.UsePropertyAssignmentSyntax: Converts deprecated Groovy DSL property assignment syntax from space/method-call form (e.g.,
description 'text'ordescription('text')) to assignment form (description = 'text'). Addresses Gradle 8.14 deprecation: "Properties should be assigned using the 'propName = value' syntax.". - 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.AddMissingJacksonDependencies: Adds Jackson dataformat dependencies when code uses types from their packages but the dependency is not declared. For example, adds
jackson-dataformat-xmlwhen code usesXmlMapper. - org.openrewrite.java.jackson.CommentOutSimpleModuleMethodCalls: In Jackson 3, some modules (e.g.
JodaModule) no longer extendSimpleModuleand instead extendJacksonModuledirectly. This means methods likeaddSerializer()andaddDeserializer()are no longer available on these types. This recipe adds a TODO comment to flag these call sites for manual migration. - org.openrewrite.java.jackson.ReplacePropertyNamingStrategyConstants: Replace usages of deprecated
PropertyNamingStrategyinner classes and constants with theirPropertyNamingStrategiesequivalents, introduced in Jackson 2.12. - org.openrewrite.java.jackson.UpdateAutoDetectVisibilityConfiguration: In Jackson 3, auto-detection
MapperFeatureflags likeAUTO_DETECT_FIELDSare removed. UsechangeDefaultVisibility()on the builder instead. - 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.UpgradeBuildToJava24: Kotlin versions before 2.3 only support up to Java 24. Applies only to modules that actually compile Kotlin (i.e. contain
.ktsource files), so transitivekotlin-stdlibdependencies do not trigger the cap. - org.openrewrite.java.migrate.UpgradeBuildToJava25: Upgrades build files to Java 25 for modules without Kotlin source files. This covers pure Java projects, including those that only pick up
kotlin-stdlibtransitively through another dependency. - 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.jspecify.MoveAnnotationToArrayType: When an annotation like
@Nullableis applied to an array type in declaration position, this recipe moves it to the array brackets. For example,@Nullable byte[]becomesbyte @Nullable[]. Best used beforeChangeTypein a migration pipeline, targeting the pre-migration annotation type. - 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.migrate.util.MigrateCollectionsEmptyList: Prefer
List.of()instead of usingCollections.emptyList()in Java 9 or higher. - org.openrewrite.java.migrate.util.MigrateCollectionsEmptyMap: Prefer
Map.of()instead of usingCollections.emptyMap()in Java 9 or higher. - org.openrewrite.java.migrate.util.MigrateCollectionsEmptySet: Prefer
Set.of()instead of usingCollections.emptySet()in Java 9 or higher. - org.openrewrite.java.netty.upgrade.3_2_to_4_1.ChannelSetReadableToAutoRead: Replaces
channel.setReadable(x)withchannel.config().setAutoRead(x). - org.openrewrite.java.netty.upgrade.3_2_to_4_1.RemoveChannelStateEventParameter: Removes
ChannelStateEventparameters from Netty channel handler method declarations, as Netty 4 handler methods no longer take this parameter. - org.openrewrite.java.netty.upgrade.3_2_to_4_1.ReplaceChannelsFireMessageReceived: Replaces Netty 3 Channels.fireMessageReceived(channel, message) with Netty 4 ctx.fireChannelRead(message).
- org.openrewrite.java.netty.upgrade.3_2_to_4_1.StringEncoderToStandardCharsets: Replaces
new StringEncoder(charsetName)withnew StringEncoder(StandardCharsets.<constant>)for all standard charsets (US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16). - org.openrewrite.java.recipes.UseJavaTemplateStaticApply: Replaces
JavaTemplate.builder(template).build().apply(cursor, coordinates, args...)withJavaTemplate.apply(template, cursor, coordinates, args...)when the builder chain has no intermediate configuration methods. - 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.spring.data.MigratePagingAndSortingRepository: In Spring Data 3.0,
PagingAndSortingRepositoryno longer extendsCrudRepository. Interfaces that extend onlyPagingAndSortingRepositorymust also explicitly extendCrudRepositoryto retain CRUD methods likesave(),findById(), anddelete(). - org.openrewrite.java.spring.data.UpgradeSpringData_3_0: Migrate applications to Spring Data 3.0. Handles the PagingAndSortingRepository hierarchy change where it no longer extends CrudRepository, and chains prior deprecation fixes from Spring Data 2.7.
- org.openrewrite.java.testing.cleanup.AssertEqualsIntegralDeltaToAssertEquals: Remove the delta argument from
assertEquals()when both expected and actual areintorlongtypes, since the delta is meaningless for exact integer comparison. Integer arguments get unnecessarily upcasted todoublewhen a delta is provided. - 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.mockito.PowerMockWhiteboxToJavaReflection: Replace
org.powermock.reflect.Whiteboxcalls (setInternalState,getInternalState,invokeMethod) with plain Java reflection usingjava.lang.reflect.Fieldandjava.lang.reflect.Method. - org.openrewrite.java.testing.mockito.PowerMockitoDoStubbingToMockito: Replaces PowerMockito's private method stubbing pattern
doNothing().when(instance, "methodName", args...)with the standard Mockito patterndoNothing().when(instance).methodName(args...). - org.openrewrite.java.testing.mockito.RemoveDoNothingForDefaultMocks: Remove unnecessary
doNothing()stubbings for void methods on@Mockfields. Mockito mocks already do nothing for void methods by default, making these stubbings redundant and triggering strict stubbing violations in Mockito 3+. - org.openrewrite.java.testing.mockito.RemovePowerMockClassExtensions: Removes
extends PowerMockConfigurationandextends PowerMockTestCasefrom test classes, as these are PowerMock-specific base classes not needed with Mockito. - org.openrewrite.java.testing.mockito.ThenThrowCheckedExceptionToRuntimeException: In Mockito 3+,
thenThrow()validates that checked exceptions are declared in the mocked method'sthrowsclause. This recipe replaces checked exception class literals inthenThrow()calls withRuntimeException.classwhen the mocked method does not declare the exception. - 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.MigrateToOracleFree: Oracle Database Free is the successor of Oracle XE. Migrate from
org.testcontainers:oracle-xetoorg.testcontainers:oracle-free. - 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.java.testing.wiremock.UpgradeWiremockDependencyVersion: Migrate WireMock dependencies from the old
com.github.tomakehurstcoordinates to the neworg.wiremockcoordinates. WireMock 3.x changed its Maven coordinates and requires Java 11 or higher. Old 2.x versions contain CVE-2023-44487. - org.openrewrite.javascript.dependencies.remove-dependency: Removes a dependency from
package.jsonand updates the lock file by running the package manager. - org.openrewrite.maven.SortDependencies: Sort dependencies alphabetically by groupId then artifactId. Test-scoped dependencies are sorted after non-test dependencies. Applies to both
<dependencies>and<dependencyManagement>sections. - org.openrewrite.netty.UpgradeNetty_3_2_to_4_1: Migrate applications to the latest Netty 4.1.x release.
- 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. - org.openrewrite.github.security.AnonymousJobsRecipe: Find jobs that lack descriptive names, making them harder to identify in workflow runs. Jobs without
nameproperties default to their job ID, which may not be descriptive. Based on zizmor's anonymous-definition audit. - org.openrewrite.github.security.ArtifactSecurityRecipe: Find workflows that may persist credentials through artifact uploads. This occurs when checkout actions don't disable credential persistence and upload actions include sensitive paths that may contain credentials, SSH keys, or configuration files. Based on zizmor's
artipackedaudit. - org.openrewrite.github.security.BotConditionsRecipe: Find workflow conditions that check for bot actors in ways that can be spoofed. Bot actor names (like
dependabot[bot]) can be easily spoofed by creating accounts with similar names. Useactor_idwith numeric comparison instead for secure bot validation. Based on zizmor'sbot-conditionsaudit. - org.openrewrite.github.security.CachePoisoningRecipe: Detects potential cache poisoning vulnerabilities in workflows that use caching and publish artifacts. When workflows use caches during artifact publishing, attackers may be able to poison the cache with malicious content that gets included in published artifacts. Based on zizmor's cache-poisoning audit.
- org.openrewrite.github.security.DangerousTriggersRecipe: Detects use of fundamentally insecure workflow triggers like
pull_request_targetandworkflow_run. These triggers run with elevated privileges and are almost always used insecurely, potentially allowing code injection from untrusted sources. Based on zizmor's dangerous-triggers audit. - org.openrewrite.github.security.ExcessivePermissionsRecipe: Find overly broad permissions in GitHub Actions workflows. Flags 'write-all' permissions and excessive write permissions that could be scoped more narrowly for security. Based on zizmor's excessive-permissions audit.
- org.openrewrite.github.security.ForbiddenUsesRecipe: Find usage of forbidden or dangerous GitHub Actions that have known security vulnerabilities or follow suspicious patterns. Based on zizmor's forbidden-uses audit.
- org.openrewrite.github.security.GitHubEnvRecipe: Detects dangerous usage of
GITHUB_ENVandGITHUB_PATHenvironment files in workflows with risky triggers likepull_request_targetorworkflow_run. Writing to these files can allow code injection when the content includes user-controlled data. Based on zizmor's github-env audit. - org.openrewrite.github.security.HardcodedCredentialsRecipe: Detects hardcoded credentials in GitHub Actions container configurations. Container registry passwords should use secrets instead of hardcoded values. Based on zizmor's hardcoded-container-credentials audit.
- org.openrewrite.github.security.InsecureCommandsRecipe: Detects when insecure workflow commands are enabled via
ACTIONS_ALLOW_UNSECURE_COMMANDS. This environment variable enables dangerous workflow commands that can lead to code injection vulnerabilities. Based on zizmor's insecure-commands audit. - org.openrewrite.github.security.ObfuscationRecipe: Find workflows that use obfuscated action references or expressions that may be attempting to hide malicious behavior. This includes action paths with
'.','..', empty components, or expressions that use quote manipulation to hide their true intent. Based on zizmor'sobfuscationaudit. - org.openrewrite.github.security.RefVersionMismatchRecipe: Find GitHub Actions that are pinned to commit SHAs but have version comments that may not match the actual pinned version. This can lead to confusion about which version is actually being used and potential security issues if the comment misleads developers about the pinned version. Based on zizmor's
ref-version-mismatchaudit. - org.openrewrite.github.security.SecretsInheritRecipe: Detects when reusable workflows unconditionally inherit all parent secrets via
secrets: inherit. This practice can lead to over-privileged workflows and potential secret exposure to called workflows that may not need access to all secrets. Consider explicitly passing only required secrets. Based on zizmor's secrets-inherit audit. - org.openrewrite.github.security.SelfHostedRunnerRecipe: Find workflows that use
self-hostedrunners, which may have security implications in public repositories due to potential persistence between workflow runs and lack of isolation. Self-hosted runners should be properly secured and ideally ephemeral. Based on zizmor'sself-hosted-runneraudit. - org.openrewrite.github.security.TemplateInjectionRecipe: Find GitHub Actions workflows vulnerable to template injection attacks. These occur when user-controllable input (like pull request titles, issue bodies, or commit messages) is used directly in
runcommands orscriptinputs without proper escaping. Attackers can exploit this to execute arbitrary code. Based on zizmor'stemplate-injectionaudit. - org.openrewrite.github.security.TrustedPublishingRecipe: Find workflows that use manual credentials for publishing instead of OIDC trusted publishing. Trusted publishing eliminates the need for long-lived API tokens and provides better security through short-lived, automatically-rotated tokens. Based on zizmor's use-trusted-publishing audit.
- org.openrewrite.github.security.UndocumentedPermissionsRecipe: Add documentation comments for permissions blocks in GitHub Actions workflows. Documenting permissions helps reviewers understand why specific permissions are needed and ensures security-conscious development practices. Based on zizmor's undocumented-permissions audit.
- org.openrewrite.github.security.UnpinnedActionsRecipe: Pin GitHub Actions to specific commit SHAs for security and reproducibility. Actions pinned to tags or branches can be changed by the action author, while SHA pins are immutable. Based on zizmor's unpinned-uses audit.
- org.openrewrite.github.security.UnpinnedDockerImagesRecipe: Pin Docker images to specific digest hashes for security and reproducibility. Images pinned to tags can be changed by the image author, while digest pins are immutable. Based on zizmor's unpinned-images audit.
- org.openrewrite.java.spring.data.UseJpaRepositoryDeleteAllInBatch:
JpaRepository#deleteInBatch(Iterable)was deprecated in 2.5. - org.openrewrite.java.spring.data.UseJpaRepositoryGetById:
JpaRepository#getOne(ID)was deprecated in 2.5. - org.openrewrite.java.spring.data.UseJpaRepositoryGetReferenceById:
JpaRepository#getOne(ID)was deprecated in 2.5 andJpaRepository#getById(ID)was deprecated in 2.7. - 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.
Changed Recipes
- org.openrewrite.javascript.dependencies.upgrade-dependency-version was changed:
- Old Options:
newVersion: { type: String, required: true }packageName: { type: String, required: true }
- New Options:
newVersion: { type: String, required: true }packageName: { type: String, required: false }packagePattern: { type: String, required: false }
- Old Options:
- org.openrewrite.properties.AddProperty was changed:
- Old Options:
comment: { type: String, required: false }delimiter: { type: String, required: false }orderedInsertion: { type: Boolean, required: false }property: { type: String, required: true }value: { type: String, required: true }
- New Options:
comment: { type: String, required: false }delimiter: { type: String, required: false }insertMode: { type: InsertMode, required: false }insertProperty: { type: String, required: false }orderedInsertion: { type: Boolean, required: false }property: { type: String, required: true }value: { type: String, required: true }
- Old Options: