Skip to main content

Recipes by Tag

This doc contains all recipe tags and the recipes that are tagged with them.

Total tags: 259

5to6

7 recipes

actions

3 recipes

activation

2 recipes

activemq

1 recipe

actuator

2 recipes

amqp

2 recipes

annotation

3 recipes

annotations

2 recipes

apache

23 recipes

application

7 recipes

arquillian

1 recipe

artemis

1 recipe

assertj

11 recipes

async

1 recipe

authentication

2 recipes

authorization

2 recipes

aws

3 recipes

batch

9 recipes

batchXML

1 recipe

bean validation

1 recipe

beans

2 recipes

best

1 recipe

  • org.openrewrite.java.migrate.JavaBestPractices
    • Java best practices
    • Applies opinionated best practices for Java projects targeting Java 25. This recipe includes the full Java 25 upgrade chain plus additional improvements to code style, API usage, and third-party dependency reduction that go beyond what the version migration recipes apply.
    • Tags: best-practices

bindings

1 recipe

bom

2 recipes

boot

49 recipes

bouncycastle

2 recipes

brave

1 recipe

bug

1 recipe

build

2 recipes

byteman

1 recipe

cache

1 recipe

cacheManager

1 recipe

camel

1 recipe

cdi

3 recipes

ci

3 recipes

  • org.openrewrite.gitlab.BestPractices
    • GitLab CI best practices
    • Apply GitLab CI/CD best practices to .gitlab-ci.yml. This includes adding workflow:rules to prevent duplicate pipelines, setting interruptible: true and retry in the default section, configuring artifacts:expire_in, and setting a job timeout.
  • org.openrewrite.gitlab.MigrateTerraformTemplateToOpenTofuComponent
    • Migrate GitLab Terraform template to OpenTofu component
    • Replace the deprecated Terraform/Base.latest.gitlab-ci.yml template include with the OpenTofu CI/CD component, per the GitLab catalog migration guide.
  • org.openrewrite.gitlab.search.FindDeprecatedSyntax
    • Find deprecated GitLab CI syntax
    • Find usages of deprecated only and except keywords in .gitlab-ci.yml. These keywords are deprecated in favor of rules.

classic

3 recipes

cleanup

1 recipe

cloud

19 recipes

cloudfoundry

1 recipe

cobertura

1 recipe

codemods

103 recipes

collections

2 recipes

commons

17 recipes

compatibility

1 recipe

compiler

2 recipes

config

1 recipe

configuration

1 recipe

connector

2 recipes

connectors

1 recipe

core

1 recipe

cucumber

5 recipes

CVE

1 recipe

CWE

3 recipes

data

5 recipes

database

5 recipes

datadog

1 recipe

datanucleus

4 recipes

datasource

1 recipe

dbrider

1 recipe

default

1 recipe

demo

2 recipes

dependabot

4 recipes

dependencies

7 recipes

deployment

2 recipes

deprecated

17 recipes

deprecation

5 recipes

derby

2 recipes

descriptors

2 recipes

devtools

1 recipe

docker

3 recipes

  • org.openrewrite.docker.DockerBestPractices
    • Apply Docker best practices
    • Apply a set of Docker best practices to Dockerfiles. This recipe applies security hardening, build optimization, and maintainability improvements based on CIS Docker Benchmark and industry best practices.
  • org.openrewrite.docker.DockerBuildOptimization
    • Optimize Docker builds
    • Apply build optimization best practices to Dockerfiles. This includes combining RUN instructions to reduce layers and adding cleanup commands to reduce image size.
  • org.openrewrite.docker.DockerSecurityBestPractices
    • Apply Docker security best practices
    • Apply security-focused Docker best practices to Dockerfiles. This includes running as a non-root user (CIS 4.1) and using COPY instead of ADD where appropriate (CIS 4.9).

dropwizard

1 recipe

easymock

1 recipe

ejb

7 recipes

elasticsearch

1 recipe

epoll

1 recipe

eslint

190 recipes

events

1 recipe

examples

5 recipes

faces

29 recipes

flyway

5 recipes

formatting

1 recipe

github

13 recipes

gitlab

3 recipes

  • org.openrewrite.gitlab.BestPractices
    • GitLab CI best practices
    • Apply GitLab CI/CD best practices to .gitlab-ci.yml. This includes adding workflow:rules to prevent duplicate pipelines, setting interruptible: true and retry in the default section, configuring artifacts:expire_in, and setting a job timeout.
  • org.openrewrite.gitlab.MigrateTerraformTemplateToOpenTofuComponent
    • Migrate GitLab Terraform template to OpenTofu component
    • Replace the deprecated Terraform/Base.latest.gitlab-ci.yml template include with the OpenTofu CI/CD component, per the GitLab catalog migration guide.
  • org.openrewrite.gitlab.search.FindDeprecatedSyntax
    • Find deprecated GitLab CI syntax
    • Find usages of deprecated only and except keywords in .gitlab-ci.yml. These keywords are deprecated in favor of rules.

glassfish

3 recipes

  • org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithRuntime
    • Add explicit JAXB API dependencies and runtime
    • This recipe will add explicit dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the javax.xml.bind namespace. Running a full javax to Jakarta migration using org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta will update to versions greater than 3.x which necessitates the package change as well.
  • org.openrewrite.java.migrate.javax.AddJaxbRuntime
    • Use latest JAXB API and runtime for Jakarta EE 8
    • Update build files to use the latest JAXB runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAXB run-time, in Gradle compileOnly+testImplementation and Maven provided scope, to any project that has a transitive dependency on the JAXB API. The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact.
  • org.openrewrite.java.migrate.javax.AddJaxwsDependencies
    • Add explicit JAX-WS dependencies
    • This recipe will add explicit dependencies for Jakarta EE 8 when a Java 8 application is using JAX-WS. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 but the application can continue to use the javax.xml.bind namespace.

graalvm

1 recipe

  • org.openrewrite.quarkus.spring.ConfigureNativeBuild
    • Configure Quarkus Native Build Support
    • Adds configuration and dependencies required for Quarkus native image compilation with GraalVM. Includes native profile configuration and reflection hints where needed.

gradle

2 recipes

guava

56 recipes

h2

2 recipes

hamcrest

6 recipes

handler

1 recipe

health

2 recipes

hibernate

5 recipes

httpclient

5 recipes

inject

3 recipes

integration

1 recipe

intellij

1 recipe

jackson

30 recipes

  • org.openrewrite.java.jackson.AddJsonCreatorToPrivateConstructors
    • Add @JsonCreator to non-public constructors
    • Jackson 3 strictly enforces creator visibility rules. Non-public constructors in Jackson-annotated classes that were auto-detected in Jackson 2 need an explicit @JsonCreator annotation to work for deserialization in Jackson 3.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.AddMissingJacksonDependencies
    • Add missing Jackson dataformat dependencies
    • Adds Jackson dataformat dependencies when code uses types from their packages but the dependency is not declared. For example, adds jackson-dataformat-xml when code uses XmlMapper.
    • Tags: jackson-2
  • org.openrewrite.java.jackson.CodehausClassesToFasterXML
    • Migrate classes from Jackson Codehaus (legacy) to Jackson FasterXML
    • In Jackson 2, the package and dependency coordinates moved from Codehaus to FasterXML.
    • Tags: jackson-2
  • org.openrewrite.java.jackson.CodehausToFasterXML
    • Migrate from Jackson Codehaus (legacy) to Jackson FasterXML
    • In Jackson 2, the package and dependency coordinates moved from Codehaus to FasterXML.
    • Tags: jackson-2
  • org.openrewrite.java.jackson.CommentOutSimpleModuleMethodCalls
    • Add comment to SimpleModule method calls on modules that no longer extend SimpleModule
    • In Jackson 3, some modules (e.g. JodaModule) no longer extend SimpleModule and instead extend JacksonModule directly. This means methods like addSerializer() and addDeserializer() are no longer available on these types. This recipe adds a TODO comment to flag these call sites for manual migration.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.IOExceptionToJacksonException
    • Replace IOException with JacksonException in catch clauses
    • In Jackson 3, ObjectMapper and related classes no longer throw IOException. This recipe replaces catch (IOException e) with catch (JacksonException e) when the try block contains Jackson API calls. When the try block also contains non-Jackson code that throws IOException, the catch is changed to a multi-catch catch (JacksonException | IOException e).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.JacksonBestPractices
    • Jackson best practices
    • Apply best practices for using Jackson library, including upgrade to Jackson 2.x and removing redundant annotations.
    • Tags: jackson-2
  • org.openrewrite.java.jackson.MigrateMapperSettersToBuilder
    • Migrate mapper setter calls to builder pattern
    • In Jackson 3, JsonMapper and other format-aligned mappers are immutable. Configuration methods like setFilterProvider, addMixIn, disable, enable, etc. must be called on the builder instead. This recipe migrates setter calls to the builder pattern when safe, or adds TODO comments when automatic migration is not possible.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.RemoveBuiltInModuleRegistrations
    • Remove registrations of modules built-in to Jackson 3
    • In Jackson 3, ParameterNamesModule, Jdk8Module, and JavaTimeModule are built into jackson-databind and no longer need to be registered manually. This recipe removes ObjectMapper.registerModule() and MapperBuilder.addModule() calls for these modules.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.RemoveRedundantFeatureFlags
    • Remove redundant Jackson 3 feature flag configurations
    • Remove ObjectMapper feature flag configurations that set values to their new Jackson 3 defaults. For example, disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) and configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) are redundant since this is now disabled by default in Jackson 3.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.RemoveRedundantJsonPropertyValue
    • Remove redundant @JsonProperty argument
    • Remove @JsonProperty annotation or value attribute when the value matches the argument name.
    • Tags: jackson-2
  • org.openrewrite.java.jackson.ReplaceJsonIgnoreWithJsonSetter
    • Replace @JsonIgnore with @JsonSetter on empty collection fields
    • In Jackson 3, @JsonIgnore on fields initialized with empty collections causes the field value to become null instead of maintaining the empty collection. This recipe replaces @JsonIgnore with @JsonSetter(nulls = Nulls.AS_EMPTY) on Map and Collection fields that have an empty collection initializer.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.ReplaceObjectMapperCopy
    • Replace ObjectMapper.copy() with rebuild().build()
    • In Jackson 3, ObjectMapper.copy() was removed. Use mapper.rebuild().build() instead.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.ReplacePropertyNamingStrategyConstants
    • Replace deprecated PropertyNamingStrategy inner classes and constants
    • Replace usages of deprecated PropertyNamingStrategy inner classes and constants with their PropertyNamingStrategies equivalents, introduced in Jackson 2.12.
    • Tags: jackson-2
  • org.openrewrite.java.jackson.ReplaceStreamWriteCapability
    • Replace removed JsonGenerator capability methods with StreamWriteCapability
    • In Jackson 3, JsonGenerator.canWriteBinaryNatively() and canWriteFormattedNumbers() were removed and replaced with the StreamWriteCapability enum. This recipe updates these method calls to use getWriteCapabilities().isEnabled(StreamWriteCapability.*) instead.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.SimplifyJacksonExceptionCatch
    • Simplify catch clauses for Jackson exceptions
    • In Jackson 3, JacksonException and its subtypes extend RuntimeException. This recipe simplifies multi-catch clauses by removing Jackson exception types when RuntimeException is also caught, since catching both is redundant. For example, catch (JacksonException | RuntimeException e) becomes catch (RuntimeException e).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpdateAutoDetectVisibilityConfiguration
    • Replace disable(MapperFeature.AUTO_DETECT_*) with changeDefaultVisibility() for Jackson 3
    • In Jackson 3, auto-detection MapperFeature flags like AUTO_DETECT_FIELDS are removed. Use changeDefaultVisibility() on the builder instead.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpdateSerializationInclusionConfiguration
    • Update configuration of serialization inclusion in ObjectMapper for Jackson 3
    • In Jackson 3, mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) is no longer supported and should be replaced by changeDefaultPropertyInclusion() for both valueInclusion and contentInclusion.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3
    • Migrates from Jackson 2.x to Jackson 3.x
    • Migrate applications to the latest Jackson 3.x release. This recipe handles package changes (com.fasterxml.jackson -> tools.jackson), dependency updates, core class renames, exception renames, and method renames (e.g., JsonGenerator.writeObject() -> writePOJO(), JsonParser.getCurrentValue() -> currentValue()).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_Dependencies
    • Upgrade Jackson 2.x dependencies to 3.x
    • Upgrade Jackson Maven dependencies from 2.x to 3.x versions and update group IDs.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonGeneratorMethodRenames
    • Rename Jackson 2.x methods to 3.x equivalents for JsonGenerator
    • Rename JsonGenerator methods that were renamed in 3.x (e.g., writeObject() to writePOJO(), getCurrentValue() to currentValue()).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonNodeMethodRenames
    • Rename Jackson 2.x methods to 3.x equivalents for JsonNode
    • Rename JsonNode methods that were renamed in 3.x (e.g., elements() to values(), fields() to entries()).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonParserMethodRenames
    • Rename Jackson 2.x methods to 3.x equivalents for JsonParser
    • Rename JsonParser methods that were renamed in 3.x (e.g., getTextCharacters() to getStringCharacters(), getCurrentValue() to currentValue()).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_MethodRenames
    • Rename Jackson 2.x methods to 3.x equivalents
    • Rename Jackson methods that were renamed in 3.x (e.g., writeObject() to writePOJO(), getCurrentValue() to currentValue()).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_ObjectNodeMethodRenames
    • Rename Jackson 2.x methods to 3.x equivalents for ObjectNode
    • Rename ObjectNode methods deprecated in Jackson 2 and removed in 3.x (put(String, JsonNode) to set, putAll to setAll).
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_PackageChanges
    • Update Jackson package names from 2.x to 3.x
    • Update Jackson package imports from com.fasterxml.jackson to tools.jackson.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_RelocatedFeatureConstants
    • Migrate relocated feature constants to DateTimeFeature and EnumFeature
    • Jackson 3 moved date/time-related feature constants from SerializationFeature and DeserializationFeature into DateTimeFeature, and enum-related constants into EnumFeature.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_RemoveRedundantFeatureFlags
    • Remove redundant Jackson 3 feature flag configurations
    • Remove ObjectMapper feature flag configurations that are now defaults in Jackson 3.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UpgradeJackson_2_3_TypeChanges
    • Update Jackson 2.x types to 3.x
    • Update Jackson type names including exception types and core class renames.
    • Tags: jackson-3
  • org.openrewrite.java.jackson.UseModernDateTimeSerialization
    • Use modern date/time serialization defaults
    • Remove redundant @JsonFormat annotations on java.time types that specify ISO-8601 patterns, as Jackson 3 uses ISO-8601 as the default format (with WRITE_DATES_AS_TIMESTAMPS now disabled by default).
    • Tags: jackson-3

jacoco

1 recipe

jakarta

102 recipes

jakartaee

6 recipes

java

10 recipes

java10

1 recipe

  • org.openrewrite.java.migrate.lang.UseVar
    • Use local variable type inference
    • Apply local variable type inference (var) for primitives and objects. These recipes can cause unused imports, be advised to run `org.openrewrite.java.RemoveUnusedImports afterwards.

java11

29 recipes

  • org.openrewrite.java.migrate.IBMJDKtoOracleJDK
    • Migrate from IBM Runtimes to Oracle Runtimes
    • This recipe will apply changes commonly needed when upgrading Java versions. The solutions provided in this list are solutions necessary for migrating from IBM Runtimes to Oracle Runtimes.
  • org.openrewrite.java.migrate.IBMSemeru
    • Migrate to IBM Semeru Runtimes
    • This recipe will apply changes commonly needed when upgrading Java versions. The solutions provided in this list are solutions only available in IBM Semeru Runtimes.
  • org.openrewrite.java.migrate.InternalBindPackages
    • Use com.sun.xml.bind.* instead of com.sun.xml.internal.bind.*
    • Do not use APIs from com.sun.xml.internal.bind.* packages.
  • org.openrewrite.java.migrate.JREDoNotUseSunNetSslAPIs
    • Use javax.net.ssl instead of com.sun.net.ssl
    • Do not use APIs from com.sun.net.ssl packages.
  • org.openrewrite.java.migrate.JREDoNotUseSunNetSslInternalSslProvider
    • Use com.ibm.jsse2 instead of com.sun.net.ssl.internal.ssl
    • Do not use the com.sun.net.ssl.internal.ssl.Provider class.
  • org.openrewrite.java.migrate.JREDoNotUseSunNetSslInternalWwwProtocol
    • Use com.ibm.net.ssl.www2.protocol instead of com.sun.net.ssl.internal.www.protocol
    • Do not use the com.sun.net.ssl.internal.www.protocol package.
  • org.openrewrite.java.migrate.JREDoNotUseSunNetSslInternalWwwProtocolHttpsHandler
    • Use com.ibm.net.ssl.www2.protocol.https.Handler instead of com.sun.net.ssl.internal.www.protocol.https.Handler
    • Do not use the com.sun.net.ssl.internal.www.protocol.https.Handler class.
  • org.openrewrite.java.migrate.Java8toJava11
    • Migrate to Java 11
    • This recipe will apply changes commonly needed when upgrading to Java 11. Specifically, for those applications that are built on Java 8, this recipe will update and add dependencies on J2EE libraries that are no longer directly bundled with the JDK. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 11 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 11.
  • org.openrewrite.java.migrate.Krb5LoginModuleClass
    • Use com.sun.security.auth.module.Krb5LoginModule instead of com.ibm.security.auth.module.Krb5LoginModule
    • Do not use the com.ibm.security.auth.module.Krb5LoginModule class.
  • org.openrewrite.java.migrate.RemovedJavaXMLWSModuleProvided
    • Do not package java.xml.ws module in WebSphere Liberty applications
    • The java.xml.ws module was removed in Java11. Websphere Liberty provides its own implementation of the module, which can be used by specifying the jaxws-2.2 feature in the server.xml file. This recipe updates the javax.xml.ws dependency to use the provided scope to avoid class loading issues.
  • org.openrewrite.java.migrate.RemovedJaxBModuleProvided
    • Do not package java.xml.bind and java.activation modules in WebSphere Liberty applications
    • The java.xml.bind and java.activation modules were removed in Java11. Websphere Liberty provides its own implementation of the modules, which can be used by specifying the jaxb-2.2 feature in the server.xml file. This recipe updates the javax.xml.bind and javax.activation dependencies to use the provided scope to avoid class loading issues.
  • org.openrewrite.java.migrate.RemovedPolicy
    • Replace javax.security.auth.Policy with java.security.Policy
    • The javax.security.auth.Policy class is not available from Java SE 11 onwards.
  • org.openrewrite.java.migrate.ThreadStopDestroy
    • Remove Thread.destroy() and Thread.stop(Throwable)
    • The java.lang.Thread.destroy() method was never implemented, and the java.lang.Thread.stop(java.lang.Throwable) method has been unusable since Java SE 8. This recipe removes any usage of these methods from your application.
  • org.openrewrite.java.migrate.UpgradeBuildToJava11
    • Upgrade build to Java 11
    • Updates build files to use Java 11 as the target/source.
  • org.openrewrite.java.migrate.UpgradePluginsForJava11
    • Upgrade plugins to Java 11 compatible versions
    • Updates plugins to version compatible with Java 11.
  • org.openrewrite.java.migrate.cobertura.RemoveCoberturaMavenPlugin
    • Remove Cobertura Maven plugin
    • This recipe will remove Cobertura, as it is not compatible with Java 11.
  • org.openrewrite.java.migrate.guava.NoGuavaJava11
    • Prefer the Java 11 standard library instead of Guava
    • Guava filled in important gaps in the Java standard library and still does. But at least some of Guava's API surface area is covered by the Java standard library now, and some projects may be able to remove Guava altogether if they migrate to standard library for these functions.
  • org.openrewrite.java.migrate.guava.PreferJavaUtilObjectsRequireNonNullElse
    • Prefer java.util.Objects#requireNonNullElse
    • Prefer java.util.Objects#requireNonNullElse instead of using com.google.common.base.MoreObjects#firstNonNull.
  • org.openrewrite.java.migrate.javax.AddCommonAnnotationsDependencies
    • Add explicit Common Annotations dependencies
    • Add the necessary annotation-api dependency from Jakarta EE 8 to maintain compatibility with Java version 11 or greater.
  • org.openrewrite.java.migrate.javax.AddInjectDependencies
    • Add explicit Inject dependencies
    • Add the necessary inject-api dependency from Jakarta EE 8 to maintain compatibility with Java version 11 or greater.
  • org.openrewrite.java.migrate.javax.AddJaxbAPIDependencies
    • Add explicit JAXB API dependencies
    • This recipe will add explicit API dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the javax.xml.bind namespace. Running a full javax to Jakarta migration using org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta will update to versions greater than 3.x which necessitates the package change as well.
  • org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithRuntime
    • Add explicit JAXB API dependencies and runtime
    • This recipe will add explicit dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the javax.xml.bind namespace. Running a full javax to Jakarta migration using org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta will update to versions greater than 3.x which necessitates the package change as well.
  • org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithoutRuntime
    • Add explicit JAXB API dependencies and remove runtimes
    • This recipe will add explicit API dependencies without runtime dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing API dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the javax.xml.bind namespace. All JAXB runtime implementation dependencies are removed.
  • org.openrewrite.java.migrate.javax.AddJaxbRuntime
    • Use latest JAXB API and runtime for Jakarta EE 8
    • Update build files to use the latest JAXB runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAXB run-time, in Gradle compileOnly+testImplementation and Maven provided scope, to any project that has a transitive dependency on the JAXB API. The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact.
  • org.openrewrite.java.migrate.javax.AddJaxwsDependencies
    • Add explicit JAX-WS dependencies
    • This recipe will add explicit dependencies for Jakarta EE 8 when a Java 8 application is using JAX-WS. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 but the application can continue to use the javax.xml.bind namespace.
  • org.openrewrite.java.migrate.javax.AddJaxwsRuntime
    • Use the latest JAX-WS API and runtime for Jakarta EE 8
    • Update build files to use the latest JAX-WS runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAX-WS run-time, in Gradle compileOnly+testImplementation and Maven provided scope, to any project that has a transitive dependency on the JAX-WS API. The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact.
  • org.openrewrite.java.migrate.javax.MigrateJaxBWSPlugin
    • Migrate JAXB-WS Plugin
    • Upgrade the JAXB-WS Maven plugin to be compatible with Java 11.
  • org.openrewrite.java.migrate.lombok.UpdateLombokToJava11
    • Migrate Lombok to a Java 11 compatible version
    • Update Lombok dependency to a version that is compatible with Java 11 and migrate experimental Lombok types that have been promoted.
  • org.openrewrite.java.migrate.nio.file.PathsGetToPathOf
    • Replace Paths.get with Path.of
    • The java.nio.file.Paths.get method was introduced in Java SE 7. The java.nio.file.Path.of method was introduced in Java SE 11. This recipe replaces all usages of Paths.get with Path.of for consistency.

java17

23 recipes

java21

11 recipes

java25

7 recipes

  • org.openrewrite.java.migrate.AccessController
    • Remove Security AccessController
    • The Security Manager API is unsupported in Java 24. This recipe will remove the usage of java.security.AccessController.
  • org.openrewrite.java.migrate.JavaBestPractices
    • Java best practices
    • Applies opinionated best practices for Java projects targeting Java 25. This recipe includes the full Java 25 upgrade chain plus additional improvements to code style, API usage, and third-party dependency reduction that go beyond what the version migration recipes apply.
  • org.openrewrite.java.migrate.RemoveSecurityManager
    • Remove Security SecurityManager
    • The Security Manager API is unsupported in Java 24. This recipe will remove the usage of java.security.SecurityManager.
  • org.openrewrite.java.migrate.RemoveSecurityPolicy
    • Remove Security Policy
    • The Security Manager API is unsupported in Java 24. This recipe will remove the use of java.security.Policy.
  • org.openrewrite.java.migrate.SystemGetSecurityManagerToNull
    • Replace System.getSecurityManager() with null
    • The Security Manager API is unsupported in Java 24. This recipe will replace System.getSecurityManager() with null to make its behavior more obvious and try to simplify execution paths afterwards.
  • org.openrewrite.java.migrate.UpgradePluginsForJava25
    • Upgrade plugins to Java 25 compatible versions
    • Updates plugins and dependencies to versions compatible with Java 25.
  • org.openrewrite.java.migrate.UpgradeToJava25
    • Migrate to Java 25
    • This recipe will apply changes commonly needed when migrating to Java 25. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 25 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 25.

java6

1 recipe

  • org.openrewrite.java.migrate.UpgradeToJava6
    • Migrate to Java 6
    • This recipe will apply changes commonly needed when upgrading to Java 6. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy.

java7

1 recipe

  • org.openrewrite.java.migrate.UpgradeToJava7
    • Migrate to Java 7
    • This recipe will apply changes commonly needed when upgrading to Java 7. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy.

java8

1 recipe

  • org.openrewrite.java.migrate.UpgradeToJava8
    • Migrate to Java 8
    • This recipe will apply changes commonly needed when upgrading to Java 8. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy.

javaee

2 recipes

  • org.openrewrite.java.migrate.javax.AddJaxbRuntime
    • Use latest JAXB API and runtime for Jakarta EE 8
    • Update build files to use the latest JAXB runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAXB run-time, in Gradle compileOnly+testImplementation and Maven provided scope, to any project that has a transitive dependency on the JAXB API. The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact.
  • org.openrewrite.java.migrate.javax.AddJaxwsRuntime
    • Use the latest JAX-WS API and runtime for Jakarta EE 8
    • Update build files to use the latest JAX-WS runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAX-WS run-time, in Gradle compileOnly+testImplementation and Maven provided scope, to any project that has a transitive dependency on the JAX-WS API. The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact.

javaee6

1 recipe

javaee7

2 recipes

javaee8

1 recipe

javascript

1 recipe

javax

37 recipes

jaxb

12 recipes

  • com.oracle.weblogic.rewrite.jakarta.JavaxBindingsSchemaXjbsToJakarta9BindingsSchemaXjbs
    • Migrate xmlns entries in *.xjb files.
    • Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
  • io.quarkus.updates.core.quarkus30.JavaxXmlBindMigrationToJakartaXmlBind
    • Migrate deprecated javax.xml.bind packages to jakarta.xml.bind
    • Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
  • org.openrewrite.java.migrate.Java8toJava11
    • Migrate to Java 11
    • This recipe will apply changes commonly needed when upgrading to Java 11. Specifically, for those applications that are built on Java 8, this recipe will update and add dependencies on J2EE libraries that are no longer directly bundled with the JDK. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 11 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 11.
  • org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta
    • Migrate to Jakarta EE 9
    • Jakarta EE 9 is the first version of Jakarta EE that uses the new jakarta namespace.
  • org.openrewrite.java.migrate.jakarta.JavaxXmlBindMigrationToJakartaXmlBind
    • Migrate deprecated javax.xml.bind packages to jakarta.xml.bind
    • Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
  • org.openrewrite.java.migrate.jakarta.JavaxXmlToJakartaXmlXJCBinding
    • Migrate XJC Bindings to Jakata XML
    • Java EE has been rebranded to Jakarta EE, migrates the namespace and version in XJC bindings.
  • org.openrewrite.java.migrate.jakarta.RetainJaxbApiForJackson
    • Retain javax.xml.bind:jaxb-api when jackson-module-jaxb-annotations is present
    • When migrating from javax.xml.bind to jakarta.xml.bind 3.0+, the javax.xml.bind:jaxb-api dependency is normally replaced. However, if jackson-module-jaxb-annotations is on the classpath (and still uses the javax.xml.bind namespace), this recipe ensures javax.xml.bind:jaxb-api remains available as a runtime dependency to prevent NoClassDefFoundError.
  • org.openrewrite.java.migrate.javax.AddJaxbAPIDependencies
    • Add explicit JAXB API dependencies
    • This recipe will add explicit API dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the javax.xml.bind namespace. Running a full javax to Jakarta migration using org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta will update to versions greater than 3.x which necessitates the package change as well.
  • org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithRuntime
    • Add explicit JAXB API dependencies and runtime
    • This recipe will add explicit dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the javax.xml.bind namespace. Running a full javax to Jakarta migration using org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta will update to versions greater than 3.x which necessitates the package change as well.
  • org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithoutRuntime
    • Add explicit JAXB API dependencies and remove runtimes
    • This recipe will add explicit API dependencies without runtime dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing API dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the javax.xml.bind namespace. All JAXB runtime implementation dependencies are removed.
  • org.openrewrite.java.migrate.javax.AddJaxbRuntime
    • Use latest JAXB API and runtime for Jakarta EE 8
    • Update build files to use the latest JAXB runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAXB run-time, in Gradle compileOnly+testImplementation and Maven provided scope, to any project that has a transitive dependency on the JAXB API. The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact.
  • org.openrewrite.java.migrate.javax.AddJaxwsDependencies
    • Add explicit JAX-WS dependencies
    • This recipe will add explicit dependencies for Jakarta EE 8 when a Java 8 application is using JAX-WS. Any existing dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 but the application can continue to use the javax.xml.bind namespace.

jaxrs

1 recipe

jaxws

5 recipes

  • io.quarkus.updates.core.quarkus30.JavaxXmlWsMigrationToJakartaXmlWs
    • Migrate deprecated javax.xml.ws packages to jakarta.xml.ws
    • Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
  • org.openrewrite.java.migrate.Java8toJava11
    • Migrate to Java 11
    • This recipe will apply changes commonly needed when upgrading to Java 11. Specifically, for those applications that are built on Java 8, this recipe will update and add dependencies on J2EE libraries that are no longer directly bundled with the JDK. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 11 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 11.
  • org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta
    • Migrate to Jakarta EE 9
    • Jakarta EE 9 is the first version of Jakarta EE that uses the new jakarta namespace.
  • org.openrewrite.java.migrate.jakarta.JavaxXmlWsMigrationToJakartaXmlWs
    • Migrate deprecated javax.xml.ws packages to jakarta.xml.ws
    • Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
  • org.openrewrite.java.migrate.javax.AddJaxwsRuntime
    • Use the latest JAX-WS API and runtime for Jakarta EE 8
    • Update build files to use the latest JAX-WS runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAX-WS run-time, in Gradle compileOnly+testImplementation and Maven provided scope, to any project that has a transitive dependency on the JAX-WS API. The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact.

jboss

2 recipes

jdbc

4 recipes

JDK

1 recipe

jdo

4 recipes

Jest

17 recipes

jetbrains

1 recipe

jetty

1 recipe

  • org.openrewrite.java.spring.boot3.DowngradeServletApiWhenUsingJetty
    • Downgrade Jakarta Servlet API to 5.0 when using Jetty
    • Jetty does not yet support Servlet 6.0. This recipe will detect the presence of the spring-boot-starter-jetty as a first-order dependency and will add the maven property jakarta-servlet.version setting it's value to 5.0.0. This will downgrade the jakarta-servlet artifact if the pom's parent extends from the spring-boot-parent.

jmockit

1 recipe

jms

5 recipes

jobXML

1 recipe

joda

1 recipe

  • org.openrewrite.java.joda.time.NoJodaTime
    • Prefer the Java standard library instead of Joda-Time
    • Before Java 8, Java lacked a robust date and time library, leading to the widespread use of Joda-Time to fill this gap. With the release of Java 8, the java.time package was introduced, incorporating most of Joda-Time's concepts. Features deemed too specialized or bulky for java.time were included in the ThreeTen-Extra library. This recipe migrates Joda-Time types to java.time and threeten-extra types.
    • Tags: joda-time

jpa

7 recipes

jsf

29 recipes

jsp

1 recipe

jsptaglibrary

1 recipe

jsr250

1 recipe

JtaTransactionManager

1 recipe

junit

22 recipes

jupiter

2 recipes

kafka

5 recipes

lang

1 recipe

LoadTimeWeaver

1 recipe

local

1 recipe

lodash

4 recipes

  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreArray
    • Replace lodash and underscore array functions with native JavaScript
      • _.head(x) -> x[0] - _.head(x, n) -> x.slice(n) - _.first (alias for _.head) - _.tail(x) -> x.slice(1) - _.tail(x, n) -> x.slice(n) - _.rest (alias for _.tail) - _.last(x) -> x[x.length - 1] - _.last(x, n) -> x.slice(x.length - n).
  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreFunction
    • Replace lodash and underscore function functions with native JavaScript
      • _.bind(fn, obj, ...x) -> fn.bind(obj, ...x) - _.partial(fn, a, b); -> (...args) => fn(a, b, ...args).
  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreObjects
    • Replace lodash and underscore object functions with native JavaScript
      • _.clone(x) -> \{ ...x \} - _.extend(\{\}, x, y) -> \{ ...x, ...y \} - _.extend(obj, x, y) -> Object.assign(obj, x, y) - _.keys(x) -> Object.keys(x) - _.pairs(x) -> Object.entries(x) - _.values(x) -> Object.values(x).
  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreUtil
    • Replace lodash and underscore utility functions with native JavaScript
      • _.isArray(x) -> Array.isArray(x) - _.isBoolean(x) -> typeof(x) === 'boolean' - _.isFinite(x) -> Number.isFinite(x) - _.isFunction(x) -> typeof(x) === 'function' - _.isNull(x) -> x === null - _.isString(x) -> typeof(x) === 'string' - _.isUndefined(x) -> typeof(x) === 'undefined'.

log4j

10 recipes

log4shell

1 recipe

logback

1 recipe

logging

24 recipes

lombok

6 recipes

mail

1 recipe

material

78 recipes

math

1 recipe

  • org.openrewrite.apache.commons.math.UpgradeApacheCommonsMath_2_3
    • Migrates to Apache Commons Math 3.x
    • Migrate applications to the latest Apache Commons Math 3.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.

maven

2 recipes

messaging

2 recipes

metrics

1 recipe

  • org.openrewrite.quarkus.spring.MigrateSpringActuator
    • Migrate Spring Boot Actuator to Quarkus Health and Metrics
    • Migrates Spring Boot Actuator to Quarkus SmallRye Health and Metrics extensions. Converts HealthIndicator implementations to Quarkus HealthCheck pattern.

micrometer

3 recipes

migration

28 recipes

mockito

7 recipes

mongodb

2 recipes

mui

78 recipes

mvc

1 recipe

myfaces

5 recipes

mysql

1 recipe

namespaces

1 recipe

native

1 recipe

  • org.openrewrite.quarkus.spring.ConfigureNativeBuild
    • Configure Quarkus Native Build Support
    • Adds configuration and dependencies required for Quarkus native image compilation with GraalVM. Includes native profile configuration and reflection hints where needed.

netty

6 recipes

networking

1 recipe

newrelic

1 recipe

nextjs

12 recipes

nio

1 recipe

nodejs

1 recipe

non

1 recipe

oauth2

2 recipes

observability

2 recipes

okhttp

1 recipe

omnifaces

6 recipes

openapi

10 recipes

opentelemetry

7 recipes

opentofu

1 recipe

opentracing

1 recipe

optimization

1 recipe

  • org.openrewrite.docker.DockerBuildOptimization
    • Optimize Docker builds
    • Apply build optimization best practices to Dockerfiles. This includes combining RUN instructions to reduce layers and adding cleanup commands to reduce image size.

oracle

1 recipe

orm

2 recipes

oss

1 recipe

panache

2 recipes

permissions

1 recipe

persistence

7 recipes

petclinic

2 recipes

plain text

1 recipe

  • org.openrewrite.text.ChangeText
    • Change text
    • Completely replaces the contents of the text file with other text. Use together with a FindSourceFiles precondition to limit which files are changed.

plugin

1 recipe

poi

3 recipes

  • org.openrewrite.apache.poi.UpgradeApachePoi_3_17
    • Migrates to Apache POI 3.17
    • Migrates to the last Apache POI 3.x release. This recipe modifies build files and makes changes to deprecated/preferred APIs that have changed between versions.
  • org.openrewrite.apache.poi.UpgradeApachePoi_4_1
    • Migrates to Apache POI 4.1.2
    • Migrates to the last Apache POI 4.x release. This recipe modifies build files and makes changes to deprecated/preferred APIs that have changed between versions.
  • org.openrewrite.apache.poi.UpgradeApachePoi_5
    • Migrates to Apache POI 5.x
    • Migrates to the latest Apache POI 5.x release. This recipe modifies build files to account for artifact renames and upgrades dependency versions. It also chains the 4.1 recipe to handle all prior API migrations.

postgresql

1 recipe

primefaces

4 recipes

pubsub

2 recipes

quarkus

53 recipes

quartz

1 recipe

ra

3 recipes

rabbitmq

1 recipe

rdbms

2 recipes

reactive

4 recipes

redis

1 recipe

refactoring

1 recipe

  • org.openrewrite.java.migrate.lang.UseVar
    • Use local variable type inference
    • Apply local variable type inference (var) for primitives and objects. These recipes can cause unused imports, be advised to run `org.openrewrite.java.RemoveUnusedImports afterwards.

resource

2 recipes

rest

1 recipe

RSPEC

215 recipes

  • org.openrewrite.cobol.cleanup.RemoveWithDebuggingMode
    • Remove with debugging mode
    • Remove debugging mode from SOURCE-COMPUTER paragraphs.
    • Tags: RSPEC-4057
  • org.openrewrite.java.RemoveUnusedImports
    • Remove unused imports
    • Remove imports for types that are not referenced. As a precaution against incorrect changes no imports will be removed from any source where unknown types are referenced.
    • Tags: RSPEC-S1128
  • org.openrewrite.java.format.EmptyNewlineAtEndOfFile
    • End files with a single newline
    • Some tools work better when files end with an empty line.
    • Tags: RSPEC-S113
  • org.openrewrite.java.format.WrappingAndBraces
    • Wrapping and braces
    • Format line wraps and braces in Java code.
    • Tags: RSPEC-S121, RSPEC-S2681, RSPEC-S3972, RSPEC-S3973
  • org.openrewrite.java.logging.ParameterizedLogging
    • Parameterize logging statements
    • Transform logging statements using concatenation for messages and variables into a parameterized format. For example, logger.info("hi " + userName) becomes logger.info("hi \{\}", userName). This can significantly boost performance for messages that otherwise would be assembled with String concatenation. Particularly impactful when the log level is not enabled, as no work is done to assemble the message.
    • Tags: RSPEC-S2629, RSPEC-S3457
  • org.openrewrite.java.logging.slf4j.LoggersNamedForEnclosingClass
    • Loggers should be named for their enclosing classes
    • Ensure LoggerFactory#getLogger(Class) is called with the enclosing class as argument.
    • Tags: RSPEC-S3416
  • org.openrewrite.java.logging.slf4j.ParameterizedLogging
    • Parameterize SLF4J's logging statements
    • Use SLF4J's parameterized logging, which can significantly boost performance for messages that otherwise would be assembled with String concatenation. Particularly impactful when the log level is not enabled, as no work is done to assemble the message.
    • Tags: RSPEC-S2629
  • org.openrewrite.java.migrate.guava.NoGuavaCreateTempDir
    • Prefer Files#createTempDirectory()
    • Replaces Guava Files#createTempDir() with Java Files#createTempDirectory(..). Transformations are limited to scopes throwing or catching java.io.IOException.
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.NoGuavaOptionalFromJavaUtil
    • Replace com.google.common.base.Optional#fromJavaUtil(java.util.Optional) with argument
    • Replaces com.google.common.base.Optional#fromJavaUtil(java.util.Optional) with argument.
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.NoGuavaOptionalToJavaUtil
    • Remove com.google.common.base.Optional#toJavaUtil()
    • Remove calls to com.google.common.base.Optional#toJavaUtil().
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.PreferJavaUtilFunction
    • Prefer java.util.function.Function
    • Prefer java.util.function.Function instead of using com.google.common.base.Function.
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.PreferJavaUtilOptional
    • Prefer java.util.Optional
    • Prefer java.util.Optional instead of using com.google.common.base.Optional.
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.PreferJavaUtilOptionalOrElseNull
    • Prefer java.util.Optional#orElse(null) over com.google.common.base.Optional#orNull()
    • Replaces com.google.common.base.Optional#orNull() with java.util.Optional#orElse(null).
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.PreferJavaUtilOptionalOrSupplier
    • Prefer java.util.Optional#or(Supplier<T extends java.util.Optional<T>>)
    • Prefer java.util.Optional#or(Supplier<T extends java.util.Optional<T>>) over `com.google.common.base.Optional#or(com.google.common.base.Optional).
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.PreferJavaUtilPredicate
    • Prefer java.util.function.Predicate
    • Prefer java.util.function.Predicate instead of using com.google.common.base.Predicate.
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.guava.PreferJavaUtilSupplier
    • Prefer java.util.function.Supplier
    • Prefer java.util.function.Supplier instead of using com.google.common.base.Supplier.
    • Tags: RSPEC-S4738
  • org.openrewrite.java.migrate.util.ReplaceStreamCollectWithToList
    • Replace Stream.collect(Collectors.toUnmodifiableList()) with Stream.toList()
    • Replace Stream.collect(Collectors.toUnmodifiableList()) with Java 16+ Stream.toList(). Also replaces Stream.collect(Collectors.toList()) if convertToList is set to true.
    • Tags: RSPEC-S6204
  • org.openrewrite.java.search.FindEmptyClasses
    • Find empty classes
    • Find empty classes without annotations that do not implement an interface or extend a class.
    • Tags: RSPEC-S2094
  • org.openrewrite.java.search.FindEmptyMethods
    • Find methods with empty bodies
    • Find methods with empty bodies and single public no arg constructors.
    • Tags: RSPEC-S1186
  • org.openrewrite.java.search.ResultOfMethodCallIgnored
    • Result of method call ignored
    • Find locations where the result of the method call is being ignored.
    • Tags: RSPEC-S6809
  • org.openrewrite.java.spring.NoRequestMappingAnnotation
    • Remove @RequestMapping annotations
    • Replace method declaration @RequestMapping annotations with @GetMapping, @PostMapping, etc. when possible.
    • Tags: RSPEC-S4488
  • org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion
    • Simplify AssertJ chained assertions
    • Many AssertJ chained assertions have dedicated assertions that function the same. It is best to use the dedicated assertions.
    • Tags: RSPEC-S5838
  • org.openrewrite.java.testing.cleanup.AssertionsArgumentOrder
    • Assertion arguments should be passed in the correct order
    • Assertions such as org.junit.Assert.assertEquals expect the first argument to be the expected value and the second argument to be the actual value; for org.testng.Assert, it’s the other way around. This recipe detects J.Literal, J.NewArray, and java.util.Iterable arguments swapping them if necessary so that the error messages won't be confusing.
    • Tags: RSPEC-S3415
  • org.openrewrite.java.testing.cleanup.RemoveEmptyTests
    • Remove empty tests without comments
    • Removes empty methods with a @Test annotation if the body does not have comments.
    • Tags: RSPEC-S1186
  • org.openrewrite.java.testing.cleanup.TestsShouldIncludeAssertions
    • Include an assertion in tests
    • For tests not having any assertions, wrap the statements with JUnit Jupiter's Assertions#assertDoesNotThrow(..).
    • Tags: RSPEC-S2699
  • org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic
    • Remove public visibility of JUnit 5 tests
    • Remove public and optionally protected modifiers from methods with @Test, @ParameterizedTest, @RepeatedTest, @TestFactory, @BeforeEach, @AfterEach, @BeforeAll, or @AfterAll. They no longer have to be public visibility to be usable by JUnit 5.
    • Tags: RSPEC-S5786
  • org.openrewrite.java.testing.junit5.AddMissingNested
    • JUnit 5 inner test classes should be annotated with @Nested
    • Adds @Nested to inner classes that contain JUnit 5 tests.
    • Tags: RSPEC-S5790
  • org.openrewrite.java.testing.junit5.RemoveTryCatchFailBlocks
    • Replace fail() in try-catch blocks with Assertions.assertDoesNotThrow(() -> \{ ... \})
    • Replace try-catch blocks where catch merely contains a fail() for fail(String) statement with Assertions.assertDoesNotThrow(() -> \{ ... \}).
    • Tags: RSPEC-S3658
  • org.openrewrite.java.testing.mockito.SimplifyMockitoVerifyWhenGiven
    • Call to Mockito method "verify", "when" or "given" should be simplified
    • Fixes Sonar issue java:S6068: Call to Mockito method "verify", "when" or "given" should be simplified.
    • Tags: RSPEC-6068
  • org.openrewrite.kotlin.cleanup.EqualsMethodUsage
    • Structural equality tests should use == or !=
    • In Kotlin, == means structural equality and != structural inequality and both map to the left-side term’s equals() function. It is, therefore, redundant to call equals() as a function. Also, == and != are more general than equals() and !equals() because it allows either of both operands to be null. Developers using equals() instead of == or != is often the result of adapting styles from other languages like Java, where == means reference equality and != means reference inequality. The == and != operators are a more concise and elegant way to test structural equality than calling a function.
    • Tags: RSPEC-S6519
  • org.openrewrite.kotlin.cleanup.ImplicitParameterInLambda
    • it shouldn't be used as a lambda parameter name
    • it is a special identifier that allows you to refer to the current parameter being passed to a lambda expression without explicitly naming the parameter. Lambda expressions are a concise way of writing anonymous functions. Many lambda expressions have only one parameter, when this is true the compiler can determine the parameter type by context. Thus when using it with single parameter lambda expressions, you do not need to declare the type.
    • Tags: RSPEC-S6558
  • org.openrewrite.maven.OrderPomElements
    • Order POM elements
    • Order POM elements according to the recommended order.
    • Tags: RSPEC-S3423
  • org.openrewrite.staticanalysis.AbstractClassPublicConstructor
    • Constructors of an abstract class should not be declared public
    • Constructors of abstract classes can only be called in constructors of their subclasses. Therefore the visibility of public constructors are reduced to protected. Declaring them public is misleading since it implies they could be invoked directly, which is never possible.
    • Tags: RSPEC-S5993
  • org.openrewrite.staticanalysis.AddSerialVersionUidToSerializable
    • Add serialVersionUID to a Serializable class when missing
    • A serialVersionUID field is strongly recommended in all Serializable classes. If this is not defined on a Serializable class, the compiler will generate this value. If a change is later made to the class, the generated value will change and attempts to deserialize the class will fail. Explicitly declaring this field gives you control over binary compatibility across versions.
    • Tags: RSPEC-S2057
  • org.openrewrite.staticanalysis.AtomicPrimitiveEqualsUsesGet
    • Atomic Boolean, Integer, and Long equality checks compare their values
    • AtomicBoolean#equals(Object), AtomicInteger#equals(Object) and AtomicLong#equals(Object) are only equal to their instance. This recipe converts a.equals(b) to a.get() == b.get(). These atomic classes do not override equals from Object, so calling it compares object identity rather than the wrapped value, which is almost never the intended behavior.
    • Tags: RSPEC-S2204
  • org.openrewrite.staticanalysis.AvoidBoxedBooleanExpressions
    • Avoid boxed boolean expressions
    • Under certain conditions the java.lang.Boolean type is used as an expression, and it may throw a NullPointerException if the value is null. Using Boolean.TRUE.equals(...) guards against unboxing a null reference in control flow positions like if conditions and ternary operators.
    • Tags: RSPEC-S5411
  • org.openrewrite.staticanalysis.BigDecimalDoubleConstructorRecipe
    • new BigDecimal(double) should not be used
    • Use of new BigDecimal(double) constructor can lead to loss of precision. Use BigDecimal.valueOf(double) instead. For example writing new BigDecimal(0.1) does not create a BigDecimal which is exactly equal to 0.1, but it is equal to 0.1000000000000000055511151231257827021181583404541015625. This is because 0.1 cannot be represented exactly as a double (or, for that matter, as a binary fraction of any finite length). BigDecimal.valueOf avoids this by converting through a string representation, preserving the value you actually intended.
    • Tags: RSPEC-S2111
  • org.openrewrite.staticanalysis.BigDecimalRoundingConstantsToEnums
    • BigDecimal rounding constants to RoundingMode enums
    • Convert BigDecimal rounding constants to the equivalent RoundingMode enum. The integer-based rounding constants on BigDecimal are deprecated and lack type safety; the RoundingMode enum makes the rounding behavior self-documenting and prevents invalid values.
    • Tags: RSPEC-S2111
  • org.openrewrite.staticanalysis.BooleanChecksNotInverted
    • Boolean checks should not be inverted
    • Ensures that boolean checks are not unnecessarily inverted. Also fixes double negative boolean expressions. Negating a comparison and then inverting it adds cognitive overhead; using the direct operator (e.g., >= instead of !(... < ...)) is clearer and easier to reason about.
    • Tags: RSPEC-S1940
  • org.openrewrite.staticanalysis.CaseInsensitiveComparisonsDoNotChangeCase
    • CaseInsensitive comparisons do not alter case
    • Remove String#toLowerCase() or String#toUpperCase() from String#equalsIgnoreCase(..) comparisons. Changing case before a case-insensitive comparison is redundant and allocates unnecessary intermediate String objects.
    • Tags: RSPEC-S1157
  • org.openrewrite.staticanalysis.CatchClauseOnlyRethrows
    • Catch clause should do more than just rethrow
    • A catch clause that only rethrows the caught exception is unnecessary. Letting the exception bubble up as normal achieves the same result with less code. Such catch blocks add visual noise and indentation without changing program behavior.
    • Tags: RSPEC-S2737
  • org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls
    • Chain StringBuilder.append() calls
    • String concatenation within calls to StringBuilder.append() causes unnecessary memory allocation. Except for concatenations of String literals, which are joined together at compile time. Replaces inefficient concatenations with chained calls to StringBuilder.append(). Using + inside append() defeats the purpose of the StringBuilder, since the concatenation creates a temporary String before appending.
    • Tags: RSPEC-S3024
  • org.openrewrite.staticanalysis.CollectionToArrayShouldHaveProperType
    • 'Collection.toArray()' should be passed an array of the proper type
    • Using Collection.toArray() without parameters returns an Object[], which requires casting. It is more efficient and clearer to use Collection.toArray(new T[0]) instead. The parameterless form can cause a ClassCastException at runtime when the returned Object[] is cast to a more specific array type.
    • Tags: RSPEC-S3020
  • org.openrewrite.staticanalysis.CombineSemanticallyEqualCatchBlocks
    • Combine semantically equal catch blocks
    • Combine catches in a try that contain semantically equivalent blocks. No change will be made when a caught exception exists if combining catches may change application behavior or type attribution is missing. Merging duplicate catch bodies into multi-catch blocks reduces repetition and makes the exception handling strategy easier to follow.
    • Tags: RSPEC-S2147
  • org.openrewrite.staticanalysis.CommonDeclarationSiteTypeVariances
    • Properly use declaration-site type variance for well-known types
    • When using a method parameter like Function<IN, OUT>, it should rather be Function<? super IN, ? extends OUT>. This recipe checks for method parameters of well-known types.
    • Tags: RSPEC-S1217
  • org.openrewrite.staticanalysis.CompareEnumsWithEqualityOperator
    • Enum values should be compared with "=="
    • Replaces Enum equals(java.lang.Object) with Enum == java.lang.Object. An !Enum equals(java.lang.Object) will change to !=. Using == for enum comparison is null-safe, catches type mismatches at compile time, and is idiomatic since each enum constant is guaranteed to be a singleton.
    • Tags: RSPEC-S4551
  • org.openrewrite.staticanalysis.ControlFlowIndentation
    • Control flow statement indentation
    • Program flow control statements like if, while, and for can omit curly braces when they apply to only a single statement. This recipe ensures that any statements which follow that statement are correctly indented to show they are not part of the flow control statement. Misleading indentation can give the false impression that a line executes conditionally when it actually runs unconditionally, which is a common source of logic errors.
    • Tags: RSPEC-S2681
  • org.openrewrite.staticanalysis.CovariantEquals
    • Covariant equals
    • Checks that classes and records which define a covariant equals() method also override method equals(Object). Covariant equals() means a method that is similar to equals(Object), but with a covariant parameter type (any subtype of Object). Without a proper equals(Object) override, collections and other framework code that rely on the standard signature will silently use Object.equals, leading to incorrect behavior.
    • Tags: RSPEC-S2162
  • org.openrewrite.staticanalysis.DefaultComesLast
    • Default comes last
    • Ensure the default case comes last after all the cases in a switch statement. Placing default at the end follows a widely expected convention, making it easy to find the fallback behavior at a glance.
    • Tags: RSPEC-S4524
  • org.openrewrite.staticanalysis.EmptyBlock
    • Remove empty blocks
    • Remove empty blocks that effectively do nothing. Empty blocks are ambiguous -- they may indicate incomplete implementation or accidentally deleted code -- and removing them makes the intent of the surrounding code explicit.
    • Tags: RSPEC-S108
  • org.openrewrite.staticanalysis.EqualsAvoidsNull
    • Equals avoids null
    • Checks that any combination of String literals is on the left side of an equals() comparison. Also checks for String literals assigned to some field (such as someString.equals(anotherString = "text")). And removes redundant null checks in conjunction with equals comparisons. Placing the literal on the left side prevents NullPointerExceptions, since a literal can never be null and its equals method handles null arguments safely.
    • Tags: RSPEC-S1132
  • org.openrewrite.staticanalysis.ExplicitCharsetOnStringGetBytes
    • Set charset encoding explicitly when calling String#getBytes
    • This makes the behavior of the code platform neutral. It will not override any existing explicit encodings, even if they don't match the default encoding option. Relying on the platform default charset can produce different results across environments, leading to subtle data corruption bugs.
    • Tags: RSPEC-S4719
  • org.openrewrite.staticanalysis.ExplicitInitialization
    • Explicit initialization
    • Checks if any class or object member is explicitly initialized to default for its type value: - null for object references - zero for numeric types and char - and false for boolean Removes explicit initializations where they aren't necessary. Since the JVM already guarantees these defaults, restating them adds visual noise and can obscure fields that are intentionally initialized to non-default values.
    • Tags: RSPEC-S3052
  • org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes
    • Use explicit types on lambda arguments
    • Adds explicit types on lambda arguments, which are otherwise optional. This can make the code clearer and easier to read. This does not add explicit types on arguments when the lambda has one or two parameters and does not have a block body, as things are considered more readable in those cases. For example, stream.map((a, b) -> a.length); will not have explicit types added.
    • Tags: RSPEC-S2211
  • org.openrewrite.staticanalysis.ExternalizableHasNoArgsConstructor
    • Externalizable classes have no-arguments constructor
    • Externalizable classes handle both serialization and deserialization and must have a no-args constructor for the deserialization process. Without a public no-argument constructor, the JVM cannot instantiate the object during deserialization and will throw an InvalidClassException at runtime.
    • Tags: RSPEC-S2060
  • org.openrewrite.staticanalysis.FallThrough
    • Fall through
    • Checks for fall-through in switch statements, adding break statements in locations where a case contains Java code but does not have a break, return, throw, or continue statement. Unintentional fall-through is a common source of bugs, as execution silently continues into the next case branch.
    • Tags: RSPEC-S128
  • org.openrewrite.staticanalysis.FinalClass
    • Finalize classes with private constructors
    • Adds the final modifier to classes that expose no public or package-private constructors. If a class cannot be instantiated from the outside, marking it final communicates that it was not designed for inheritance and prevents accidental subclassing.
    • Tags: RSPEC-S2974
  • org.openrewrite.staticanalysis.FixStringFormatExpressions
    • Fix String#format and String#formatted expressions
    • Fix String#format and String#formatted expressions by replacing \n newline characters with %n and removing any unused arguments. Note this recipe is scoped to only transform format expressions which do not specify the argument index. Using %n ensures the correct platform-specific line separator, and removing unused arguments eliminates dead code that may mask a mismatch between the format string and its parameters.
    • Tags: RSPEC-S3457
  • org.openrewrite.staticanalysis.ForLoopIncrementInUpdate
    • for loop counters incremented in update
    • The increment should be moved to the loop's increment clause if possible. Placing the counter update in the loop body rather than the update clause obscures the loop's control flow and makes it harder to reason about termination.
    • Tags: RSPEC-S1994
  • org.openrewrite.staticanalysis.HiddenField
    • Hidden field
    • Refactor local variables or parameters which shadow a field defined in the same class. Shadowing a field with a local variable of the same name makes it easy to accidentally reference the wrong one, leading to confusing bugs.
    • Tags: RSPEC-S1117, RSPEC-S2387
  • org.openrewrite.staticanalysis.HideUtilityClassConstructor
    • Hide utility class constructor
    • Ensures utility classes (classes containing only static methods or fields in their API) do not have a public constructor. Instantiating a utility class is almost certainly a mistake, and a private constructor makes that intent clear while preventing misuse.
    • Tags: RSPEC-S1118
  • org.openrewrite.staticanalysis.IndexOfChecksShouldUseAStartPosition
    • Use indexOf(String, int)
    • Replaces indexOf(String) in binary operations if the compared value is an int and not less than 1. Using the two-argument indexOf(String, int) form with a start position avoids redundantly scanning the beginning of the string when you already know the match must occur after a certain index.
    • Tags: RSPEC-S2912
  • org.openrewrite.staticanalysis.IndexOfReplaceableByContains
    • indexOf() replaceable by contains()
    • Checking if a value is included in a String or List using indexOf(value)>-1 or indexOf(value)>=0 can be replaced with contains(value). Using contains() expresses the intent more directly and avoids the mental overhead of interpreting index comparisons.
    • Tags: RSPEC-S2692
  • org.openrewrite.staticanalysis.IndexOfShouldNotCompareGreaterThanZero
    • indexOf should not compare greater than zero
    • Replaces String#indexOf(String) > 0 and List#indexOf(Object) > 0 with >=1. Checking indexOf against >0 ignores the first element, whereas >-1 is inclusive of the first element. For clarity, >=1 is used, because >0 and >=1 are semantically equal. Using >0 may appear to be a mistake with the intent of including all elements. If the intent is to check whether a value in included in a String or List, the String#contains(String) or List#contains(Object) methods may be better options altogether.
    • Tags: RSPEC-S2692
  • org.openrewrite.staticanalysis.InlineVariable
    • Inline variable
    • Inline variables when they are immediately used to return or throw. Supports both variable declarations and assignments to local variables. A variable that is declared only to be returned or thrown on the very next line adds an unnecessary level of indirection without improving readability.
    • Tags: RSPEC-S1488
  • org.openrewrite.staticanalysis.InstanceOfPatternMatch
    • Changes code to use Java 17's instanceof pattern matching
    • Adds pattern variables to instanceof expressions wherever the same (side effect free) expression is referenced in a corresponding type cast expression within the flow scope of the instanceof. Currently, this recipe supports if statements and ternary operator expressions. Pattern matching for instanceof collapses the type check, cast, and variable declaration into a single expression, reducing boilerplate and eliminating the risk of an incorrect cast.
    • Tags: RSPEC-S6201
  • org.openrewrite.staticanalysis.InterruptedExceptionHandling
    • Restore interrupted state in catch blocks
    • When InterruptedException is caught, Thread.currentThread().interrupt() should be called to restore the thread's interrupted state. Failing to do so can suppress the interruption signal and prevent proper thread cancellation.
    • Tags: RSPEC-S2142
  • org.openrewrite.staticanalysis.IsEmptyCallOnCollections
    • Use Collection#isEmpty() instead of comparing size()
    • Also check for not isEmpty() when testing for not equal to zero size. Using isEmpty() communicates intent more clearly than comparing size() to zero, and for some collection implementations isEmpty() can be more efficient since size() may require traversal.
    • Tags: RSPEC-S1155, RSPEC-S3981
  • org.openrewrite.staticanalysis.LambdaBlockToExpression
    • Simplify lambda blocks to expressions
    • Single-line statement lambdas returning a value can be replaced with expression lambdas. Expression-form lambdas are more concise and consistent with a functional programming style, making the code easier to scan.
    • Tags: RSPEC-S1602
  • org.openrewrite.staticanalysis.LowercasePackage
    • Rename packages to lowercase
    • By convention all Java package names should contain only lowercase letters, numbers, and dashes. This recipe converts any uppercase letters in package names to be lowercase. Consistent package naming prevents confusion and potential issues on case-insensitive file systems.
    • Tags: RSPEC-S120
  • org.openrewrite.staticanalysis.MemberNameCaseInsensitiveDuplicates
    • Members should not have names differing only by capitalization
    • Looking at the set of methods and fields in a class and all of its parents, no two members should have names that differ only in capitalization. This rule will not report if a method overrides a parent method. Members with near-identical names are easily confused, leading to bugs where the wrong field or method is referenced.
    • Tags: RSPEC-S1845
  • org.openrewrite.staticanalysis.MethodNameCasing
    • Standardize method name casing
    • Fixes method names that do not follow standard naming conventions. For example, String getFoo_bar() would be adjusted to String getFooBar() and int DoSomething() would be adjusted to int doSomething(). Following a consistent casing convention for method names improves code readability and helps developers quickly distinguish methods from classes or constants.
    • Tags: RSPEC-S100
  • org.openrewrite.staticanalysis.MinimumSwitchCases
    • switch statements should have at least 3 case clauses
    • switch statements are useful when many code paths branch depending on the value of a single expression. For just one or two code paths, the code will be more readable with if statements. Using switch for trivial branching adds unnecessary syntactic overhead and obscures the simplicity of the logic.
    • Tags: RSPEC-S1301
  • org.openrewrite.staticanalysis.MissingOverrideAnnotation
    • Add missing @Override to overriding and implementing methods
    • Adds @Override to methods overriding superclass methods or implementing interface methods. Annotating methods improves readability by showing the author's intent to override. Additionally, when annotated, the compiler will emit an error when a signature of the overridden method does not match the superclass method.
    • Tags: RSPEC-S1161
  • org.openrewrite.staticanalysis.ModifierOrder
    • Modifier order
    • Modifiers should be declared in the correct order as recommended by the JLS. Ordering modifiers consistently reduces cognitive load for developers who are accustomed to the standard sequence.
    • Tags: RSPEC-S1124
  • org.openrewrite.staticanalysis.MultipleVariableDeclarations
    • No multiple variable declarations
    • Places each variable declaration in its own statement and on its own line. Using one variable declaration per line encourages commenting and can increase readability. Multi-variable declarations also make it harder to track individual types and initializers, increasing the risk of subtle errors.
    • Tags: RSPEC-S1659
  • org.openrewrite.staticanalysis.NeedBraces
    • Fix missing braces
    • Adds missing braces around code such as single-line if, for, while, and do-while block bodies. Omitting braces can lead to dangling-statement bugs when additional lines are later added to a block without realizing they fall outside the control structure.
    • Tags: RSPEC-S121
  • org.openrewrite.staticanalysis.NestedEnumsAreNotStatic
    • Nested enums are not static
    • Remove static modifier from nested enum types since they are implicitly static. The redundant modifier adds visual noise and may mislead readers into thinking there is a non-static alternative.
    • Tags: RSPEC-S2786
  • org.openrewrite.staticanalysis.NewStringBuilderBufferWithCharArgument
    • Change StringBuilder and StringBuffer character constructor argument to String
    • Instantiating a StringBuilder or a StringBuffer with a Character results in the int representation of the character being used for the initial size. This is almost never the developer's intent and silently produces a buffer with an arbitrary capacity instead of the expected initial content.
    • Tags: RSPEC-S1317
  • org.openrewrite.staticanalysis.NoDoubleBraceInitialization
    • No double brace initialization
    • Replace List, Map, and Set double brace initialization with an initialization block. Double brace initialization creates an anonymous inner class that holds a hidden reference to the enclosing instance, which can cause memory leaks and serialization issues.
    • Tags: RSPEC-S1171, RSPEC-S3599
  • org.openrewrite.staticanalysis.NoEmptyCollectionWithRawType
    • Use Collections#emptyList(), emptyMap(), and emptySet()
    • Replaces Collections#EMPTY_... with methods that return generic types. The raw-typed constant fields bypass generics checks, which can hide type mismatches that only surface as ClassCastException at runtime.
    • Tags: RSPEC-S1596
  • org.openrewrite.staticanalysis.NoEqualityInForCondition
    • Use comparison rather than equality checks in for conditions
    • Testing for loop termination using an equality operator (== and !=) is dangerous, because it could set up an infinite loop. Using a relational operator instead makes it harder to accidentally write an infinite loop.
    • Tags: RSPEC-S888
  • org.openrewrite.staticanalysis.NoFinalizer
    • Remove finalize() method
    • Finalizers are deprecated. Use of finalize() can lead to performance issues, deadlocks, hangs, and other undesirable behavior.
    • Tags: RSPEC-S1113
  • org.openrewrite.staticanalysis.NoPrimitiveWrappersForToStringOrCompareTo
    • No primitive wrappers for #toString() or #compareTo(..)
    • Primitive wrappers should not be instantiated only for #toString() or #compareTo(..) invocations. Allocating a wrapper object just to call a method that has a static equivalent is wasteful; the static versions avoid the unnecessary object creation.
    • Tags: RSPEC-S1158
  • org.openrewrite.staticanalysis.NoRedundantJumpStatements
    • Jump statements should not be redundant
    • Jump statements such as return and continue let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes.
    • Tags: RSPEC-S3626
  • org.openrewrite.staticanalysis.NoToStringOnStringType
    • Unnecessary String#toString
    • Remove unnecessary String#toString invocations on objects which are already a string. Calling toString() on something that is already a String is redundant and clutters the code.
    • Tags: RSPEC-S1858
  • org.openrewrite.staticanalysis.NoValueOfOnStringType
    • Unnecessary String#valueOf(..)
    • Replace unnecessary String#valueOf(..) method invocations with the argument directly. This occurs when the argument to String#valueOf(arg) is a string literal, such as String.valueOf("example"). Or, when the String#valueOf(..) invocation is used in a concatenation, such as "example" + String.valueOf("example"). The wrapping call is redundant since Java already performs the conversion implicitly in these contexts.
    • Tags: RSPEC-S1153
  • org.openrewrite.staticanalysis.ObjectFinalizeCallsSuper
    • finalize() calls super
    • Overrides of Object#finalize() should call super. Skipping the super call can prevent parent classes from releasing critical system resources during garbage collection.
    • Tags: RSPEC-S1114
  • org.openrewrite.staticanalysis.OnlyCatchDeclaredExceptions
    • Replace catch(Exception) with specific declared exceptions thrown in the try block
    • Replaces catch(Exception e) blocks with a multi-catch block (catch (SpecificException1 | SpecificException2 e)) containing only the exceptions declared thrown by method or constructor invocations within the try block that are not already caught by more specific catch clauses. Catching a broad Exception type can unintentionally swallow runtime exceptions that indicate programming errors, making bugs harder to detect and diagnose.
    • Tags: RSPEC-S2221
  • org.openrewrite.staticanalysis.PrimitiveWrapperClassConstructorToValueOf
    • Use primitive wrapper valueOf method
    • The constructor of all primitive types has been deprecated in favor of using the static factory method valueOf available for each of the primitive type wrappers. Using valueOf enables object caching for frequently used values, reducing unnecessary heap allocations.
    • Tags: RSPEC-S2129
  • org.openrewrite.staticanalysis.ReferentialEqualityToObjectEquals
    • Replace referential equality operators with Object equals method invocations when the operands both override Object.equals(Object obj)
    • Using == or != compares object references, not the equality of two objects. This modifies code where both sides of a binary operation (== or !=) override Object.equals(Object obj) except when the comparison is within an overridden Object.equals(Object obj) method declaration itself. The resulting transformation must be carefully reviewed since any modifications change the program's semantics. When a class defines its own notion of equality through equals, using reference comparison is almost always a bug that causes logically identical objects to be treated as different.
    • Tags: RSPEC-S1698
  • org.openrewrite.staticanalysis.RemoveCallsToObjectFinalize
    • Remove Object.finalize() invocations
    • Remove calls to Object.finalize(). This method is called during garbage collection and calling it manually is misleading. Explicit finalize invocations can trigger resource cleanup prematurely while the object is still in use, leading to unpredictable behavior.
    • Tags: RSPEC-S1111
  • org.openrewrite.staticanalysis.RemoveCallsToSystemGc
    • Remove garbage collection invocations
    • Removes calls to System.gc() and Runtime.gc(). When to invoke garbage collection is best left to the JVM. Manual GC calls produce unpredictable results across different JVM implementations and can cause unnecessary application pauses.
    • Tags: RSPEC-S1215
  • org.openrewrite.staticanalysis.RemoveExtraSemicolons
    • Remove extra semicolons
    • Removes not needed semicolons. Semicolons are considered not needed: * Optional semicolons at the end of try-with-resources, * after the last enum value if no field or method is defined, * no statement between two semicolon. Stray semicolons are typically typos or remnants of refactoring and can mislead readers into thinking a statement is present.
    • Tags: RSPEC-S1116, RSPEC-S2959
  • org.openrewrite.staticanalysis.RemoveHashCodeCallsFromArrayInstances
    • hashCode() should not be called on array instances
    • Replace hashCode() calls on arrays with Arrays.hashCode() because the results from hashCode() are not helpful. Arrays inherit hashCode() from Object, which returns an identity-based value unrelated to the array contents, so two arrays with identical elements will produce different hash codes.
    • Tags: RSPEC-S2116
  • org.openrewrite.staticanalysis.RemoveMethodsOnlyCallSuper
    • Remove methods that only call super
    • Methods that override a parent method but only call super with the same arguments are redundant and should be removed.
    • Tags: RSPEC-S1185
  • org.openrewrite.staticanalysis.RemoveRedundantNullCheckBeforeInstanceof
    • Remove redundant null checks before instanceof
    • Removes redundant null checks before instanceof operations since instanceof returns false for null. Removing the extra check simplifies the conditional and makes the null-safety guarantee of instanceof more visible to readers.
    • Tags: RSPEC-S1697
  • org.openrewrite.staticanalysis.RemoveRedundantTypeCast
    • Remove redundant casts
    • Removes unnecessary type casts. Does not currently check casts in lambdas and class constructors. Redundant casts add visual noise and can obscure the actual type relationships in the code, making it harder to follow the data flow.
    • Tags: RSPEC-S1905
  • org.openrewrite.staticanalysis.RemoveSystemOutPrintln
    • Remove System.out#println statements
    • Print statements are often left accidentally after debugging an issue. This recipe removes all System.out#println and System.err#println statements from the code. Production code should use a proper logging framework which provides consistent formatting, configurable log levels, and centralized output control.
    • Tags: RSPEC-S106
  • org.openrewrite.staticanalysis.RemoveToStringCallsFromArrayInstances
    • Remove toString() calls on arrays
    • The result from toString() calls on arrays is largely useless. The output does not actually reflect the contents of the array. Arrays.toString(array) should be used instead as it gives the contents of the array. Since arrays do not override toString() from Object, calling it produces only the type name and memory address, which is rarely what was intended.
    • Tags: RSPEC-S2116
  • org.openrewrite.staticanalysis.RemoveUnneededBlock
    • Remove unneeded block
    • Flatten blocks into inline statements when possible. Unnecessary nested blocks add indentation and scope boundaries that obscure the control flow, often indicating code that should be extracted into its own method.
    • Tags: RSPEC-S1199
  • org.openrewrite.staticanalysis.RemoveUnusedLabels
    • Remove unused labels
    • Remove labels that are not referenced by any break or continue statement.
    • Tags: RSPEC-S1065
  • org.openrewrite.staticanalysis.RemoveUnusedLocalVariables
    • Remove unused local variables
    • If a local variable is declared but not used, it is dead code and should be removed. Unused variables increase cognitive load for readers who must determine whether the variable matters, and they may signal incomplete implementations or missed refactoring.
    • Tags: RSPEC-S1481
  • org.openrewrite.staticanalysis.RemoveUnusedPrivateFields
    • Remove unused private fields
    • If a private field is declared but not used in the program, it can be considered dead code and should therefore be removed. Dead fields clutter the class, increase its memory footprint, and can mislead developers into thinking they are part of the class's behavior.
    • Tags: RSPEC-S1068
  • org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods
    • Remove unused private methods
    • private methods that are never executed are dead code and should be removed. Keeping unreachable methods around adds maintenance burden and can give a false impression of the class's capabilities.
    • Tags: RSPEC-S1144
  • org.openrewrite.staticanalysis.RenameLocalVariablesToCamelCase
    • Reformat local variable names to camelCase
    • Reformat local variable and method parameter names to camelCase to comply with Java naming convention. The recipe will not rename variables declared in for loop controls or catches with a single character. The first character is set to lower case and existing capital letters are preserved. Special characters that are allowed in java field names $ and _ are removed (unless the name starts with one). If a special character is removed the next valid alphanumeric will be capitalized. Currently, does not support renaming members of classes. The recipe will not rename a variable if the result already exists in the class, conflicts with a java reserved keyword, or the result is blank. Consistent naming conventions improve readability and reduce friction when navigating unfamiliar code.
    • Tags: RSPEC-S117
  • org.openrewrite.staticanalysis.RenameMethodsNamedHashcodeEqualOrToString
    • Rename methods named hashcode, equal, or tostring
    • Methods should not be named hashcode, equal, or tostring. Any of these are confusing as they appear to be intended as overridden methods from the Object base class, despite being case-insensitive. These near-miss names are almost certainly spelling mistakes that silently introduce a new method instead of overriding the intended one.
    • Tags: RSPEC-S1221
  • org.openrewrite.staticanalysis.RenamePrivateFieldsToCamelCase
    • Reformat private field names to camelCase
    • Reformat private field names to camelCase to comply with Java naming convention. The recipe will not rename fields with default, protected or public access modifiers. The recipe will not rename private constants. The first character is set to lower case and existing capital letters are preserved. Special characters that are allowed in java field names $ and _ are removed. If a special character is removed the next valid alphanumeric will be capitalized. The recipe will not rename a field if the result already exists in the class, conflicts with a java reserved keyword, or the result is blank. Consistent naming conventions improve code readability and help developers quickly understand the purpose and scope of fields.
    • Tags: RSPEC-S116, RSPEC-S3008
  • org.openrewrite.staticanalysis.ReplaceClassIsInstanceWithInstanceof
    • Replace A.class.isInstance(a) with a instanceof A
    • There should be no A.class.isInstance(a), it should be replaced by a instanceof A. Using instanceof enables the compiler to catch type incompatibilities at compile time rather than silently passing at runtime, which helps detect dead code early.
    • Tags: RSPEC-S6202
  • org.openrewrite.staticanalysis.ReplaceDuplicateStringLiterals
    • Replace duplicate String literals
    • Replaces String literals with a length of 5 or greater repeated a minimum of 3 times. Qualified String literals include final Strings, method invocations, and new class invocations. Adds a new private static final String or uses an existing equivalent class field. A new variable name will be generated based on the literal value if an existing field does not exist. The generated name will append a numeric value to the variable name if a name already exists in the compilation unit. Centralizing repeated string values into constants makes refactoring safer and reduces the risk of inconsistent updates.
    • Tags: RSPEC-S1192, RSPEC-S1889
  • org.openrewrite.staticanalysis.ReplaceLambdaWithMethodReference
    • Use method references in lambda
    • Replaces the single statement lambdas o -> o instanceOf X, o -> (A) o, o -> System.out.println(o), o -> o != null, o -> o == null with the equivalent method reference. Method references are often more concise and readable than their lambda equivalents, making the code's intent clearer at a glance.
    • Tags: RSPEC-S1612
  • org.openrewrite.staticanalysis.ReplaceStackWithDeque
    • Replace java.util.Stack with java.util.Deque
    • From the Javadoc of Stack: > A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class. Stack inherits from Vector, which carries unnecessary synchronization overhead in single-threaded contexts and exposes non-stack operations like random index access.
    • Tags: RSPEC-S1149
  • org.openrewrite.staticanalysis.ReplaceStringConcatenationWithStringValueOf
    • Replace String concatenation with String.valueOf()
    • Replace inefficient string concatenation patterns like "" + ... with String.valueOf(...). This improves code readability and may have minor performance benefits. The empty string prefix "" + is an indirect way to convert a value to a String, while String.valueOf() clearly communicates the conversion intent.
    • Tags: RSPEC-S1153
  • org.openrewrite.staticanalysis.ReplaceTextBlockWithString
    • Replace text block with regular string
    • Replace text block with a regular multi-line string. Text blocks that fit on a single line without concatenation or escaped newlines gain no readability benefit from the triple-quote syntax and are clearer as plain string literals.
    • Tags: RSPEC-S5663
  • org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
    • Replace calls to Thread.run() with Thread.start()
    • Thread.run() should not be called directly.
    • Tags: RSPEC-S1217
  • org.openrewrite.staticanalysis.ReplaceWeekYearWithYear
    • Week Year (YYYY) should not be used for date formatting
    • For most dates Week Year (YYYY) and Year (yyyy) yield the same results. However, on the last week of December and the first week of January, Week Year could produce unexpected results. This is a common source of off-by-one-year bugs that typically only manifest around New Year's Eve, making them difficult to catch during development and testing.
    • Tags: RSPEC-S3986
  • org.openrewrite.staticanalysis.SillyEqualsCheck
    • Silly equality checks should not be made
    • Detects .equals() calls that compare incompatible types and will always return false. Replaces .equals(null) with == null and array .equals() with Arrays.equals(). Flags comparisons between unrelated types or between arrays and non-arrays.
    • Tags: RSPEC-S2159
  • org.openrewrite.staticanalysis.SimplifyArraysAsList
    • Simplify Arrays.asList(..) with varargs
    • Simplifies Arrays.asList() method calls that use explicit array creation to use varargs instead. For example, Arrays.asList(new String[]\{"a", "b", "c"\}) becomes Arrays.asList("a", "b", "c"). Explicitly constructing an array to pass to a varargs parameter adds visual clutter without changing behavior, since the compiler generates the array automatically.
    • Tags: RSPEC-S3878
  • org.openrewrite.staticanalysis.SimplifyBooleanExpression
    • Simplify boolean expression
    • Checks for overly complicated boolean expressions, such as if (b == true), b || true, !false, etc. Needlessly complex boolean logic makes code harder to reason about and increases the chance of introducing errors during future modifications.
    • Tags: RSPEC-S1125
  • org.openrewrite.staticanalysis.SimplifyBooleanExpressionWithDeMorgan
    • Simplify boolean expressions using De Morgan's laws
    • Applies De Morgan's laws to simplify boolean expressions with negation. Transforms !(a && b) to !a || !b and !(a || b) to !a && !b. Distributing negations inward eliminates the outer ! and makes each individual condition's polarity immediately visible, which aids comprehension.
    • Tags: RSPEC-S1125
  • org.openrewrite.staticanalysis.SimplifyBooleanReturn
    • Simplify boolean return
    • Simplifies Boolean expressions by removing redundancies. For example, a && true simplifies to a. Wrapping a boolean expression in an if-then-else just to return true or false adds unnecessary control flow that obscures the straightforward intent of the expression.
    • Tags: RSPEC-S1126
  • org.openrewrite.staticanalysis.SimplifyConstantIfBranchExecution
    • Simplify constant if branch execution
    • Checks for if expressions that are always true or false and simplifies them. Branches that can never execute are dead code that misleads readers and may mask logic errors introduced during refactoring.
    • Tags: RSPEC-S6646
  • org.openrewrite.staticanalysis.SimplifyTernaryRecipes
    • Simplify ternary expressions
    • Simplifies various types of ternary expressions to improve code readability. Ternaries that simply select between true and false are redundant wrappers around the condition itself and add unnecessary complexity.
    • Tags: RSPEC-S1125
  • org.openrewrite.staticanalysis.StaticAccessViaInstance
    • Static members should be accessed via the class name
    • Accessing static fields or calling static methods on an instance reference is misleading. Static members should be accessed using the declaring class name instead.
    • Tags: RSPEC-S2209, RSPEC-S3252
  • org.openrewrite.staticanalysis.StaticMethodNotFinal
    • Static methods need not be final
    • Static methods do not need to be declared final because they cannot be overridden. Redundant modifiers add noise to the code and can suggest a misunderstanding of the language's dispatch model.
    • Tags: RSPEC-S2333
  • org.openrewrite.staticanalysis.StringLiteralEquality
    • Use String.equals() on String literals
    • String.equals() should be used when checking value equality on String literals. Using == or != compares object references, not the actual value of the Strings. This only modifies code where at least one side of the binary operation (== or !=) is a String literal, such as "someString" == someVariable;. This is to prevent inadvertently changing code where referential equality is the user's intent. Reference equality on strings is fragile because it depends on JVM string interning behavior, which can vary across runtimes and is not guaranteed for dynamically constructed strings.
    • Tags: RSPEC-S4973
  • org.openrewrite.staticanalysis.TernaryOperatorsShouldNotBeNested
    • Ternary operators should not be nested
    • Nested ternary operators can be hard to read quickly. Prefer simpler constructs for improved readability. If supported, this recipe will try to replace nested ternaries with switch expressions. Deeply nested conditional expressions obscure the branching logic and make it easy to misread which value corresponds to which condition.
    • Tags: RSPEC-S3358
  • org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes
    • URL Equals and Hash Code
    • Uses of equals() and hashCode() cause java.net.URL to make blocking internet connections. Instead, use java.net.URI.
    • Tags: RSPEC-2112
  • org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes$URLEqualsRecipe
    • URL Equals
    • Uses of equals() cause java.net.URL to make blocking internet connections. Instead, use java.net.URI.
    • Tags: RSPEC-2112
  • org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes$URLHashCodeRecipe
    • URL Hash Code
    • Uses of hashCode() cause java.net.URL to make blocking internet connections. Instead, use java.net.URI.
    • Tags: RSPEC-2112
  • org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources
    • Unnecessary close in try-with-resources
    • Remove unnecessary AutoCloseable#close() statements in try-with-resources. Try-with-resources already guarantees that each declared resource is closed when the block exits, so an explicit close() call is redundant and can be confusing.
    • Tags: RSPEC-S4087
  • org.openrewrite.staticanalysis.UnnecessaryParentheses
    • Remove unnecessary parentheses
    • Removes unnecessary parentheses from code where extra parentheses pairs are redundant. Redundant parentheses add visual noise and can obscure the actual structure of an expression, making code harder to read at a glance.
    • Tags: RSPEC-S1110, RSPEC-S1611
  • org.openrewrite.staticanalysis.UnnecessaryPrimitiveAnnotations
    • Remove @Nullable and @CheckForNull annotations from primitives
    • Primitives can't be null anyway, so these annotations are not useful in this context. Leaving them in place gives the false impression that a null value is possible, which can confuse readers and static analysis tools alike.
    • Tags: RSPEC-S4682
  • org.openrewrite.staticanalysis.UnnecessaryReturnAsLastStatement
    • Unnecessary return as last statement in void method
    • Removes return from a void method if it's the last statement. A trailing return in a void method has no effect on control flow and is just noise that distracts from the meaningful logic.
    • Tags: RSPEC-S3626
  • org.openrewrite.staticanalysis.UnnecessaryThrows
    • Unnecessary throws
    • Remove unnecessary throws declarations. This recipe will only remove unused, checked exceptions if: - The declaring class or the method declaration is final. - The method declaration is static or private. - The method overrides a method declaration in a super class and the super class does not throw the exception. - The method is public or protected and the exception is not documented via a JavaDoc as a @throws tag. Declaring exceptions that are never thrown misleads callers into writing unnecessary error-handling code and obscures the method's true behavior.
    • Tags: RSPEC-S1130
  • org.openrewrite.staticanalysis.UnwrapRepeatableAnnotations
    • Unwrap @Repeatable annotations
    • Java 8 introduced the concept of @Repeatable annotations, making the wrapper annotation unnecessary. Using the repeatable form directly reduces nesting and makes the individual annotations easier to scan.
    • Tags: RSPEC-S1710
  • org.openrewrite.staticanalysis.UpperCaseLiteralSuffixes
    • Upper case literal suffixes
    • Using upper case literal suffixes for declaring literals is less ambiguous, e.g., 1l versus 1L. A lowercase l is easily mistaken for the digit 1 in many fonts, which can lead to incorrect assumptions about the value.
    • Tags: RSPEC-S818
  • org.openrewrite.staticanalysis.UseCollectionInterfaces
    • Use Collection interfaces
    • Use Deque, List, Map, ConcurrentMap, Queue, and Set instead of implemented collections. Replaces the return type of public method declarations and the variable type public variable declarations. Programming to an interface rather than a concrete collection type decouples callers from a specific implementation, making it easier to swap data structures later without breaking dependent code.
    • Tags: RSPEC-S1319
  • org.openrewrite.staticanalysis.UseDiamondOperator
    • Use the diamond operator
    • The diamond operator (<>) should be used. Java 7 introduced the diamond operator to reduce the verbosity of generics code. For instance, instead of having to declare a List's type in both its declaration and its constructor, you can now simplify the constructor declaration with <>, and the compiler will infer the type. Repeating type arguments that the compiler can already deduce is unnecessary boilerplate that clutters the code.
    • Tags: RSPEC-S2293
  • org.openrewrite.staticanalysis.UseJavaStyleArrayDeclarations
    • No C-style array declarations
    • Change C-Style array declarations int i[]; to int[] i;. Keeping the brackets with the type groups all type information in one place, so readers do not have to inspect both the type and the variable name to determine whether something is an array.
    • Tags: RSPEC-S1197
  • org.openrewrite.staticanalysis.UseLambdaForFunctionalInterface
    • Use lambda expressions instead of anonymous classes
    • Instead of anonymous class declarations, use a lambda where possible. Using lambdas to replace anonymous classes can lead to more expressive and maintainable code, improve code readability, reduce code duplication, and achieve better performance in some cases.
    • Tags: RSPEC-S1604
  • org.openrewrite.staticanalysis.UseObjectNotifyAll
    • Replaces Object.notify() with Object.notifyAll()
    • Object.notifyAll() and Object.notify() both wake up sleeping threads, but Object.notify() only rouses one while Object.notifyAll() rouses all of them. Since Object.notify() might not wake up the right thread, Object.notifyAll() should be used instead. See this for more information. Using notify() in a multi-waiter scenario risks leaving threads permanently stalled when the wrong one is awakened.
    • Tags: RSPEC-S2446
  • org.openrewrite.staticanalysis.UsePortableNewlines
    • Use %n instead of \n in format strings
    • Format strings should use %n rather than \n to produce platform-specific line separators. Hard-coded \n characters produce incorrect line endings on Windows, whereas %n adapts to the runtime platform automatically.
    • Tags: RSPEC-S3457
  • org.openrewrite.staticanalysis.UseStandardCharset
    • Use StandardCharset constants
    • Replaces Charset.forName(java.lang.String) with the equivalent StandardCharset constant. Using the predefined constants is both compile-time safe and avoids the need to handle UnsupportedEncodingException for charsets that are guaranteed to exist on every JVM.
    • Tags: RSPEC-S4719
  • org.openrewrite.staticanalysis.UseStringReplace
    • Use String::replace() when first parameter is not a real regular expression
    • When String::replaceAll is used, the first argument should be a real regular expression. If it’s not the case, String::replace does exactly the same thing as String::replaceAll without the performance drawback of the regex.
    • Tags: RSPEC-S5361
  • org.openrewrite.staticanalysis.UseTryWithResources
    • Use try-with-resources
    • Refactor try/finally blocks to use try-with-resources when the finally block only closes an AutoCloseable resource. Try-with-resources guarantees that resources are closed even when exceptions occur, eliminating an entire class of resource-leak bugs that manual finally blocks are prone to.
    • Tags: RSPEC-S2093
  • org.openrewrite.staticanalysis.WhileInsteadOfFor
    • Prefer while over for loops
    • When only the condition expression is defined in a for loop, and the initialization and increment expressions are missing, a while loop should be used instead to increase readability. A for loop with empty init and update sections signals iteration mechanics that do not exist, whereas while clearly communicates a simple conditional loop.
    • Tags: RSPEC-S1264
  • org.openrewrite.staticanalysis.WriteOctalValuesAsDecimal
    • Write octal values as decimal
    • Developers may not recognize octal values as such, mistaking them instead for decimal values. Because a leading zero silently switches the literal to base-8, what looks like 010 actually represents 8, which is a common source of subtle numeric bugs.
    • Tags: RSPEC-S1314
  • tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$LogicalImplicationRecipe
    • Refaster template AssortedRules.LogicalImplication
    • Don't unnecessarily repeat boolean expressions.
    • Tags: RSPEC-S2589
  • tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalValueOfRecipe
    • Refaster template BigDecimalRules.BigDecimalValueOf
    • Prefer BigDecimal#valueOf(double) over the associated constructor.
    • Tags: RSPEC-S2111
  • tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes$CharSequenceIsEmptyRecipe
    • Refaster template CharSequenceRules.CharSequenceIsEmpty
    • Prefer CharSequence#isEmpty() over alternatives that consult the char sequence's length.
    • Tags: RSPEC-S7158
  • tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionIsEmptyRecipe
    • Refaster template CollectionRules.CollectionIsEmpty
    • Prefer Collection#isEmpty() over alternatives that consult the collection's size or are otherwise more contrived.
    • Tags: RSPEC-S1155
  • tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamAnyMatchRecipe
    • Refaster template DoubleStreamRules.DoubleStreamAnyMatch
    • Prefer DoubleStream#anyMatch(DoublePredicate) over more contrived alternatives.
    • Tags: RSPEC-S4034
  • tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$DoubleNegationRecipe
    • Refaster template EqualityRules.DoubleNegation
    • Avoid double negations; this is not Javascript.
    • Tags: RSPEC-S2761
  • tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$IndirectDoubleNegationRecipe
    • Refaster template EqualityRules.IndirectDoubleNegation
    • Don't negate an inequality test or use the ternary operator to compare two booleans; directly test for equality instead.
    • Tags: RSPEC-S1244, RSPEC-S1940
  • tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$NegationRecipe
    • Refaster template EqualityRules.Negation
    • Don't negate an equality test or use the ternary operator to compare two booleans; directly test for inequality instead.
    • Tags: RSPEC-S1244, RSPEC-S1940
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesCreateTempFileToFileRecipe
    • Prefer Files#createTempFile(String, String, FileAttribute[]) over alternatives that create files with more liberal permissions
    • Note that File#createTempFile treats the given prefix as a path, and ignores all but its file name. That is, the actual prefix used is derived from all characters following the final file separator (if any). This is not the case with Files#createTempFile, which will instead throw an IllegalArgumentException if the prefix contains any file separators.
    • Tags: RSPEC-S5443
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderRecipe
    • Refaster template FileRules.FilesNewBufferedReader
    • Prefer Files#newBufferedReader(Path) over more verbose or contrived alternatives.
    • Tags: RSPEC-S1943, RSPEC-S2095
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewInputStreamPathOfRecipe
    • Refaster template FileRules.FilesNewInputStreamPathOf
    • Prefer Files#newInputStream(Path, OpenOption...) over less idiomatic alternatives.
    • Tags: RSPEC-S2095
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewInputStreamToPathRecipe
    • Refaster template FileRules.FilesNewInputStreamToPath
    • Prefer Files#newInputStream(Path, OpenOption...) over less idiomatic alternatives.
    • Tags: RSPEC-S2095
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewOutputStreamPathOfRecipe
    • Refaster template FileRules.FilesNewOutputStreamPathOf
    • Prefer Files#newOutputStream(Path, OpenOption...) over less idiomatic alternatives.
    • Tags: RSPEC-S2095
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewOutputStreamToPathRecipe
    • Refaster template FileRules.FilesNewOutputStreamToPath
    • Prefer Files#newOutputStream(Path, OpenOption...) over less idiomatic alternatives.
    • Tags: RSPEC-S2095
  • tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapOf4Recipe
    • Refaster template ImmutableMapRules.ImmutableMapOf4
    • Prefer ImmutableMap#of(Object, Object, Object, Object, Object, Object, Object, Object) over alternatives that don't communicate the immutability of the resulting map at the type level.
    • Tags: RSPEC-S107
  • tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapOf5Recipe
    • Refaster template ImmutableMapRules.ImmutableMapOf5
    • Prefer ImmutableMap#of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) over alternatives that don't communicate the immutability of the resulting map at the type level.
    • Tags: RSPEC-S107
  • tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamAnyMatchRecipe
    • Refaster template IntStreamRules.IntStreamAnyMatch
    • Prefer IntStream#anyMatch(IntPredicate) over more contrived alternatives.
    • Tags: RSPEC-S4034
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatBooleanArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatBooleanArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatBooleanArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(boolean[] actual, Supplier<@Nullable String> message, boolean[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean[] actual, Supplier<@Nullable String> message, boolean[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatByteArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatByteArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatByteArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(byte[] actual, Supplier<@Nullable String> message, byte[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(byte[] actual, Supplier<@Nullable String> message, byte[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatCharArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatCharArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatCharArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(char[] actual, Supplier<@Nullable String> message, char[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(char[] actual, Supplier<@Nullable String> message, char[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatCodeWithFailMessageSupplierDoesNotThrowAnyExceptionRecipe
    • Refaster template JUnitToAssertJRules.AssertThatCodeWithFailMessageSupplierDoesNotThrowAnyException
    • Recipe created for the following Refaster template: java static final class AssertThatCodeWithFailMessageSupplierDoesNotThrowAnyException \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Executable throwingCallable, Supplier<@Nullable String> supplier) \{ assertDoesNotThrow(throwingCallable, supplier); \} @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(ThrowingSupplier<?> throwingCallable, Supplier<@Nullable String> supplier) \{ assertDoesNotThrow(throwingCallable, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, Supplier<@Nullable String> supplier) \{ assertThatCode(throwingCallable).withFailMessage(supplier).doesNotThrowAnyException(); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatDoubleArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatDoubleArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatDoubleArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(double[] actual, Supplier<@Nullable String> message, double[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, Supplier<@Nullable String> message, double[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatDoubleArrayWithFailMessageSupplierContainsExactlyWithOffsetRecipe
    • Refaster template JUnitToAssertJRules.AssertThatDoubleArrayWithFailMessageSupplierContainsExactlyWithOffset
    • Recipe created for the following Refaster template: java static final class AssertThatDoubleArrayWithFailMessageSupplierContainsExactlyWithOffset \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(double[] actual, Supplier<@Nullable String> messageSupplier, double[] expected, double delta) \{ assertArrayEquals(expected, actual, delta, messageSupplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, Supplier<@Nullable String> messageSupplier, double[] expected, double delta) \{ assertThat(actual).withFailMessage(messageSupplier).containsExactly(expected, offset(delta)); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatFloatArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatFloatArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatFloatArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(float[] actual, Supplier<@Nullable String> message, float[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, Supplier<@Nullable String> message, float[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatFloatArrayWithFailMessageSupplierContainsExactlyWithOffsetRecipe
    • Refaster template JUnitToAssertJRules.AssertThatFloatArrayWithFailMessageSupplierContainsExactlyWithOffset
    • Recipe created for the following Refaster template: java static final class AssertThatFloatArrayWithFailMessageSupplierContainsExactlyWithOffset \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(float[] actual, Supplier<@Nullable String> message, float[] expected, float delta) \{ assertArrayEquals(expected, actual, delta, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, Supplier<@Nullable String> message, float[] expected, float delta) \{ assertThat(actual).withFailMessage(message).containsExactly(expected, offset(delta)); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIntArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatIntArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatIntArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(int[] actual, Supplier<@Nullable String> message, int[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(int[] actual, Supplier<@Nullable String> message, int[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatLongArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatLongArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatLongArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(long[] actual, Supplier<@Nullable String> message, long[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(long[] actual, Supplier<@Nullable String> message, long[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatObjectArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatObjectArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatObjectArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Object[] actual, Supplier<@Nullable String> message, Object[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object[] actual, Supplier<@Nullable String> message, Object[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatShortArrayWithFailMessageSupplierContainsExactlyRecipe
    • Refaster template JUnitToAssertJRules.AssertThatShortArrayWithFailMessageSupplierContainsExactly
    • Recipe created for the following Refaster template: java static final class AssertThatShortArrayWithFailMessageSupplierContainsExactly \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(short[] actual, Supplier<@Nullable String> message, short[] expected) \{ assertArrayEquals(expected, actual, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(short[] actual, Supplier<@Nullable String> message, short[] expected) \{ assertThat(actual).withFailMessage(message).containsExactly(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatThrownByWithFailMessageSupplierIsExactlyInstanceOfRecipe
    • Refaster template JUnitToAssertJRules.AssertThatThrownByWithFailMessageSupplierIsExactlyInstanceOf
    • Recipe created for the following Refaster template: java static final class AssertThatThrownByWithFailMessageSupplierIsExactlyInstanceOf<T extends Throwable> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Executable throwingCallable, Supplier<@Nullable String> supplier, Class<T> clazz) \{ assertThrowsExactly(clazz, throwingCallable, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, Supplier<@Nullable String> supplier, Class<T> clazz) \{ assertThatThrownBy(throwingCallable).withFailMessage(supplier).isExactlyInstanceOf(clazz); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatThrownByWithFailMessageSupplierIsInstanceOfRecipe
    • Refaster template JUnitToAssertJRules.AssertThatThrownByWithFailMessageSupplierIsInstanceOf
    • Recipe created for the following Refaster template: java static final class AssertThatThrownByWithFailMessageSupplierIsInstanceOf<T extends Throwable> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Executable throwingCallable, Supplier<@Nullable String> supplier, Class<T> clazz) \{ assertThrows(clazz, throwingCallable, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, Supplier<@Nullable String> supplier, Class<T> clazz) \{ assertThatThrownBy(throwingCallable).withFailMessage(supplier).isInstanceOf(clazz); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageSupplierIsFalseRecipe
    • Refaster template JUnitToAssertJRules.AssertThatWithFailMessageSupplierIsFalse
    • Recipe created for the following Refaster template: java static final class AssertThatWithFailMessageSupplierIsFalse \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(boolean actual, Supplier<@Nullable String> supplier) \{ assertFalse(actual, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean actual, Supplier<@Nullable String> supplier) \{ assertThat(actual).withFailMessage(supplier).isFalse(); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageSupplierIsInstanceOfRecipe
    • Refaster template JUnitToAssertJRules.AssertThatWithFailMessageSupplierIsInstanceOf
    • Recipe created for the following Refaster template: java static final class AssertThatWithFailMessageSupplierIsInstanceOf<T> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Object actual, Supplier<@Nullable String> supplier, Class<T> clazz) \{ assertInstanceOf(clazz, actual, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Supplier<@Nullable String> supplier, Class<T> clazz) \{ assertThat(actual).withFailMessage(supplier).isInstanceOf(clazz); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageSupplierIsNotNullRecipe
    • Refaster template JUnitToAssertJRules.AssertThatWithFailMessageSupplierIsNotNull
    • Recipe created for the following Refaster template: java static final class AssertThatWithFailMessageSupplierIsNotNull \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Object actual, Supplier<@Nullable String> supplier) \{ assertNotNull(actual, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Supplier<@Nullable String> supplier) \{ assertThat(actual).withFailMessage(supplier).isNotNull(); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageSupplierIsNotSameAsRecipe
    • Refaster template JUnitToAssertJRules.AssertThatWithFailMessageSupplierIsNotSameAs
    • Recipe created for the following Refaster template: java static final class AssertThatWithFailMessageSupplierIsNotSameAs \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Object actual, Supplier<@Nullable String> supplier, Object expected) \{ assertNotSame(expected, actual, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Supplier<@Nullable String> supplier, Object expected) \{ assertThat(actual).withFailMessage(supplier).isNotSameAs(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageSupplierIsNullRecipe
    • Refaster template JUnitToAssertJRules.AssertThatWithFailMessageSupplierIsNull
    • Recipe created for the following Refaster template: java static final class AssertThatWithFailMessageSupplierIsNull \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Object actual, Supplier<@Nullable String> supplier) \{ assertNull(actual, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Supplier<@Nullable String> supplier) \{ assertThat(actual).withFailMessage(supplier).isNull(); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageSupplierIsSameAsRecipe
    • Refaster template JUnitToAssertJRules.AssertThatWithFailMessageSupplierIsSameAs
    • Recipe created for the following Refaster template: java static final class AssertThatWithFailMessageSupplierIsSameAs \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(Object actual, Supplier<@Nullable String> supplier, Object expected) \{ assertSame(expected, actual, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Supplier<@Nullable String> supplier, Object expected) \{ assertThat(actual).withFailMessage(supplier).isSameAs(expected); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageSupplierIsTrueRecipe
    • Refaster template JUnitToAssertJRules.AssertThatWithFailMessageSupplierIsTrue
    • Recipe created for the following Refaster template: java static final class AssertThatWithFailMessageSupplierIsTrue \{ @BeforeTemplate @SuppressWarnings(value = "java:S4449") void before(boolean actual, Supplier<@Nullable String> supplier) \{ assertTrue(actual, supplier); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean actual, Supplier<@Nullable String> supplier) \{ assertThat(actual).withFailMessage(supplier).isTrue(); \} \} .
    • Tags: RSPEC-S4449
  • tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamAnyMatchRecipe
    • Refaster template LongStreamRules.LongStreamAnyMatch
    • Prefer LongStream#anyMatch(LongPredicate) over more contrived alternatives.
    • Tags: RSPEC-S4034
  • tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalOrElseThrowRecipe
    • Refaster template OptionalRules.OptionalOrElseThrow
    • Prefer Optional#orElseThrow() over the less explicit Optional#get().
    • Tags: RSPEC-S3655
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$GreaterThanOrEqualToRecipe
    • Refaster template PrimitiveRules.GreaterThanOrEqualTo
    • Avoid contrived ways of expressing the "greater than or equal to" relationship.
    • Tags: RSPEC-S1940
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$GreaterThanRecipe
    • Refaster template PrimitiveRules.GreaterThan
    • Avoid contrived ways of expressing the "greater than" relationship.
    • Tags: RSPEC-S1940
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LessThanOrEqualToRecipe
    • Refaster template PrimitiveRules.LessThanOrEqualTo
    • Avoid contrived ways of expressing the "less than or equal to" relationship.
    • Tags: RSPEC-S1940
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LessThanRecipe
    • Refaster template PrimitiveRules.LessThan
    • Avoid contrived ways of expressing the "less than" relationship.
    • Tags: RSPEC-S1940
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampDoubleRecipe
    • Refaster template PrimitiveRules.MathClampDouble
    • Prefer Math#clamp(double, double, double) over more verbose alternatives.
    • Tags: RSPEC-S6885
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampFloatRecipe
    • Refaster template PrimitiveRules.MathClampFloat
    • Prefer Math#clamp(float, float, float) over more verbose alternatives.
    • Tags: RSPEC-S6885
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampIntRecipe
    • Refaster template PrimitiveRules.MathClampInt
    • Prefer Math#clamp(long, int, int) over more verbose alternatives.
    • Tags: RSPEC-S6885
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$MathClampLongRecipe
    • Refaster template PrimitiveRules.MathClampLong
    • Prefer Math#clamp(long, long, long) over more verbose alternatives.
    • Tags: RSPEC-S6885
  • tech.picnic.errorprone.refasterrules.RandomGeneratorRulesRecipes$RandomGeneratorNextLongRecipe
    • Prefer RandomGenerator#nextLong(long) over more contrived alternatives
    • Additionally, for large bounds, the unnecessary floating point arithmetic prevents some long values from being generated.
    • Tags: RSPEC-S1905
  • tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$CompletableToMonoRecipe
    • Refaster template RxJava2AdapterRules.CompletableToMono
    • Use the fluent API style when using RxJava2Adapter#completableToMono.
    • Tags: RSPEC-S4968
  • tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamCountRecipe
    • Refaster template StreamRules.StreamCount
    • Recipe created for the following Refaster template: java static final class StreamCount<T> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4266") long before(Stream<T> stream) \{ return stream.collect(counting()); \} @AfterTemplate long after(Stream<T> stream) \{ return stream.count(); \} \} .
    • Tags: RSPEC-S4266
  • tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMapCollectRecipe
    • Refaster template StreamRules.StreamMapCollect
    • Recipe created for the following Refaster template: java static final class StreamMapCollect<T, U, R> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4266") R before(Stream<T> stream, Function<? super T, ? extends U> mapper, Collector<? super U, ?, R> collector) \{ return stream.collect(mapping(mapper, collector)); \} @AfterTemplate R after(Stream<T> stream, Function<? super T, ? extends U> mapper, Collector<? super U, ?, R> collector) \{ return stream.map(mapper).collect(collector); \} \} .
    • Tags: RSPEC-S4266
  • tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMaxRecipe
    • Refaster template StreamRules.StreamMax
    • Recipe created for the following Refaster template: java static final class StreamMax<T> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4266") Optional<T> before(Stream<T> stream, Comparator<? super T> comparator) \{ return Refaster.anyOf(stream.min(comparator.reversed()), Streams.findLast(stream.sorted(comparator)), stream.collect(maxBy(comparator))); \} @AfterTemplate Optional<T> after(Stream<T> stream, Comparator<? super T> comparator) \{ return stream.max(comparator); \} \} .
    • Tags: RSPEC-S4266
  • tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMinRecipe
    • Refaster template StreamRules.StreamMin
    • Recipe created for the following Refaster template: java static final class StreamMin<T> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4266") Optional<T> before(Stream<T> stream, Comparator<? super T> comparator) \{ return Refaster.anyOf(stream.max(comparator.reversed()), stream.sorted(comparator).findFirst(), stream.collect(minBy(comparator))); \} @AfterTemplate Optional<T> after(Stream<T> stream, Comparator<? super T> comparator) \{ return stream.min(comparator); \} \} .
    • Tags: RSPEC-S4266
  • tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOfNullableRecipe
    • Refaster template StreamRules.StreamOfNullable
    • Prefer Stream#ofNullable(Object) over more contrived alternatives.
    • Tags: RSPEC-S2583
  • tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamReduceRecipe
    • Refaster template StreamRules.StreamReduce
    • Recipe created for the following Refaster template: java static final class StreamReduce<T> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4266") Optional<T> before(Stream<T> stream, BinaryOperator<T> accumulator) \{ return stream.collect(reducing(accumulator)); \} @AfterTemplate Optional<T> after(Stream<T> stream, BinaryOperator<T> accumulator) \{ return stream.reduce(accumulator); \} \} .
    • Tags: RSPEC-S4266
  • tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamReduceWithIdentityRecipe
    • Refaster template StreamRules.StreamReduceWithIdentity
    • Recipe created for the following Refaster template: java static final class StreamReduceWithIdentity<T> \{ @BeforeTemplate @SuppressWarnings(value = "java:S4266") T before(Stream<T> stream, T identity, BinaryOperator<T> accumulator) \{ return stream.collect(reducing(identity, accumulator)); \} @AfterTemplate T after(Stream<T> stream, T identity, BinaryOperator<T> accumulator) \{ return stream.reduce(identity, accumulator); \} \} .
    • Tags: RSPEC-S4266
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$EmptyStringRecipe
    • Refaster template StringRules.EmptyString
    • Avoid unnecessary creation of new empty String objects; use the empty string literal instead.
    • Tags: RSPEC-S2129
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIdentityRecipe
    • Refaster template StringRules.StringIdentity
    • Avoid unnecessary creation of new String objects.
    • Tags: RSPEC-S2129
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfCharFromIndexRecipe
    • Refaster template StringRules.StringIndexOfCharFromIndex
    • Prefer String#indexOf(int, int) over less efficient alternatives.
    • Tags: RSPEC-S4635
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfStringFromIndexRecipe
    • Refaster template StringRules.StringIndexOfStringFromIndex
    • Prefer String#indexOf(String, int) over less efficient alternatives.
    • Tags: RSPEC-S4635
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIsEmptyRecipe
    • Refaster template StringRules.StringIsEmpty
    • Prefer String#isEmpty() over alternatives that consult the string's length.
    • Tags: RSPEC-S7158
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfCharRecipe
    • Refaster template StringRules.StringLastIndexOfChar
    • Prefer String#lastIndexOf(int, int) over less efficient alternatives.
    • Tags: RSPEC-S4635
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfStringRecipe
    • Refaster template StringRules.StringLastIndexOfString
    • Prefer String#lastIndexOf(String, int) over less efficient alternatives.
    • Tags: RSPEC-S4635
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringStartsWithRecipe
    • Refaster template StringRules.StringStartsWith
    • Prefer String#startsWith(String, int) over less efficient alternatives.
    • Tags: RSPEC-S4635
  • tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualRecipe
    • Refaster template TestNGToAssertJRules.AssertEqual
    • Recipe created for the following Refaster template: java @SuppressWarnings(value = "java:S1448") static final class AssertEqual \{ @BeforeTemplate void before(boolean actual, boolean expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(boolean actual, Boolean expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Boolean actual, boolean expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Boolean actual, Boolean expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(byte actual, byte expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(byte actual, Byte expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Byte actual, byte expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Byte actual, Byte expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(char actual, char expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(char actual, Character expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Character actual, char expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Character actual, Character expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(short actual, short expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(short actual, Short expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Short actual, short expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Short actual, Short expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(int actual, int expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(int actual, Integer expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Integer actual, int expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Integer actual, Integer expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(long actual, long expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(long actual, Long expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Long actual, long expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Long actual, Long expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(float actual, float expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(float actual, Float expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Float actual, float expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Float actual, Float expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(double actual, double expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(double actual, Double expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Double actual, double expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Double actual, Double expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Object actual, Object expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(String actual, String expected) \{ assertEquals(actual, expected); \} @BeforeTemplate void before(Map<?, ?> actual, Map<?, ?> expected) \{ assertEquals(actual, expected); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Object expected) \{ assertThat(actual).isEqualTo(expected); \} \} .
    • Tags: RSPEC-S1448
  • tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualWithMessageRecipe
    • Refaster template TestNGToAssertJRules.AssertEqualWithMessage
    • Recipe created for the following Refaster template: java @SuppressWarnings(value = "java:S1448") static final class AssertEqualWithMessage \{ @BeforeTemplate void before(boolean actual, String message, boolean expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(boolean actual, String message, Boolean expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Boolean actual, String message, boolean expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Boolean actual, String message, Boolean expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(byte actual, String message, byte expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(byte actual, String message, Byte expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Byte actual, String message, byte expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Byte actual, String message, Byte expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(char actual, String message, char expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(char actual, String message, Character expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Character actual, String message, char expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Character actual, String message, Character expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(short actual, String message, short expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(short actual, String message, Short expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Short actual, String message, short expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Short actual, String message, Short expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(int actual, String message, int expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(int actual, String message, Integer expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Integer actual, String message, int expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Integer actual, String message, Integer expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(long actual, String message, long expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(long actual, String message, Long expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Long actual, String message, long expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Long actual, String message, Long expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(float actual, String message, float expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(float actual, String message, Float expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Float actual, String message, float expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Float actual, String message, Float expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(double actual, String message, double expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(double actual, String message, Double expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Double actual, String message, double expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Double actual, String message, Double expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Object actual, String message, Object expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(String actual, String message, String expected) \{ assertEquals(actual, expected, message); \} @BeforeTemplate void before(Map<?, ?> actual, String message, Map<?, ?> expected) \{ assertEquals(actual, expected, message); \} @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message, Object expected) \{ assertThat(actual).withFailMessage(message).isEqualTo(expected); \} \} .
    • Tags: RSPEC-S1448

sap

1 recipe

scala

1 recipe

scheduler

2 recipes

schemas

37 recipes

sdk

3 recipes

2 recipes

secrets

1 recipe

  • org.openrewrite.github.ReplaceOssrhSecretsWithSonatype
    • Replace OSSRH secrets with Sonatype secrets
    • Replace deprecated OSSRH_S01 secrets with new Sonatype secrets in GitHub Actions workflows. This is an example use of the ReplaceSecrets and ReplaceSecretKeys recipes combined used to update the Maven publishing secrets in OpenRewrite's GitHub organization.

security

38 recipes

service

1 recipe

  • org.openrewrite.quarkus.spring.MigrateSpringCloudServiceDiscovery
    • Migrate Spring Cloud Service Discovery to Quarkus
    • Migrates Spring Cloud Service Discovery annotations and configurations to Quarkus equivalents. Converts @EnableDiscoveryClient and related patterns to Quarkus Stork service discovery.
    • Tags: service-discovery

servlet

1 recipe

sleuth

2 recipes

slf4j

15 recipes

spring

142 recipes

springdata

2 recipes

springdoc

10 recipes

springfox

2 recipes

springframework

9 recipes

sqlserver

1 recipe

storybook

9 recipes

stylistic

87 recipes

supply

1 recipe

svelte

18 recipes

swagger

9 recipes

taglib

3 recipes

taglibs

1 recipe

templating

1 recipe

terraform

1 recipe

test

5 recipes

testing

49 recipes

testng

1 recipe

testwebxml

1 recipe

thymeleaf

1 recipe

tld

1 recipe

tracing

1 recipe

transaction

3 recipes

truth

1 recipe

typescript

1 recipe

unaffected

1 recipe

underscore

4 recipes

  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreArray
    • Replace lodash and underscore array functions with native JavaScript
      • _.head(x) -> x[0] - _.head(x, n) -> x.slice(n) - _.first (alias for _.head) - _.tail(x) -> x.slice(1) - _.tail(x, n) -> x.slice(n) - _.rest (alias for _.tail) - _.last(x) -> x[x.length - 1] - _.last(x, n) -> x.slice(x.length - n).
  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreFunction
    • Replace lodash and underscore function functions with native JavaScript
      • _.bind(fn, obj, ...x) -> fn.bind(obj, ...x) - _.partial(fn, a, b); -> (...args) => fn(a, b, ...args).
  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreObjects
    • Replace lodash and underscore object functions with native JavaScript
      • _.clone(x) -> \{ ...x \} - _.extend(\{\}, x, y) -> \{ ...x, ...y \} - _.extend(obj, x, y) -> Object.assign(obj, x, y) - _.keys(x) -> Object.keys(x) - _.pairs(x) -> Object.entries(x) - _.values(x) -> Object.values(x).
  • org.openrewrite.codemods.migrate.lodash.LodashUnderscoreUtil
    • Replace lodash and underscore utility functions with native JavaScript
      • _.isArray(x) -> Array.isArray(x) - _.isBoolean(x) -> typeof(x) === 'boolean' - _.isFinite(x) -> Number.isFinite(x) - _.isFunction(x) -> typeof(x) === 'function' - _.isNull(x) -> x === null - _.isString(x) -> typeof(x) === 'string' - _.isUndefined(x) -> typeof(x) === 'undefined'.

validation

5 recipes

var

1 recipe

  • org.openrewrite.java.migrate.lang.UseVar
    • Use local variable type inference
    • Apply local variable type inference (var) for primitives and objects. These recipes can cause unused imports, be advised to run `org.openrewrite.java.RemoveUnusedImports afterwards.

version

1 recipe

virtual

2 recipes

vue

57 recipes

web

10 recipes

webflux

1 recipe

weblogic

56 recipes

webservices

5 recipes

websocket

1 recipe

webxml

1 recipe

wiremock

1 recipe

wsee

4 recipes

xhtml

1 recipe

xjb

1 recipe

xmlunit

1 recipe

zipkin

2 recipes