Skip to main content

Recipes by Tag

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

Total tags: 252

5to6

7 recipes

actions

2 recipes

activation

2 recipes

activemq

1 recipe

actuator

1 recipe

ai

1 recipe

  • io.moderne.ai.FixMisencodedCommentsInFrench
    • Fix mis-encoded French comments, javadocs and pom.xml comments
    • Fixes mis-encoded French comments in your code, javadocs and in your pom.xml files. Mis-encoded comments contain a ? or � character.

amqp

2 recipes

annotation

3 recipes

annotations

2 recipes

apache

17 recipes

application

7 recipes

arquillian

1 recipe

artemis

1 recipe

assertj

11 recipes

async

1 recipe

authentication

2 recipes

authorization

2 recipes

AWS

53 recipes

Azure

49 recipes

batch

9 recipes

batchXML

1 recipe

bean validation

1 recipe

beans

2 recipes

best practices

1 recipe

bindings

1 recipe

bom

1 recipe

boot

71 recipes

bouncycastle

2 recipes

brave

1 recipe

bug

1 recipe

build

1 recipe

byteman

1 recipe

cache

1 recipe

cacheManager

1 recipe

camel

1 recipe

cdi

2 recipes

CKV

110 recipes

CKV2

1 recipe

classic

3 recipes

cleanup

1 recipe

cloud

23 recipes

cloudfoundry

1 recipe

cobertura

1 recipe

codemods

103 recipes

collections

2 recipes

commons

14 recipes

compatibility

1 recipe

compiler

2 recipes

connector

2 recipes

connectors

1 recipe

core

1 recipe

cucumber

5 recipes

CVE

3 recipes

  • org.openrewrite.java.logging.log4j.UpgradeLog4J2DependencyVersion
  • org.openrewrite.java.security.FindTextDirectionChanges
    • Find text-direction changes
    • Finds unicode control characters which can change the direction text is displayed in. These control characters can alter how source code is presented to a human reader without affecting its interpretation by tools like compilers. So a malicious patch could pass code review while introducing vulnerabilities. Note that text direction-changing unicode control characters aren't inherently malicious. These characters can appear for legitimate reasons in code written in or dealing with right-to-left languages. See: https://trojansource.codes/ for more information.
  • org.openrewrite.java.security.spring.InsecureSpringServiceExporter
    • Secure Spring service exporters
    • The default Java deserialization mechanism is available via ObjectInputStream class. This mechanism is known to be vulnerable. If an attacker can make an application deserialize malicious data, it may result in arbitrary code execution. Spring’s RemoteInvocationSerializingExporter uses the default Java deserialization mechanism to parse data. As a result, all classes that extend it are vulnerable to deserialization attacks. The Spring Framework contains at least HttpInvokerServiceExporter and SimpleHttpInvokerServiceExporter that extend RemoteInvocationSerializingExporter. These exporters parse data from the HTTP body using the unsafe Java deserialization mechanism. See the full blog post by Artem Smotrakov on CVE-2016-1000027 from which the above description is excerpted.

CWE

16 recipes

CycloneDX

1 recipe

  • org.openrewrite.java.dependencies.SoftwareBillOfMaterials
    • Software bill of materials
    • Produces a software bill of materials (SBOM) for a project. An SBOM is a complete list of all dependencies used in a project, including transitive dependencies. The produced SBOM is in the CycloneDX XML format. Supports Gradle and Maven. Places a file named sbom.xml adjacent to the Gradle or Maven build file.

data

5 recipes

database

5 recipes

datadog

1 recipe

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

dropwizard

1 recipe

easymock

1 recipe

ejb

7 recipes

elasticsearch

11 recipes

  • io.moderne.elastic.elastic9.ChangeApiNumericFieldTypes
    • Change numeric field types for Elasticsearch 9
    • Handles changes between different numeric types (Long to Integer, int to Long...) in Elasticsearch 9 API responses by adding appropriate conversion methods with null checks.
  • io.moderne.elastic.elastic9.MigrateDenseVectorElementType
    • Migrate DenseVectorProperty.elementType from String to DenseVectorElementType enum
    • In Elasticsearch 9, DenseVectorProperty.elementType() returns DenseVectorElementType enum instead of String, and the builder method elementType(String) now accepts the enum type. This recipe handles both builder calls and getter calls.
  • io.moderne.elastic.elastic9.MigrateDenseVectorSimilarity
    • Migrate DenseVectorProperty.similarity from String to DenseVectorSimilarity enum
    • In Elasticsearch 9, DenseVectorProperty.similarity() returns DenseVectorSimilarity enum instead of String, and the builder method similarity(String) now accepts the enum type. This recipe handles both builder calls and getter calls.
  • io.moderne.elastic.elastic9.MigrateMatchedQueries
    • Migrate matchedQueries from List to Map
    • In Elasticsearch Java Client 9.0, Hit.matchedQueries() changed from returning List<String> to Map<String, Double>. This recipe migrates the usage by adding .keySet() for iterations and using new ArrayList<>(result.keySet()) for assignments.
  • io.moderne.elastic.elastic9.MigrateScriptSource
    • Migrate script source from String to Script/ScriptSource
    • Migrates Script.source(String) calls to use ScriptSource.scriptString(String) wrapper in Elasticsearch Java client 9.x.
  • io.moderne.elastic.elastic9.MigrateSpanTermQueryValue
    • Migrate SpanTermQuery.value() from String to FieldValue
    • In Elasticsearch 9, SpanTermQuery.value() returns a FieldValue instead of String. This recipe updates calls to handle the new return type by checking if it's a string and extracting the string value.
  • io.moderne.elastic.elastic9.MigrateToElasticsearch9
    • Migrate from Elasticsearch 8 to 9
    • This recipe performs a comprehensive migration from Elasticsearch 8 to Elasticsearch 9, addressing breaking changes, API removals, deprecations, and required code modifications.
  • io.moderne.elastic.elastic9.RenameApiField
    • Rename Elasticsearch valueBody() methods
    • In Elasticsearch Java Client 9.0, the generic valueBody() method and valueBody(...) builder methods have been replaced with specific getter and setter methods that better reflect the type of data being returned. Similarly, for GetRepositoryResponse, the result field also got altered to repositories.
  • io.moderne.elastic.elastic9.RenameApiFields
    • Rename API fields for Elasticsearch 9
    • Renames various API response fields from valueBody to align with Elasticsearch 9 specifications.
  • io.moderne.elastic.elastic9.UseNamedValueParameters
    • Use NamedValue parameters instead of Map
    • Migrates indicesBoost and dynamicTemplates parameters from Map to NamedValue in Elasticsearch Java client 9.x.
  • org.openrewrite.quarkus.spring.SpringBootElasticsearchToQuarkus
    • Replace Spring Boot Elasticsearch with Quarkus Elasticsearch REST Client
    • Migrates spring-boot-starter-data-elasticsearch to quarkus-elasticsearch-rest-client.

epoll

1 recipe

eslint

190 recipes

examples

5 recipes

faces

29 recipes

flyway

5 recipes

framework

1 recipe

  • io.moderne.java.spring.framework.MigrateDefaultResponseErrorHandler
    • Migrate DefaultResponseErrorHandler.handleError method signature
    • Migrates overridden handleError(ClientHttpResponse response) methods to the new signature handleError(URI url, HttpMethod method, ClientHttpResponse response) in classes extending DefaultResponseErrorHandler. The old single-argument method was removed in Spring Framework 7.0.

GCP

15 recipes

github

12 recipes

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.

gradle

4 recipes

guava

56 recipes

h2

2 recipes

hamcrest

6 recipes

handler

1 recipe

health

1 recipe

hibernate

4 recipes

httpclient

4 recipes

inject

3 recipes

integration

1 recipe

intellij

1 recipe

jackson

19 recipes

jacoco

1 recipe

jakarta

100 recipes

jakartaee

6 recipes

jasperreports

4 recipes

  • io.moderne.jasperreports.MigrateExporterConfigToJasper6
    • Update JasperReports exporter configuration
    • Updates deprecated exporter parameter imports to the new configuration classes introduced in JasperReports 6. This includes migrating from parameter classes to configuration classes for PDF, HTML, CSV, and other exporters.
  • io.moderne.jasperreports.MigrateXlsToXlsxExporter
    • Migrate JRXlsExporter to JRXlsxExporter
    • Migrates the deprecated JRXlsExporter to the new JRXlsxExporter class in JasperReports 6. Also updates related configuration classes from XLS to XLSX variants.
  • io.moderne.jasperreports.UpgradeToJasperReports5
    • Migrate to JasperReports 5.6.x
    • Migrates JasperReports from 4.6.0 to 5.6.x. This recipe includes minimal breaking changes, allowing teams to test and validate the migration before proceeding to version 6.
  • io.moderne.jasperreports.UpgradeToJasperReports6
    • Migrate to JasperReports 6
    • Migrates JasperReports from 5.x to 6.x with the new exporter API, XLS to XLSX move, and removal of Spring JasperReports views.

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

5 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.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.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

36 recipes

jaxb

11 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.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.

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

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.

jpa

1 recipe

jsf

32 recipes

jsp

1 recipe

jsptaglibrary

1 recipe

jsr250

1 recipe

JtaTransactionManager

1 recipe

junit

21 recipes

jupiter

2 recipes

kafka

22 recipes

kubernetes

27 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

21 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

1 recipe

messaging

2 recipes

micrometer

3 recipes

migration

24 recipes

mockito

7 recipes

mongodb

2 recipes

mssql

3 recipes

mui

78 recipes

mvc

1 recipe

myfaces

5 recipes

mysql

1 recipe

namespaces

1 recipe

netty

5 recipes

networking

1 recipe

newrelic

1 recipe

nextjs

12 recipes

nio

1 recipe

nodejs

1 recipe

non

1 recipe

oauth2

2 recipes

observability

3 recipes

okhttp

1 recipe

omnifaces

6 recipes

openapi

10 recipes

opentelemetry

8 recipes

opentracing

1 recipe

oracle

4 recipes

orm

2 recipes

oss

1 recipe

permissions

1 recipe

persistence

5 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.

poi

1 recipe

postgresql

7 recipes

primefaces

4 recipes

pubsub

2 recipes

quarkus

38 recipes

quartz

1 recipe

ra

3 recipes

rabbitmq

1 recipe

rdbms

2 recipes

reactive

4 recipes

reactor

2 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

richfaces

3 recipes

RSPEC

195 recipes

  • 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. The most common cause of unknown types is the use of annotation processors not supported by OpenRewrite, such as lombok.
  • org.openrewrite.java.format.EmptyNewlineAtEndOfFile
    • End files with a single newline
    • Some tools work better when files end with an empty line.
  • org.openrewrite.java.format.WrappingAndBraces
    • Wrapping and braces
    • Format line wraps and braces in Java code.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • org.openrewrite.java.migrate.guava.NoGuavaOptionalToJavaUtil
    • Remove com.google.common.base.Optional#toJavaUtil()
    • Remove calls to com.google.common.base.Optional#toJavaUtil().
  • org.openrewrite.java.migrate.guava.PreferJavaUtilFunction
    • Prefer java.util.function.Function
    • Prefer java.util.function.Function instead of using com.google.common.base.Function.
  • org.openrewrite.java.migrate.guava.PreferJavaUtilOptional
    • Prefer java.util.Optional
    • Prefer java.util.Optional instead of using com.google.common.base.Optional.
  • 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).
  • 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).
  • org.openrewrite.java.migrate.guava.PreferJavaUtilPredicate
    • Prefer java.util.function.Predicate
    • Prefer java.util.function.Predicate instead of using com.google.common.base.Predicate.
  • org.openrewrite.java.migrate.guava.PreferJavaUtilSupplier
    • Prefer java.util.function.Supplier
    • Prefer java.util.function.Supplier instead of using com.google.common.base.Supplier.
  • 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.
  • org.openrewrite.java.search.FindEmptyClasses
    • Find empty classes
    • Find empty classes without annotations that do not implement an interface or extend a class.
  • org.openrewrite.java.search.FindEmptyMethods
    • Find methods with empty bodies
    • Find methods with empty bodies and single public no arg constructors.
  • org.openrewrite.java.security.SecureRandom
    • Secure random
    • Use cryptographically secure Pseudo Random Number Generation in the "main" source set. Replaces instantiation of java.util.Random with java.security.SecureRandom.
  • org.openrewrite.java.security.SecureRandomPrefersDefaultSeed
    • SecureRandom seeds are not constant or predictable
    • Remove SecureRandom#setSeed(*) method invocations having constant or predictable arguments.
  • org.openrewrite.java.security.UseFilesCreateTempDirectory
    • Use Files#createTempDirectory
    • Use Files#createTempDirectory when the sequence File#createTempFile(..)->File#delete()->File#mkdir() is used for creating a temp directory.
  • org.openrewrite.java.spring.NoRequestMappingAnnotation
    • Remove @RequestMapping annotations
    • Replace method declaration @RequestMapping annotations with @GetMapping, @PostMapping, etc. when possible.
  • 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.
  • 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.
  • 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.
  • 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(..).
  • 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.
  • 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.
  • 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(() -> { ... }).
  • 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.
  • 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.
  • 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.
  • org.openrewrite.maven.OrderPomElements
    • Order POM elements
    • Order POM elements according to the recommended order.
  • 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.
  • 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.
  • 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().
  • 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.
  • 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).
  • org.openrewrite.staticanalysis.BigDecimalRoundingConstantsToEnums
    • BigDecimal rounding constants to RoundingMode enums
    • Convert BigDecimal rounding constants to the equivalent RoundingMode enum.
  • org.openrewrite.staticanalysis.BooleanChecksNotInverted
    • Boolean checks should not be inverted
    • Ensures that boolean checks are not unnecessarily inverted. Also fixes double negative boolean expressions.
  • org.openrewrite.staticanalysis.CaseInsensitiveComparisonsDoNotChangeCase
    • CaseInsensitive comparisons do not alter case
    • Remove String#toLowerCase() or String#toUpperCase() from String#equalsIgnoreCase(..) comparisons.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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 !=.
  • 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.
  • 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).
  • org.openrewrite.staticanalysis.DefaultComesLast
    • Default comes last
    • Ensure the default case comes last after all the cases in a switch statement.
  • org.openrewrite.staticanalysis.EmptyBlock
    • Remove empty blocks
    • Remove empty blocks that effectively do nothing.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.FinalClass
    • Finalize classes with private constructors
    • Adds the final modifier to classes that expose no public or package-private constructors.
  • 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.
  • org.openrewrite.staticanalysis.ForLoopIncrementInUpdate
    • for loop counters incremented in update
    • The increment should be moved to the loop's increment clause if possible.
  • org.openrewrite.staticanalysis.HiddenField
    • Hidden field
    • Refactor local variables or parameters which shadow a field defined in the same class.
  • 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.
  • 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.
  • 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).
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.IsEmptyCallOnCollections
    • Use Collection#isEmpty() instead of comparing size()
    • Also check for not isEmpty() when testing for not equal to zero size.
  • 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.
  • 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().
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.ModifierOrder
    • Modifier order
    • Modifiers should be declared in the correct order as recommended by the JLS.
  • 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.
  • org.openrewrite.staticanalysis.NeedBraces
    • Fix missing braces
    • Adds missing braces around code such as single-line if, for, while, and do-while block bodies.
  • org.openrewrite.staticanalysis.NestedEnumsAreNotStatic
    • Nested enums are not static
    • Remove static modifier from nested enum types since they are implicitly static.
  • 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.
  • org.openrewrite.staticanalysis.NoDoubleBraceInitialization
    • No double brace initialization
    • Replace List, Map, and Set double brace initialization with an initialization block.
  • org.openrewrite.staticanalysis.NoEmptyCollectionWithRawType
    • Use Collections#emptyList(), emptyMap(), and emptySet()
    • Replaces Collections#EMPTY_... with methods that return generic types.
  • 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.
  • org.openrewrite.staticanalysis.NoFinalizer
    • Remove finalize() method
    • Finalizers are deprecated. Use of finalize() can lead to performance issues, deadlocks, hangs, and other undesirable behavior.
  • org.openrewrite.staticanalysis.NoPrimitiveWrappersForToStringOrCompareTo
    • No primitive wrappers for #toString() or #compareTo(..)
    • Primitive wrappers should not be instantiated only for #toString() or #compareTo(..) invocations.
  • 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.
  • org.openrewrite.staticanalysis.NoToStringOnStringType
    • Unnecessary String#toString
    • Remove unnecessary String#toString invocations on objects which are already a string.
  • 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").
  • org.openrewrite.staticanalysis.ObjectFinalizeCallsSuper
    • finalize() calls super
    • Overrides of Object#finalize() should call super.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.RemoveRedundantNullCheckBeforeInstanceof
    • Remove redundant null checks before instanceof
    • Removes redundant null checks before instanceof operations since instanceof returns false for null.
  • org.openrewrite.staticanalysis.RemoveRedundantTypeCast
    • Remove redundant casts
    • Removes unnecessary type casts. Does not currently check casts in lambdas and class constructors.
  • 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.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods
    • Remove unused private methods
    • private methods that are never executed are dead code and should be removed.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
    • Replace calls to Thread.run() with Thread.start()
    • Thread.run() should not be called directly.
  • 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.
  • 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").
  • org.openrewrite.staticanalysis.SimplifyBooleanExpression
    • Simplify boolean expression
    • Checks for overly complicated boolean expressions, such as if (b == true), b || true, !false, etc.
  • 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.
  • org.openrewrite.staticanalysis.SimplifyBooleanReturn
    • Simplify boolean return
    • Simplifies Boolean expressions by removing redundancies. For example, a && true simplifies to a.
  • org.openrewrite.staticanalysis.StaticMethodNotFinal
    • Static methods need not be final
    • Static methods do not need to be declared final because they cannot be overridden.
  • 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.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes$URLEqualsRecipe
    • URL Equals
    • Uses of equals() cause java.net.URL to make blocking internet connections. Instead, use java.net.URI.
  • 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.
  • org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources
    • Unnecessary close in try-with-resources
    • Remove unnecessary AutoCloseable#close() statements in try-with-resources.
  • org.openrewrite.staticanalysis.UnnecessaryParentheses
    • Remove unnecessary parentheses
    • Removes unnecessary parentheses from code where extra parentheses pairs are redundant.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.UpperCaseLiteralSuffixes
    • Upper case literal suffixes
    • Using upper case literal suffixes for declaring literals is less ambiguous, e.g., 1l versus 1L.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.UseJavaStyleArrayDeclarations
    • No C-style array declarations
    • Change C-Style array declarations int i[]; to int[] i;.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • org.openrewrite.staticanalysis.WriteOctalValuesAsDecimal
    • Write octal values as decimal
    • Developers may not recognize octal values as such, mistaking them instead for decimal values.
  • tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$LogicalImplicationRecipe
    • Refaster template AssortedRules.LogicalImplication
    • Don't unnecessarily repeat boolean expressions.
  • tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalValueOfRecipe
    • Refaster template BigDecimalRules.BigDecimalValueOf
    • Prefer BigDecimal#valueOf(double) over the associated constructor.
  • tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes$CharSequenceIsEmptyRecipe
    • Refaster template CharSequenceRules.CharSequenceIsEmpty
    • Prefer CharSequence#isEmpty() over alternatives that consult the char sequence's length.
  • 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.
  • tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamAnyMatchRecipe
    • Refaster template DoubleStreamRules.DoubleStreamAnyMatch
    • Prefer DoubleStream#anyMatch(DoublePredicate) over more contrived alternatives.
  • tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$DoubleNegationRecipe
    • Refaster template EqualityRules.DoubleNegation
    • Avoid double negations; this is not Javascript.
  • 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.
  • 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.
  • 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.
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderPathOfRecipe
    • Refaster template FileRules.FilesNewBufferedReaderPathOf
    • Prefer Files#newBufferedReader(Path) over more verbose or contrived alternatives.
  • tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderToPathRecipe
    • Refaster template FileRules.FilesNewBufferedReaderToPath
    • Prefer Files#newBufferedReader(Path) over more verbose or contrived alternatives.
  • 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.
  • 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.
  • tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamAnyMatchRecipe
    • Refaster template IntStreamRules.IntStreamAnyMatch
    • Prefer IntStream#anyMatch(IntPredicate) over more contrived alternatives.
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • 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(); } } .
  • 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); } } .
  • 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)); } } .
  • 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); } } .
  • 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)); } } .
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • 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(); } } .
  • 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); } } .
  • 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(); } } .
  • 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); } } .
  • 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(); } } .
  • 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); } } .
  • 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(); } } .
  • tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamAnyMatchRecipe
    • Refaster template LongStreamRules.LongStreamAnyMatch
    • Prefer LongStream#anyMatch(LongPredicate) over more contrived alternatives.
  • tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalOrElseThrowRecipe
    • Refaster template OptionalRules.OptionalOrElseThrow
    • Prefer Optional#orElseThrow() over the less explicit Optional#get().
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$GreaterThanOrEqualToRecipe
    • Refaster template PrimitiveRules.GreaterThanOrEqualTo
    • Avoid contrived ways of expressing the "greater than or equal to" relationship.
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$GreaterThanRecipe
    • Refaster template PrimitiveRules.GreaterThan
    • Avoid contrived ways of expressing the "greater than" relationship.
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LessThanOrEqualToRecipe
    • Refaster template PrimitiveRules.LessThanOrEqualTo
    • Avoid contrived ways of expressing the "less than or equal to" relationship.
  • tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LessThanRecipe
    • Refaster template PrimitiveRules.LessThan
    • Avoid contrived ways of expressing the "less than" relationship.
  • 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.
  • tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxThenEmptyRecipe
    • Refaster template ReactorRules.FluxThenEmpty
    • Avoid vacuous invocations of Flux#ignoreElements().
  • tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxThenMonoRecipe
    • Refaster template ReactorRules.FluxThenMono
    • Avoid vacuous invocations of Flux#ignoreElements().
  • tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxThenRecipe
    • Refaster template ReactorRules.FluxThen
    • Avoid vacuous invocations of Flux#ignoreElements().
  • tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoIdentityRecipe
    • Refaster template ReactorRules.MonoIdentity
    • Don't unnecessarily transform a Mono to an equivalent instance.
  • tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenEmptyRecipe
    • Refaster template ReactorRules.MonoThenEmpty
    • Avoid vacuous invocations of Mono#ignoreElement().
  • tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenMonoRecipe
    • Refaster template ReactorRules.MonoThenMono
    • Avoid vacuous operations prior to invocation of Mono#then(Mono).
  • tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenRecipe
    • Refaster template ReactorRules.MonoThen
    • Prefer direct invocation of Mono#then()} over more contrived alternatives.
  • tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$CompletableToMonoRecipe
    • Refaster template RxJava2AdapterRules.CompletableToMono
    • Use the fluent API style when using RxJava2Adapter#completableToMono.
  • 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(); } } .
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • 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); } } .
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$EmptyStringRecipe
    • Refaster template StringRules.EmptyString
    • Avoid unnecessary creation of new empty String objects; use the empty string literal instead.
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIdentityRecipe
    • Refaster template StringRules.StringIdentity
    • Avoid unnecessary creation of new String objects.
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfCharFromIndexRecipe
    • Refaster template StringRules.StringIndexOfCharFromIndex
    • Prefer String#indexOf(int, int) over less efficient alternatives.
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfStringFromIndexRecipe
    • Refaster template StringRules.StringIndexOfStringFromIndex
    • Prefer String#indexOf(String, int) over less efficient alternatives.
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIsEmptyRecipe
    • Refaster template StringRules.StringIsEmpty
    • Prefer String#isEmpty() over alternatives that consult the string's length.
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfCharRecipe
    • Refaster template StringRules.StringLastIndexOfChar
    • Prefer String#lastIndexOf(int, int) over less efficient alternatives.
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfStringRecipe
    • Refaster template StringRules.StringLastIndexOfString
    • Prefer String#lastIndexOf(String, int) over less efficient alternatives.
  • tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringStartsWithRecipe
    • Refaster template StringRules.StringStartsWith
    • Prefer String#startsWith(String, int) over less efficient alternatives.
  • 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); } } .
  • 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); } } .

sap

1 recipe

scala

1 recipe

scheduler

2 recipes

schemas

37 recipes

sdk

3 recipes

1 recipe

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

64 recipes

servlet

1 recipe

sleuth

2 recipes

slf4j

12 recipes

spring

158 recipes

springdata

2 recipes

springdoc

10 recipes

springfox

2 recipes

springframework

9 recipes

sql

6 recipes

sqlserver

4 recipes

storybook

9 recipes

stylistic

87 recipes

supply

1 recipe

svelte

18 recipes

swagger

9 recipes

taglib

3 recipes

taglibs

1 recipe

tapestry

4 recipes

templating

1 recipe

terraform

114 recipes

test

5 recipes

testing

46 recipes

testng

1 recipe

testwebxml

1 recipe

thymeleaf

1 recipe

tld

1 recipe

tracing

1 recipe

transaction

2 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

4 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.

virtual

2 recipes

vue

57 recipes

web

9 recipes

webflux

1 recipe

weblogic

56 recipes

webservices

5 recipes

websocket

1 recipe

webxml

1 recipe

wsee

4 recipes

xhtml

1 recipe

xjb

1 recipe

xmlunit

1 recipe

zipkin

2 recipes