All Recipes by Module
This doc contains all recipes grouped by their module.
Total recipes: 5110
io.moderne.recipe:rewrite-angular
License: Moderne Proprietary License
1 recipe
- org.openrewrite.angular.search.FindAngularComponent
- Find Angular component
- Locates usages of Angular components across the codebase including template elements and other references. If
componentNameisnull, finds all Angular components.
io.moderne.recipe:rewrite-cryptography
License: Moderne Proprietary License
4 recipes
- io.moderne.cryptography.FindRSAKeyGenParameters
- Find RSA key generation parameters
- Finds RSAKeyGenParameterSpec instantiations and extracts their parameter values into a data table.
- io.moderne.cryptography.FindSSLSocketParameters
- Find SSL socket configuration parameters
- Finds SSLSocket setter method invocations and extracts their parameter values into a data table.
- io.moderne.cryptography.FindSecurityModifications
- Find Security class modifications
- Finds invocations of java.security.Security methods that modify security configuration such as removeProvider, addProvider, insertProviderAt, setProperty, and removeProperty.
- io.moderne.cryptography.FindSecuritySetProperties
- Find
Security.setProperty(..)calls for certain properties - There is a defined set of properties that should not be set using
Security.setProperty(..)as they can lead to security vulnerabilities.
- Find
io.moderne.recipe:rewrite-devcenter
License: Moderne Source Available License
6 recipes
- io.moderne.devcenter.DependencyVulnerabilityCheck
- Vulnerabilities status
- Determine the current state of a repository relative to its vulnerabilities.
- io.moderne.devcenter.JUnitJupiterUpgrade
- Move to JUnit 6
- Move to JUnit Jupiter.
- io.moderne.devcenter.JavaVersionUpgrade
- Move to a later Java version
- Determine the current state of a repository relative to a desired Java version upgrade.
- io.moderne.devcenter.LibraryUpgrade
- Library upgrade
- Determine the current state of a repository relative to a desired library upgrade.
- io.moderne.devcenter.ParentPomUpgrade
- Parent POM upgrade
- Determine the current state of a repository relative to a desired parent POM upgrade.
- io.moderne.devcenter.ReportAsSecurityIssues
- Report as security issues
- Look for results produced by recipes in the same recipe list that this recipe is part of, and report them as security issues in DevCenter.
io.moderne.recipe:rewrite-elastic
License: Moderne Proprietary License
8 recipes
- io.moderne.elastic.elastic9.ChangeApiNumericFieldType
- Change numeric field type with conversion
- Adds conversion methods with null checks for numeric type changes in Elasticsearch 9 API.
- io.moderne.elastic.elastic9.MigrateDenseVectorElementType
- Migrate DenseVectorProperty.elementType from String to DenseVectorElementType enum
- In Elasticsearch 9,
DenseVectorProperty.elementType()returnsDenseVectorElementTypeenum instead ofString, and the builder methodelementType(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()returnsDenseVectorSimilarityenum instead ofString, and the builder methodsimilarity(String)now accepts the enum type. This recipe handles both builder calls and getter calls.
- io.moderne.elastic.elastic9.MigrateMatchedQueries
- Migrate
matchedQueriesfrom List to Map - In Elasticsearch Java Client 9.0,
Hit.matchedQueries()changed from returningList<String>toMap<String, Double>. This recipe migrates the usage by adding.keySet()for iterations and usingnew ArrayList<>(result.keySet())for assignments.
- Migrate
- io.moderne.elastic.elastic9.MigrateScriptSource
- Migrate script source from String to Script/ScriptSource
- Migrates
Script.source(String)calls to useScriptSource.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 aFieldValueinstead ofString. This recipe updates calls to handle the new return type by checking if it's a string and extracting the string value.
- Migrate
- io.moderne.elastic.elastic9.RenameApiField
- Rename
Elasticsearch valueBody()methods - In Elasticsearch Java Client 9.0, the generic
valueBody()method andvalueBody(...)builder methods have been replaced with specific getter and setter methods that better reflect the type of data being returned. Similarly, forGetRepositoryResponse, theresultfield also got altered torepositories.
- Rename
- io.moderne.elastic.elastic9.UseNamedValueParameters
- Use NamedValue parameters instead of Map
- Migrates
indicesBoostanddynamicTemplatesparameters fromMaptoNamedValuein Elasticsearch Java client 9.x.
io.moderne.recipe:rewrite-hibernate
License: Moderne Proprietary License
22 recipes
- io.moderne.hibernate.search.FindJPQLDefinitions
- Find JPQL definitions (Moderne Edition)
- Find Java Persistence Query Language definitions in the codebase.
- io.moderne.hibernate.update66.FixConflictingClassTypeAnnotations
- Fix conflicting class type annotation Hibernate 6.6 (Moderne Edition)
- Since Hibernate 6.6 a mapped class can have either
@MappedSuperclassor@Embeddable, or@Entity. This recipe removes@Entityfrom classes annotated with@MappedSuperclassor@Embeddable. For the moment die combination of@MappedSuperclassor@Embeddableis advised to migrate to Single Table Inheritance but still accepted and therefore stays.
- io.moderne.hibernate.update66.RemoveTableFromInheritedEntity
- Remove table from single table inherited entity (Moderne Edition)
- For Single Table Inherited Entities Hibernate ignores the
@Tableannotation on child entities. From Version 6.6 it is considered an error.
- io.moderne.hibernate.update70.AddCascadePersistToIdMappedAssociations
- Migrate implicit cascade=PERSIST for @Id and @MapsId associations (Moderne Edition)
- Hibernate used to automatically enable cascade=PERSIST for association fields annotated @Id or @MapsId. This was undocumented and unexpected behavior, and no longer supported in Hibernate 7. Existing code which relies on this behavior will be modified by addition of explicit cascade=PERSIST to the association fields.
- io.moderne.hibernate.update70.CompositeUserTypeSessionFactoryImplementor
- Remove leaking of SessionFactoryImplementor from
org.hibernate.usertype.CompositeUserTypeinvocations and implementations (Moderne Edition) - Remove leaking of SessionFactoryImplementor from
org.hibernate.usertype.CompositeUserTypeinvocations and implementations.
- Remove leaking of SessionFactoryImplementor from
- io.moderne.hibernate.update70.MigrateConfigurableToGeneratorCreationContext
- Migrate
Configurable.configure()to useGeneratorCreationContext(Moderne Edition) - In Hibernate 7.0,
Configurable.configure()now takes aGeneratorCreationContextparameter instead ofServiceRegistry. This recipe migrates method signatures and call sites.
- Migrate
- io.moderne.hibernate.update70.MigrateIntegratorMethod
- Migrate Hibernate
Integrator#integratemethod (Moderne Edition) - Migrate Hibernate
Integrator#integratemethod from deprecated signature to Hibernate 7 compatible signature. Changesintegrate(Metadata, SessionFactoryImplementor, SessionFactoryServiceRegistry)tointegrate(Metadata, BootstrapContext, SessionFactoryImplementor).
- Migrate Hibernate
- io.moderne.hibernate.update70.MigrateJdbcTypeToJdbcTypeCode
- Migrate @JdbcType to @JdbcTypeCode (Moderne Edition)
- In Hibernate 7.0, various JDBC types were moved to internal packages. Use @JdbcTypeCode with SqlTypes constants instead of @JdbcType with specific classes.
- io.moderne.hibernate.update70.MigrateLockOptionsToDirectParameters
- Migrate LockOptions to direct parameters (Moderne Edition)
- Migrates deprecated
LockOptionsusage to direct parameters in method calls. As of JPA 3.2 and Hibernate 7,LockMode,Timeout, andPessimisticLockScopeare passed directly tofind(),refresh(), andlock()methods instead of being wrapped in aLockOptionsobject.
- io.moderne.hibernate.update70.MigrateMetamodelImplementor
- Migrate
MetamodelImplementorto Hibernate 7.0 (Moderne Edition) - In Hibernate 7.0,
MetamodelImplementorhas been split intoMappingMetamodelfor ORM-specific operations andJpaMetamodelfor JPA-standard operations. This recipe migrates the usage based on which methods are called.
- Migrate
- io.moderne.hibernate.update70.MigrateNaturalIdLoadAccess
- Migrate NaturalIdLoadAccess method calls (Moderne Edition)
- Migrates NaturalIdLoadAccess#using(Object...) to using(Map.of(...)) variants for Hibernate 7.0.
- io.moderne.hibernate.update70.MigrateNaturalIdMultiLoadAccess
- Migrate NaturalIdMultiLoadAccess method calls (Moderne Edition)
- Migrates NaturalIdMultiLoadAccess#compoundValue(Object...) to Map.of(...) variants for Hibernate 7.0.
- io.moderne.hibernate.update70.MigrateSessionInterface
- Migrate Session interface method calls (Moderne Edition)
- Migrates code using deprecated Session interface methods to their Hibernate 7.0 replacements.
- io.moderne.hibernate.update70.MigrateSessionToDeferToJPA
- Migrate Session save/update/delete method calls (Moderne Edition)
- Migrates code using deprecated Session load/get/refresh/save/update/delete methods to their Hibernate 7.0 replacements.
- io.moderne.hibernate.update70.MigrateSetFlushModeToSetQueryFlushMode
- Migrate
setFlushMode()tosetQueryFlushMode()(Moderne Edition) - In Hibernate 7.0,
CommonQueryContract.setFlushMode(FlushModeType)has been replaced withsetQueryFlushMode(QueryFlushMode). This recipe migrates the method call and convertsFlushModeTypeparameters to theirQueryFlushModeequivalents.
- Migrate
- io.moderne.hibernate.update70.MigrateToTargetEmbeddable
- Migrate to @TargetEmbeddable (Moderne Edition)
- Migrates code using removed @Target to to Hibernate 7.0's @TargetEmbeddable equivalent. Removes misused @Target annotations.
- io.moderne.hibernate.update70.RemoveUnnecessaryCastToSession
- Remove unnecessary cast to
SessionforSessionFactory.createEntityManager()(Moderne Edition) - In Hibernate 7.0,
SessionFactory.createEntityManager()explicitly returns Session, making casts to Session unnecessary.
- Remove unnecessary cast to
- io.moderne.hibernate.update70.ReplaceHibernateWithJakartaAnnotations
- Replace hibernate annotations with Jakarta variants (Moderne Edition)
- Tries to replaces annotations that have been removed in Hibernate 7.0 with its Jakarta equivalent, such as Table, @Where, @OrderBy, etc. If a annotation is used with arguments that do not have a direct replacement, the annotation is not replaced at all.
- io.moderne.hibernate.update70.ReplaceSessionLockRequest
- Replace Session.buildLockRequest with LockOptions (Moderne Edition)
- Migrates Session.buildLockRequest(LockOptions.X) calls to use session.lock(entity, new LockOptions(LockMode.X)) in Hibernate 7.0.
- io.moderne.hibernate.update70.UnboxingTransactionTimeout
- Null safe Transaction#getTimeout() (Moderne Edition)
- JPA 3.2 adds
#getTimeoutbut usesIntegerwhereas Hibernate has historically usedint. Note that this raises the possibility of aNullPointerExceptionduring migration if, e.g., performing direct comparisons on the timeout value against an in (auto unboxing). This recipe adds ternary operators whereTransaction#getTimeout()is used and a negative value will be used if thegetTimeout()resulted in a null value.
- io.moderne.hibernate.update70.UserTypeNullSafeGetSharedSessionContractImplementorRecipe
- Remove leaking of SharedSessionContractImplementor from
org.hibernate.usertype.UserTypeinvocations (Moderne Edition) - Remove leaking of SharedSessionContractImplementor from
org.hibernate.usertype.UserTypeinvocations.
- Remove leaking of SharedSessionContractImplementor from
- io.moderne.hibernate.update70.UserTypeSharedSessionContractImplementor
- Remove leaking of SharedSessionContractImplementor from
org.hibernate.usertype.UserTypeimplementations (Moderne Edition) - Remove leaking of SharedSessionContractImplementor from
org.hibernate.usertype.UserTypeimplementations.
- Remove leaking of SharedSessionContractImplementor from
io.moderne.recipe:rewrite-jasperreports
License: Moderne Proprietary License
1 recipe
- io.moderne.jasperreports.v5.MigrateExporterSetParameter
- Migrate JasperReports exporter setParameter to new API
- Migrates deprecated
setParametercalls on JasperReports exporters to the new API usingsetExporterInputandsetExporterOutput.
io.moderne.recipe:rewrite-kafka
License: Moderne Proprietary License
12 recipes
- io.moderne.kafka.MigrateAlterConfigsToIncrementalAlterConfigs
- Migrate
AdminClient.alterConfigs()toincrementalAlterConfigs() - Migrates the removed
AdminClient.alterConfigs()method toincrementalAlterConfigs()for Kafka 4.0 compatibility.
- Migrate
- io.moderne.kafka.MigrateConsumerCommittedToSet
- Migrate
KafkaConsumer.committed(TopicPartition)tocommitted(Set<TopicPartition>) - Migrates from the removed
KafkaConsumer.committed(TopicPartition)tocommitted(Set<TopicPartition>)for Kafka 4.0 compatibility. Converts singleTopicPartitionarguments toCollections.singleton()calls.
- Migrate
- io.moderne.kafka.MigrateConsumerPollToDuration
- Migrate
KafkaConsumer.poll(long)topoll(Duration) - Migrates from the deprecated
KafkaConsumer.poll(long)topoll(Duration)for Kafka 4.0 compatibility. Converts millisecond timeout values toDuration.ofMillis()calls.
- Migrate
- io.moderne.kafka.MigrateSendOffsetsToTransaction
- Migrate deprecated
sendOffsetsToTransactionto useConsumerGroupMetadata - Migrates from the deprecated
KafkaProducer.sendOffsetsToTransaction(Map, String)tosendOffsetsToTransaction(Map, ConsumerGroupMetadata)for Kafka 4.0 compatibility. This recipe uses a conservative approach withnew ConsumerGroupMetadata(groupId).
- Migrate deprecated
- io.moderne.kafka.RemoveDeprecatedKafkaProperties
- Remove deprecated Kafka property
- Removes a specific Kafka property that is no longer supported in Kafka 4.0.
- io.moderne.kafka.streams.MigrateKStreamToTable
- Migrate KStream to KTable conversion to use
toTable()method - In Kafka Streams 2.5, a new
toTable()method was added to simplify converting a KStream to a KTable. This recipe replaces the manual aggregation pattern.groupByKey().reduce((oldVal, newVal) -> newVal)with the more concise.toTable()method.
- Migrate KStream to KTable conversion to use
- io.moderne.kafka.streams.MigrateKafkaStreamsStoreMethod
- Migrate deprecated
KafkaStreams#storemethod - In Kafka Streams 2.5, the method
KafkaStreams#store(String storeName, QueryableStoreType<T> storeType)was deprecated. It only allowed querying active stores and did not support any additional query options. Use the newStoreQueryParametersAPI instead.
- Migrate deprecated
- io.moderne.kafka.streams.MigrateRetryConfiguration
- Migrate deprecated retry configuration to task timeout
- In Kafka 2.7,
RETRIES_CONFIGandRETRY_BACKOFF_MS_CONFIGwere deprecated in favor ofTASK_TIMEOUT_MS_CONFIG. This recipe migrates the old retry configuration to the new task timeout configuration, attempting to preserve the retry budget by multiplying retries × backoff time. If only one config is present, it falls back to 60000ms (1 minute).
- io.moderne.kafka.streams.MigrateStreamsUncaughtExceptionHandler
- Migrate to StreamsUncaughtExceptionHandler API
- Migrates from the JVM-level Thread.UncaughtExceptionHandler to Kafka Streams' StreamsUncaughtExceptionHandler API introduced in version 2.8. This new API provides explicit control over how the Streams client should respond to uncaught exceptions (REPLACE_THREAD, SHUTDOWN_CLIENT, or SHUTDOWN_APPLICATION).
- io.moderne.kafka.streams.MigrateTaskMetadataTaskId
- Migrate
TaskMetadata.taskId()to returnTaskId - In Kafka Streams 3.0,
TaskMetadata.taskId()changed its return type fromStringtoTaskId. This recipe adds.toString()calls where necessary to maintain String compatibility.
- Migrate
- io.moderne.kafka.streams.MigrateWindowStorePutMethod
- Migrate
WindowStore.put()to include timestamp - In Kafka Streams 2.4,
WindowStore.put()requires a timestamp parameter. This recipe addscontext.timestamp()as the third parameter.
- Migrate
- io.moderne.kafka.streams.RemovePartitionGrouperConfiguration
- Remove
PartitionGrouperconfiguration - Starting with Kafka Streams 2.4, the
PartitionGrouperAPI was deprecated and partition grouping is now fully handled internally by the library. This recipe removes the deprecatedPARTITION_GROUPER_CLASS_CONFIGconfiguration.
- Remove
io.moderne.recipe:rewrite-program-analysis
License: Moderne Proprietary License
15 recipes
- org.openrewrite.analysis.java.FindNullPointerIssues
- Find null pointer issues
- Detects potential null pointer dereferences using path-sensitive analysis to distinguish between definite NPEs, possible NPEs, and safe dereferences.
- org.openrewrite.analysis.java.controlflow.FindUnusedDefinitions
- Find unused variable definitions
- Identifies variable assignments whose values are never used before being overwritten.
- org.openrewrite.analysis.java.controlflow.search.FindCyclomaticComplexity
- Find cyclomatic complexity
- Calculates the cyclomatic complexity of methods and produces a data table containing the class name, method name, argument types, complexity value, and complexity threshold.
- org.openrewrite.analysis.java.controlflow.search.FindUnreachableCode
- Find unreachable code
- Uses control flow analysis to identify statements that can never be executed.
- org.openrewrite.analysis.java.dataflow.FindDeadStores
- Find dead stores
- Identifies variable assignments whose values are never used before being overwritten or going out of scope.
- org.openrewrite.analysis.java.datalineage.TrackDataLineage
- Track data lineage
- Tracks the flow of data from database sources (JDBC queries, JPA entities) to API sinks (REST endpoints, GraphQL mutations) to understand data dependencies and support compliance requirements.
- org.openrewrite.analysis.java.privacy.FindPiiExposure
- Find PII exposure in logs and external APIs
- Detects when Personally Identifiable Information (PII) is exposed through logging statements or sent to external APIs without proper sanitization. This helps prevent data leaks and ensures compliance with privacy regulations like GDPR and CCPA.
- org.openrewrite.analysis.java.security.FindCommandInjection
- Find command injection vulnerabilities
- Detects when user-controlled input flows into system command execution methods like Runtime.exec() or ProcessBuilder, which could allow attackers to execute arbitrary commands.
- org.openrewrite.analysis.java.security.FindLdapInjection
- Find LDAP injection vulnerabilities
- Finds LDAP injection vulnerabilities by tracking tainted data flow from user input to LDAP queries.
- org.openrewrite.analysis.java.security.FindPathTraversal
- Find path traversal vulnerabilities
- Detects potential path traversal vulnerabilities where user input flows to file system operations without proper validation.
- org.openrewrite.analysis.java.security.FindSecurityVulnerabilities
- Find security vulnerabilities using taint analysis
- Identifies potential security vulnerabilities where untrusted data from sources flows to sensitive sinks without proper sanitization.
- org.openrewrite.analysis.java.security.FindSqlInjection
- Find SQL injection vulnerabilities
- Detects potential SQL injection vulnerabilities where user input flows to SQL execution methods without proper sanitization.
- org.openrewrite.analysis.java.security.FindUnencryptedPiiStorage
- Find unencrypted PII storage
- Identifies when personally identifiable information (PII) is stored in databases, files, or other persistent storage without encryption.
- org.openrewrite.analysis.java.security.FindXssVulnerability
- Find XSS vulnerabilities
- Detects potential cross-site scripting vulnerabilities where user input flows to output methods without proper sanitization.
- org.openrewrite.analysis.java.security.FindXxeVulnerability
- Find XXE vulnerabilities
- Locates XML parsers that are not configured to prevent XML External Entity (XXE) attacks.
io.moderne.recipe:rewrite-react
License: Moderne Proprietary License
2 recipes
- org.openrewrite.react.search.FindPropUsage
- Find React prop usage
- Locates usages of a specific prop of a React component.
- org.openrewrite.react.search.FindReactComponent
- Find React component
- Locates usages of React components across the codebase including JSX elements and other references. If
componentNameisnull, finds all React components.
io.moderne.recipe:rewrite-spring
License: Moderne Proprietary License
38 recipes
- io.moderne.java.spring.boot.AddSpringBootApplication
- Add
@SpringBootApplicationclass - Adds a
@SpringBootApplicationclass containing a main method to bootify your Spring Framework application.
- Add
- io.moderne.java.spring.boot.FieldToConstructorInjection
- Convert field injection to constructor injection
- Converts
@Autowiredfield injection to constructor injection pattern. For non-final classes, adds both a no-args constructor and the autowired constructor to maintain compatibility with extending classes. Moves@Qualifierannotations to constructor parameters.
- io.moderne.java.spring.boot.IsLikelyNotSpringBoot
- Is likely not a Spring Boot project
- Marks the project if it's likely not a Spring Boot project.
- io.moderne.java.spring.boot.IsLikelySpringBoot
- Is likely a Spring Boot project
- Marks the project if it's likely a Spring Boot project.
- io.moderne.java.spring.boot.MigrateSpringFrameworkDependenciesToSpringBoot
- Migrate Spring Framework dependencies to Spring Boot
- Migrate Spring Framework dependencies to Spring Boot.
- io.moderne.java.spring.boot3.AddValidToConfigurationPropertiesFields
- Add
@Validannotation to fields - In Spring Boot 3.4, validation of
@ConfigurationPropertiesclasses annotated with@Validatednow follows the Bean Validation specification, only cascading to nested properties if the corresponding field is annotated with@Valid. The recipe will add a@Validannotation to each field which has a type that has a field which is annotated with ajakarta.validation.constraints.*annotation.
- Add
- io.moderne.java.spring.boot3.CommentOnMockAndSpyBeansInConfigSpring34
- Comment on
@MockitoSpyBeanand@MockitoBeanin@Configuration - As stated in Spring Docs
@MockitoSpyBeanand@MockitoBeanwill only work in tests, explicitly not in@Configurationannotated classes.
- Comment on
- io.moderne.java.spring.boot3.ConditionalOnAvailableEndpointMigrationSpring34
- Migrate
ConditionalOnAvailableEndpointfor Spring Boot 3.4 - Migrate
@ConditionalOnAvailableEndpoint(EndpointExposure.CLOUD_FOUNDRY)to@ConditionalOnAvailableEndpoint(EndpointExposure.WEB)for Spring Boot 3.4.
- Migrate
- io.moderne.java.spring.boot3.MigrateAbstractDiscoveredEndpointConstructor
- Migrate
AbstractDiscoveredEndpointdeprecated constructor - The boolean-parameter constructor of
AbstractDiscoveredEndpointhas been deprecated in Spring Boot 3.4. This recipe transforms it to use the new constructor with anAccessparameter.
- Migrate
- io.moderne.java.spring.boot3.MigrateAbstractExposableEndpointConstructor
- Migrate
AbstractExposableEndpointdeprecated constructor - The boolean-parameter constructor of
AbstractExposableEndpointhas been deprecated in Spring Boot 3.4. This recipe transforms it to use the new constructor with anAccessparameter instead of booleanenableByDefault.
- Migrate
- io.moderne.java.spring.boot3.MigrateEndpointAnnotationAccessValueSpring34
- Migrate
@EndpointsdefaultAccessvalue - Since Spring Boot 3.4 the
@Endpointaccess configuration values are no longertrue|falsebutnone|read-only|unrestricted.
- Migrate
- io.moderne.java.spring.boot3.MigrateEndpointDiscovererConstructor
- Migrate
EndpointDiscovererdeprecated constructor - The 4-parameter constructor of
EndpointDiscovererhas been deprecated in Spring Boot 3.4. This recipe transforms it to use the new 5-parameter constructor with an additional Collection parameter.
- Migrate
- io.moderne.java.spring.boot3.MigrateEntityManagerFactoryBuilderConstructor
- Migrate
EntityManagerFactoryBuilderdeprecated constructor - The constructors of
EntityManagerFactoryBuilderhave been deprecated in Spring Boot 3.4. This recipe transforms them to use the new constructor with a Function parameter for property mapping.
- Migrate
- io.moderne.java.spring.boot3.MigrateJmxEndpointDiscovererConstructor
- Migrate
JmxEndpointDiscovererdeprecated constructor - The 4-parameter constructor of
JmxEndpointDiscovererhas been deprecated in Spring Boot 3.4. This recipe transforms it to use the new 5-parameter constructor with an additional Collection parameter.
- Migrate
- io.moderne.java.spring.boot3.MigrateWebEndpointDiscovererConstructor
- Migrate WebEndpointDiscoverer 6-parameter constructor to 8-parameter
- The 6-parameter constructor of
WebEndpointDiscovererhas been deprecated in Spring Boot 3.3. This recipe adds two new parameters (AdditionalPathsMapperandOperationFilter<WebOperation>) to the constructor and updates the Bean method signature to inject them asObjectProvidertypes.
- io.moderne.java.spring.boot3.RemoveDeprecatedConditions
- Remove Spring Boot 3.5 deprecated conditions
- Replace Spring Boot 3.5 deprecated condition classes with their corresponding conditional annotations.
- io.moderne.java.spring.boot3.RemoveReplaceNoneFromAutoConfigureTestDatabase
- Remove
Replace.NONEfrom@AutoConfigureTestDatabase Replace.NONEis the default value for@AutoConfigureTestDatabasesince Spring Boot 3.4.
- Remove
- io.moderne.java.spring.boot3.RemoveTestRestTemplateEnableRedirectsOptionRecipe
- Remove
TestRestTemplate.HttpClientOption.ENABLE_REDIRECTSoption - The
TestRestTemplatenow uses the same follow redirects settings as the regular RestTemplate. TheHttpOption.ENABLE_REDIRECTSoption has also been deprecated. This recipe removes the option from theTestRestTemplateconstructor arguments.
- Remove
- io.moderne.java.spring.boot3.ReplaceConditionalOutcomeInverse
- Replace ConditionOutcome.inverse() with constructor
- Replace deprecated
ConditionOutcome.inverse(ConditionOutcome outcome)calls withnew ConditionOutcome(!outcome.isMatch(), outcome.getConditionMessage()).
- io.moderne.java.spring.boot3.ReplaceDeprecatedKafkaConnectionDetailsBootstrapServerGetters
- Replace deprecated
KafkaConnectionDetailsbootstrap server methods - Replace deprecated
KafkaConnectionDetailsbootstrap server methods with chained calls. For example,getProducerBootstrapServers()becomesgetProducer().getBootstrapServers().
- Replace deprecated
- io.moderne.java.spring.boot3.ReplaceDeprecatedThreadPoolTaskSchedulerConstructor
- Replace deprecated ThreadPoolTaskSchedulerBuilder 5-argument constructor
- The 5-parameter constructor of
ThreadPoolTaskSchedulerBuilderhas been deprecated in Spring Boot 3.5. This recipe transforms it to use the builder pattern instead, omitting null values and defaults.
- io.moderne.java.spring.boot3.ReplaceKafkaTransactionManagerSetter
- Use
kafkaAwareTransactionManagersetter - Replace deprecated
ContainerProperties#setTransactionManager(org.springframework.transaction.PlatformTransactionManager)method withContainerProperties#setKafkaAwareTransactionManager(org.springframework.kafka.transaction.KafkaAwareTransactionManager). The method will be replaced only if its argument has the typeKafkaAwareTransactionManager.
- Use
- io.moderne.java.spring.boot3.ResolveTaskExecutorFromContext
- Replace
taskExecutorwithapplicationTaskExecutor - Use bean name
applicationTaskExecutorinstead oftaskExecutorwhen resolvingTaskExecutorBean from application context.
- Replace
- io.moderne.java.spring.boot4.AddAutoConfigureMockMvc
- Add
@AutoConfigureMockMvcto@SpringBootTestclasses usingMockMvc - Adds
@AutoConfigureMockMvcannotation to classes annotated with@SpringBootTestthat useMockMvc.
- Add
- io.moderne.java.spring.boot4.MigrateSpringRetryToSpringFramework7
- Migrate
spring-retryto Spring Framework resilience - Migrate
spring-retrys@Retryableand@Backoffannotation to Spring Framework 7 Resilience annotations.
- Migrate
- io.moderne.java.spring.boot4.RemoveGradleUberJarLoaderImplementationConfig
- Remove
loaderImplementationfrom Gradle - Removes the Spring Boot Uber-Jar
loaderImplementationconfiguration from Gradle build files.
- Remove
- io.moderne.java.spring.boot4.ReplaceDeprecatedAutoconfigureMongoApi
- Replace deprecated
org.springframework.boot.autoconfigure.mongoAPI - Replace deprecated
org.springframework.boot.autoconfigure.mongoAPI.
- Replace deprecated
- io.moderne.java.spring.boot4.ReplaceDeprecatedDockerApi
- Replace deprecated
DockerApi - Replaces deprecated
DockerApiconstructors and configuration methods with their modern equivalents.
- Replace deprecated
- io.moderne.java.spring.boot4.ReplaceDeprecatedRequestMatcherProvider
- Replace deprecated RequestMatcherProvider with new API
- Replaces the deprecated
org.springframework.boot.autoconfigure.security.servlet.RequestMatcherProviderwithorg.springframework.boot.security.autoconfigure.actuate.web.servlet.RequestMatcherProvider. The new interface adds anHttpMethodparameter to thegetRequestMatchermethod.
- io.moderne.java.spring.boot4.ReplaceDeprecatedThreadPoolTaskSchedulerBuilderApi
- Replace deprecated
ThreadPoolTaskSchedulerBuilderconstructor - Replaces the deprecated 5-argument constructor of
ThreadPoolTaskSchedulerBuilderwith the builder pattern.
- Replace deprecated
- io.moderne.java.spring.framework.IsLikelySpringFramework
- Is likely a Spring Framework project
- Marks the project if it's likely a Spring Framework project.
- io.moderne.java.spring.framework.JaxRsToSpringWeb
- Convert JAX-RS annotations to Spring Web
- Converts JAX-RS annotations such as
@Path,@GET,@POST, etc., to their Spring Web equivalents like@RestController,@RequestMapping,@GetMapping, etc.
- io.moderne.java.spring.framework.NullableSpringWebParameters
- Add
@Nullableto optional Spring web parameters - In Spring Boot 4, JSpecify's
@Nullableannotation should be used to indicate that a parameter can be null. This recipe adds@Nullableto parameters annotated with@PathVariable(required = false)or@RequestParam(required = false)and removes the now-redundantrequired = falseattribute.
- Add
- io.moderne.java.spring.framework.beansxml.BeansXmlToConfiguration
- Migrate
beans.xmlto Spring Framework configuration class - Converts Java/Jakarta EE
beans.xmlconfiguration files to Spring Framework@Configurationclasses.
- Migrate
- io.moderne.java.spring.framework.webxml.WebXmlToWebApplicationInitializer
- Migrate
web.xmltoWebApplicationInitializer - Migrate
web.xmltoWebApplicationInitializerfor Spring applications. This allows for programmatic configuration of the web application context, replacing the need for XML-based configuration. This recipe only picks upweb.xmlfiles located in thesrc/main/webapp/WEB-INFdirectory to avoid inference with tests. It creates aWebXmlWebAppInitializerclass insrc/main/javawith respect to submodules if they contain java files. If it finds an existingWebXmlWebAppInitializer, it skips the creation.
- Migrate
- io.moderne.java.spring.hibernate.MigrateDaoSupportGetSession
- Migrate
HibernateDaoSupport#getSession()usage - Migrate
HibernateDaoSupport#getSession()usage toHibernateDaoSupport#getSessionFactory()#getCurrentSession()and annotate the methods with@Transactional.
- Migrate
- io.moderne.java.spring.hibernate.MigrateSaveOrUpdateAll
- Migrate
HibernateDaoSupport#getHibernateTemplate#saveOrUpdateAll - Migrate removed
HibernateDaoSupport#getHibernateTemplate#.saveOrUpdateAllto an iterativeHibernateDaoSupport#getHibernateTemplate#.saveOrUpdate.
- Migrate
- io.moderne.java.spring.security6.MigrateAntPathRequestMatcher
- Migrate antPathRequestMatcher to pathPatternRequestMatcher
- In Spring Security 6.5,
AntPathRequestMatcheris deprecated in favor ofPathPatternRequestMatcher. This recipe migrates static method calls and constructor usage to the new pattern.
io.moderne.recipe:rewrite-vulncheck
License: Moderne Proprietary License
1 recipe
- io.moderne.vulncheck.FixVulnCheckVulnerabilities
- Use VulnCheck Exploit Intelligence to fix vulnerabilities
- This software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe by default only upgrades to the latest patch version. If a minor or major upgrade is required to reach the fixed version, this can be controlled using the
maximumUpgradeDeltaoption. Vulnerability information comes from VulnCheck Vulnerability Intelligence. The recipe has an option to limit fixes to only those vulnerabilities that have evidence of exploitation at various levels of severity.
org.openrewrite.meta:rewrite-analysis
License: Apache License Version 2.0
4 recipes
- org.openrewrite.analysis.controlflow.ControlFlowVisualization
- Control flow visualization
- Visualize the control flow of a Java program.
- org.openrewrite.analysis.search.FindFlowBetweenMethods
- Finds flow between two methods
- Takes two patterns for the start/end methods to find flow between.
- org.openrewrite.analysis.search.FindMethods
- Find method usages
- Find method usages by pattern.
- org.openrewrite.analysis.search.UriCreatedWithHttpScheme
- URIs created with an HTTP scheme
- This is a sample recipe demonstrating a simple application of local data flow analysis.
org.openrewrite.recipe:rewrite-ai-search
License: Moderne Proprietary License
6 recipes
- io.moderne.ai.FindCommentsLanguage
- Find comments' language distribution
- Finds all comments and uses AI to predict which language the comment is in.
- io.moderne.ai.ListAllMethodsUsed
- List all methods used
- List all methods used in any Java source file.
- io.moderne.ai.SpellCheckCommentsInFrench
- Fix mis-encoded comments in French
- Use spellchecker to fix mis-encoded French comments in comments, JavaDocs, properties or XML files. Mis-encoded comments will contain either '?' or '�'.
- io.moderne.ai.research.FindCodeThatResembles
- Find method invocations that resemble a pattern
- This recipe uses two phase AI approach to find a method invocation that resembles a search string.
- io.moderne.ai.research.GetCodeEmbedding
- Get embeddings for code snippets in code
- This recipe calls an AI model to get an embedding for either classes or methods which can then be used for downstream tasks.
- io.moderne.ai.research.GetRecommendations
- Get recommendations
- This recipe calls an AI model to get recommendations for modernizing the code base by looking at a sample of method declarations.
org.openrewrite.recipe:rewrite-all
License: Apache License Version 2.0
3 recipes
- org.openrewrite.FindCallGraph
- Find call graph
- Produces a data table where each row represents a method call.
- org.openrewrite.FindDuplicateSourceFiles
- Find duplicate source files
- Record the presence of LSTs with duplicate paths, indicating that the same file was parsed more than once.
- org.openrewrite.LanguageComposition
- Language composition report
- Counts the number of lines of the various kinds of source code and data formats parsed by OpenRewrite. Comments are not included in line counts. This recipe emits its results as two data tables, making no changes to any source file. One data table is per-file, the other is per-repository.
org.openrewrite.recipe:rewrite-android
License: Moderne Proprietary License
2 recipes
- org.openrewrite.android.ChangeAndroidSdkVersion
- Change Android SDK version
- Change
compileSdk,compileSdkVersion,targetSdkandtargetSdkVersionin an Android Gradle build file to the argument version.
- org.openrewrite.android.UpgradeAndroidGradlePluginVersion
- Upgrade Android Gradle Plugin (AGP) version
- Upgrade Android Gradle Plugin (AGP) version and update the Gradle Wrapper version. Compatible versions are published in the AGP release notes.
org.openrewrite.recipe:rewrite-apache
License: Moderne Source Available License
78 recipes
- org.openrewrite.apache.commons.codec.ApacheBase64ToJavaBase64
- Prefer
java.util.Base64 - Prefer the Java standard library's
java.util.Base64over third-party usage of apache'sapache.commons.codec.binary.Base64.
- Prefer
- org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes
ApacheCommonsFileUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.commons.io.ApacheCommonsFileUtils.
- org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes$GetFileRecipe
- Replace
FileUtils.getFile(String...)with JDK provided API - Replace Apache Commons
FileUtils.getFile(String... name)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes$WriteStringToFileRecipe
- Replace
FileUtils.writeStringToFile(File, String)with JDK provided API - Replace Apache Commons
FileUtils.writeStringToFile(File file, String data)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.io.ApacheFileUtilsToJavaFiles
- Prefer
java.nio.file.Files - Prefer the Java standard library's
java.nio.file.Filesover third-party usage of apache'sapache.commons.io.FileUtils.
- Prefer
- org.openrewrite.apache.commons.io.ApacheIOUtilsUseExplicitCharset
- Use IOUtils method that include their charset encoding
- Use
IOUtilsmethod invocations that include the charset encoding instead of using the deprecated versions that do not include a charset encoding. (e.g. convertsIOUtils.readLines(inputStream)toIOUtils.readLines(inputStream, StandardCharsets.UTF_8).
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes
ApacheCommonsStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.commons.lang.ApacheCommonsStringUtils.
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$AbbreviateRecipe
- Replace
StringUtils.abbreviate(String, int)with JDK provided API - Replace Apache Commons
StringUtils.abbreviate(String str, int maxWidth)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$CapitalizeRecipe
- Replace
StringUtils.capitalize(String)with JDK provided API - Replace Apache Commons
StringUtils.capitalize(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$DefaultStringFallbackRecipe
- Replace
StringUtils.defaultString(String, String)with JDK provided API - Replace Apache Commons
StringUtils.defaultString(String str, String nullDefault)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$DefaultStringRecipe
- Replace
StringUtils.defaultString(String)with JDK provided API - Replace Apache Commons
StringUtils.defaultString(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$DeleteWhitespaceRecipe
- Replace
StringUtils.deleteWhitespace(String)with JDK provided API - Replace Apache Commons
StringUtils.deleteWhitespace(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$EqualsIgnoreCaseRecipe
- Replace
StringUtils.equalsIgnoreCase(CharSequence, CharSequence)with JDK provided API - Replace Apache Commons
StringUtils.equalsIgnoreCase(CharSequence cs1, CharSequence cs2)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$EqualsRecipe
- Replace
StringUtils.equals(CharSequence, CharSequence)with JDK provided API - Replace Apache Commons
StringUtils.equals(CharSequence cs1, CharSequence cs2)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$LowercaseRecipe
- Replace
StringUtils.lowerCase(String)with JDK provided API - Replace Apache Commons
StringUtils.lowerCase(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$RemoveEndRecipe
- Replace
StringUtils.removeEnd(String, String)with JDK provided API - Replace Apache Commons
StringUtils.removeEnd(String str, String remove)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$RemoveRedundantNullCheckWithIsNotBlankRecipe
- Remove redundant null check when using
StringUtils.isNotBlank(String) - Remove redundant null check when using
StringUtils.isNotBlank(String)as it already handles null values.
- Remove redundant null check when using
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$ReplaceRecipe
- Replace
StringUtils.replace(String, String, String)with JDK provided API - Replace Apache Commons
StringUtils.replace(String text, String searchString, String replacement)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$ReverseRecipe
- Replace
StringUtils.reverse(String)with JDK provided API - Replace Apache Commons
StringUtils.reverse(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$SplitRecipe
- Replace
StringUtils.split(String)with JDK provided API - Replace Apache Commons
StringUtils.split(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$StringJoinSeparatorIterableCharSequenceRecipe
- Replace
StringUtils.join(Iterable<? extends CharSequence>, String)with JDK provided API - Replace Apache Commons
StringUtils.join(Iterable<? extends CharSequence> iterable, String separator)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$StripRecipe
- Replace
StringUtils.strip(String)with JDK provided API - Replace Apache Commons
StringUtils.strip(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$TrimRecipe
- Replace
StringUtils.trim(String)with JDK provided API - Replace Apache Commons
StringUtils.trim(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$TrimToEmptyRecipe
- Replace
StringUtils.trimToEmpty(String)with JDK provided API - Replace Apache Commons
StringUtils.trimToEmpty(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$TrimToNullRecipe
- Replace
StringUtils.trimToNull(String)with JDK provided API - Replace Apache Commons
StringUtils.trimToNull(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes$UppercaseRecipe
- Replace
StringUtils.upperCase(String)with JDK internals - Replace Apache Commons
StringUtils.upperCase(String str)with JDK internals.
- Replace
- org.openrewrite.apache.commons.lang.IsNotEmptyToJdk
- Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)
- Replace any
StringUtils#isEmpty(String)and#isNotEmpty(String)withs == null || s.isEmpty()ands != null && !s.isEmpty().
- org.openrewrite.apache.httpclient4.MigrateDefaultHttpClient
- Migrates deprecated
DefaultHttpClient - Since
DefaultHttpClientis deprecated, we need to change it to theCloseableHttpClient. It only covers the default scenario with no customHttpParamsorConnectionManager. Of note: theDefaultHttpClientdoes not support TLS 1.2. References: - Find Sec Bugs. - IBM Support Pages.
- Migrates deprecated
- org.openrewrite.apache.httpclient5.AddTimeUnitArgument
- Adds a TimeUnit argument to the matched method invocations
- In Apache Http Client 5.x migration, an extra TimeUnit argument is required in the timeout and duration methods. Previously in 4.x, all these methods were implicitly having the timeout or duration expressed in milliseconds, but in 5.x the unit of the timeout or duration is required. So, by default this recipe adds
TimeUnit.MILLISECONDS, it is possible to specify this as a parameter. Since all affected methods of the Apache Http Client 5.x migration only have one integer/long argument, the recipe applies with matched method invocations of exactly one parameter.
- org.openrewrite.apache.httpclient5.ChangeArgumentToTimeValue
- Changes an argument to a
TimeValuefor matched method invocations - In Apache Http Client 5.x migration, some methods that previously took a single long argument have changed to take a
TimeValue. Previously in 4.x, all these methods were implicitly having the value expressed in milliseconds. By default this recipe usesTimeUnit.MILLISECONDSfor theTimeUnitwhen creating aTimeValue. It is possible to specify this as a parameter. Since all affected methods of the Apache Http Client 5.x migration only have one long argument, the recipe applies with matched method invocations of exactly one parameter.
- Changes an argument to a
- org.openrewrite.apache.httpclient5.InputBufferReadAddOffsetAndLengthArguments
- Adds offset and length arguments to the read method of SharedInputBuffer
- In Apache Http Client 5.x migration, the shortened form of the
read(byte[])has been removed.
- org.openrewrite.apache.httpclient5.MigrateAuthScope
- Replaces
AuthScope.ANY - Replace removed constant
org.apache.http.auth.AuthScope.AuthScope.ANYwithnew org.apache.hc.client5.http.auth.AuthScope(null, -1).
- Replaces
- org.openrewrite.apache.httpclient5.MigrateRequestConfig
- Migrate
RequestConfigto httpclient5 - Migrate
RequestConfigto httpclient5.
- Migrate
- org.openrewrite.apache.httpclient5.MigrateSSLConnectionSocketFactory
- Migrate deprecated
SSLConnectionSocketFactorytoDefaultClientTlsStrategy - Migrates usage of the deprecated
org.apache.http.conn.ssl.SSLConnectionSocketFactorytoorg.apache.hc.client5.http.ssl.DefaultClientTlsStrategywith proper connection manager setup.
- Migrate deprecated
- org.openrewrite.apache.httpclient5.MigrateStringEntityStringCharsetConstructor
- Replace
new StringEntity(String, String)withnew StringEntity(String, Charset) - Replace
new StringEntity(String, String)withnew StringEntity(String, Charset)to eliminate literal usage for charset parameters.
- Replace
- org.openrewrite.apache.httpclient5.NewRequestLine
- Replaces deprecated
HttpRequestBase::getRequestLine() HttpRequestBase::getStatusLine()was deprecated in 4.x, so we replace it withnew RequestLine(HttpRequest). Ideally we will try to simply method chains forgetMethod,getUriandgetProtocolVersion, but there are some scenarios whereRequestLineobject is assigned or used directly, and we need to instantiate the object.
- Replaces deprecated
- org.openrewrite.apache.httpclient5.NewStatusLine
- Replaces deprecated
HttpResponse::getStatusLine() HttpResponse::getStatusLine()was deprecated in 4.x, so we replace it fornew StatusLine(HttpResponse). Ideally we will try to simplify method chains forgetStatusCode,getProtocolVersionandgetReasonPhrase, but there are some scenarios where theStatusLineobject is assigned or used directly, and we need to instantiate the object.
- Replaces deprecated
- org.openrewrite.apache.httpclient5.OutputBufferWriteAddOffsetAndLengthArguments
- Adds offset and length arguments to the write method of SharedOutputBuffer
- In Apache Http Client 5.x migration, the shortened form of the
write(byte[])has been removed.
- org.openrewrite.apache.httpclient5.RemoveByteBufferAllocators
- Remove ByteBufferAllocator implementations
- In Apache Http Client 5.x migration, both implementations of
ByteBufferAllocatorhave been removed. This recipe will remove usage of said classes in favour of direct static calls toByteBuffer.
- org.openrewrite.apache.httpclient5.UsernamePasswordCredentials
- Migrate
UsernamePasswordCredentialsto httpclient5 - Change the password argument going into
UsernamePasswordCredentialsto be achar[].
- Migrate
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes
MavenSharedStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.maven.shared.MavenSharedStringUtils.
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$AbbreviateRecipe
- Replace
StringUtils.abbreviate(String, int)with JDK provided API - Replace Maven Shared
StringUtils.abbreviate(String str, int maxWidth)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$CapitaliseRecipe
- Replace
StringUtils.capitalise(String)with JDK provided API - Replace Maven Shared
StringUtils.capitalise(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$DefaultStringFallbackRecipe
- Replace
StringUtils.defaultString(Object, String)with JDK provided API - Replace Maven Shared
StringUtils.defaultString(Object obj, String nullDefault)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$DefaultStringRecipe
- Replace
StringUtils.defaultString(Object)with JDK provided API - Replace Maven Shared
StringUtils.defaultString(Object obj)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$DeleteWhitespaceRecipe
- Replace
StringUtils.deleteWhitespace(String)with JDK provided API - Replace Maven Shared
StringUtils.deleteWhitespace(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$EqualsIgnoreCaseRecipe
- Replace
StringUtils.equalsIgnoreCase(String, String)with JDK provided API - Replace Maven Shared
StringUtils.equalsIgnoreCase(String str1, String str2)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$EqualsRecipe
- Replace
StringUtils.equals(String, String)with JDK provided API - Replace Maven Shared
StringUtils.equals(String str1, String str2)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$LowercaseRecipe
- Replace
StringUtils.lowerCase(String)with JDK provided API - Replace Maven Shared
StringUtils.lowerCase(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$ReplaceRecipe
- Replace
StringUtils.replace(String, String, String)with JDK provided API - Replace Maven Shared
StringUtils.replace(String text, String searchString, String replacement)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$ReverseRecipe
- Replace
StringUtils.reverse(String)with JDK provided API - Replace Maven Shared
StringUtils.reverse(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$SplitRecipe
- Replace
StringUtils.split(String)with JDK provided API - Replace Maven Shared
StringUtils.split(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$StripRecipe
- Replace
StringUtils.strip(String)with JDK provided API - Replace Maven Shared
StringUtils.strip(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$TrimRecipe
- Replace
StringUtils.trim(String)with JDK provided API - Replace Maven Shared
StringUtils.trim(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes$UppercaseRecipe
- Replace
StringUtils.upperCase(String)with JDK provided API - Replace Maven Shared
StringUtils.upperCase(String str)with JDK provided API.
- Replace
- org.openrewrite.apache.poi.ReplaceSetBoldweightWithSetBold
- Replace
Font.setBoldweight(short)withFont.setBold(boolean) - Replace
Font.setBoldweight(short)or equivalent withFont.setBold(boolean).
- Replace
- org.openrewrite.apache.poi.ReplaceSetCellType
- Apache POI use
Cell.setCellType(CellType) Cell.setCellType()can be configured with either an integer or a theCellTypeenumeration. It is clearer and less error-prone to use theCellTypeenumeration, so this recipe converts allsetCellType()calls to use it.
- Apache POI use
- org.openrewrite.codehaus.plexus.AbstractLogEnabledToSlf4j
- Migrate from Plexus
AbstractLogEnabledto SLF4J - Introduce a SLF4J
Loggerfield and replace calls togetLogger()with calls to the field.
- Migrate from Plexus
- org.openrewrite.codehaus.plexus.PlexusFileUtilsRecipes
PlexusFileUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.codehaus.plexus.PlexusFileUtils.
- org.openrewrite.codehaus.plexus.PlexusFileUtilsRecipes$DeleteDirectoryFileRecipe
- Replace
FileUtils.deleteDirectory(File)with JDK provided API - Replace Plexus
FileUtils.deleteDirectory(File directory)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusFileUtilsRecipes$DeleteDirectoryStringRecipe
- Replace
FileUtils.deleteDirectory(String)with JDK provided API - Replace Plexus
FileUtils.deleteDirectory(String directory)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusFileUtilsRecipes$FileExistsStringRecipe
- Replace
FileUtils.fileExists(String)with JDK provided API - Replace Plexus
FileUtils.fileExists(String fileName)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusFileUtilsRecipes$GetFileRecipe
- Replace
FileUtils.getFile(String)with JDK provided API - Replace Plexus
FileUtils.getFile(String fileName)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes
PlexusStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.codehaus.plexus.PlexusStringUtils.
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$AbbreviateRecipe
- Replace
StringUtils.abbreviate(String, int)with JDK provided API - Replace Plexus
StringUtils.abbreviate(String str, int maxWidth)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$CapitaliseRecipe
- Replace
StringUtils.capitalise(String)with JDK provided API - Replace Plexus
StringUtils.capitalise(String str)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$DefaultStringFallbackRecipe
- Replace
StringUtils.defaultString(Object, String)with JDK provided API - Replace Plexus
StringUtils.defaultString(Object obj, String nullDefault)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$DefaultStringRecipe
- Replace
StringUtils.defaultString(Object)with JDK provided API - Replace Plexus
StringUtils.defaultString(Object obj)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$DeleteWhitespaceRecipe
- Replace
StringUtils.deleteWhitespace(String)with JDK provided API - Replace Plexus
StringUtils.deleteWhitespace(String str)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$EqualsIgnoreCaseRecipe
- Replace
StringUtils.equalsIgnoreCase(String, String)with JDK provided API - Replace Plexus
StringUtils.equalsIgnoreCase(String str1, String str2)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$EqualsRecipe
- Replace
StringUtils.equals(String, String)with JDK provided API - Replace Plexus
StringUtils.equals(String str1, String str2)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$LowercaseRecipe
- Replace
StringUtils.lowerCase(String)with JDK provided API - Replace Plexus
StringUtils.lowerCase(String str)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$ReplaceRecipe
- Replace
StringUtils.replace(String, String, String)with JDK provided API - Replace Plexus
StringUtils.replace(String text, String searchString, String replacement)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$ReverseRecipe
- Replace
StringUtils.reverse(String)with JDK provided API - Replace Plexus
StringUtils.reverse(String str)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$SplitRecipe
- Replace
StringUtils.split(String)with JDK provided API - Replace Plexus
StringUtils.split(String str)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$StripRecipe
- Replace
StringUtils.strip(String)with JDK provided API - Replace Plexus
StringUtils.strip(String str)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$TrimRecipe
- Replace
StringUtils.trim(String)with JDK provided API - Replace Plexus
StringUtils.trim(String str)with JDK provided API.
- Replace
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes$UppercaseRecipe
- Replace
StringUtils.upperCase(String)with JDK provided API - Replace Plexus
StringUtils.upperCase(String str)with JDK provided API.
- Replace
org.openrewrite.recipe:rewrite-azul
License: Moderne Proprietary License
2 recipes
- io.moderne.azul.EliminateUnusedClasses
- Eliminate unused classes
- Deprecate and later delete classes that are unused, as detected by Azul Intelligence Cloud.
- io.moderne.azul.search.FindReachableMethods
- Find reachable methods
- Find all methods defined in the repository's source code that are reachable.
org.openrewrite.recipe:rewrite-circleci
License: Moderne Proprietary License
2 recipes
- org.openrewrite.circleci.InstallOrb
- Install an orb
- Install a CircleCI orb if it is not already installed.
- org.openrewrite.circleci.UpdateImage
- Update CircleCI image
- See the list of pre-built CircleCI images.
org.openrewrite.recipe:rewrite-codemods
License: Moderne Source Available License
6 recipes
- org.openrewrite.codemods.ApplyCodemod
- Applies a codemod to all source files
- Applies a codemod represented by an NPM package to all source files.
- org.openrewrite.codemods.Biome
- Biome recommendations
- Run Biome recommended settings on your projects.
- org.openrewrite.codemods.ESLint
- Lint source code with ESLint
- Run ESLint across the code to fix common static analysis issues in the code. This requires the code to have an existing ESLint configuration.
- org.openrewrite.codemods.Putout
- Run Putout
- Run Putout on your projects.
- org.openrewrite.codemods.ReactI18Next
- React i18next internationalization
- Automatically internationalizes React applications by extracting hardcoded strings and replacing them with react-i18next translation calls. Handles JSX text, attributes, and template literals with variables. Creates and updates a translation JSON file with extracted strings.
- org.openrewrite.codemods.UI5
- Lint UI5 projects with UI5 linter
- Runs the UI5 Linter, a static code analysis tool for UI5 projects. It checks JavaScript, TypeScript, XML, JSON, and other files in your project and reports findings.
org.openrewrite.recipe:rewrite-codemods-ng
License: Moderne Proprietary License
1 recipe
- org.openrewrite.codemods.migrate.angular.ApplyAngularCLI
- Upgrade Angular versions
- Run
ng updateto upgrade Angular CLI and Angular Core to the specified version.
org.openrewrite.recipe:rewrite-compiled-analysis
License: Moderne Proprietary License
2 recipes
- io.moderne.compiled.verification.ChangeListMethodAndVerify
- Change
List#addtoList#plusand verify - We know this won't compile.
- Change
- io.moderne.compiled.verification.VerifyCompilation
- Verify compilation
- This is a task that runs after another recipe to verify that the changes made by that recipe would result in a successful compilation.
org.openrewrite.recipe:rewrite-concourse
License: Moderne Proprietary License
5 recipes
- org.openrewrite.concourse.ChangeResourceVersion
- Change resource version
- Pin or unpin a resource to a particular version.
- org.openrewrite.concourse.ChangeValue
- Change Concourse value
- Change every value matching the key pattern.
- org.openrewrite.concourse.FindResource
- Find resource
- Find a Concourse resource by name.
- org.openrewrite.concourse.UpdateGitResourceUri
- Update git resource
source.urireferences - Update git resource
source.uriURI values to point to a new URI value.
- Update git resource
- org.openrewrite.concourse.search.FindPinnedResource
- Find pinned resources by type
- Find resources of a particular type that have pinned versions.
org.openrewrite.recipe:rewrite-cucumber-jvm
License: Moderne Source Available License
5 recipes
- org.openrewrite.cucumber.jvm.CucumberAnnotationToSuite
- Replace
@Cucumberwith@Suite - Replace
@Cucumberwith@Suiteand@SelectClasspathResource("cucumber/annotated/class/package").
- Replace
- org.openrewrite.cucumber.jvm.CucumberJava8HookDefinitionToCucumberJava
- Replace
cucumber-java8hook definition withcucumber-java - Replace
LambdaGluehook definitions with new annotated methods with the same body.
- Replace
- org.openrewrite.cucumber.jvm.CucumberJava8StepDefinitionToCucumberJava
- Replace
cucumber-java8step definitions withcucumber-java - Replace
StepDefinitionBodymethods withStepDefinitionAnnotationson new methods with the same body.
- Replace
- org.openrewrite.cucumber.jvm.DropSummaryPrinter
- Drop
SummaryPrinter - Replace
SummaryPrinterwithPlugin, if not already present.
- Drop
- org.openrewrite.cucumber.jvm.RegexToCucumberExpression
- Replace
cucumber-javastep definition regexes with Cucumber expressions - Strip regex prefix and suffix from step annotation expressions arguments where possible.
- Replace
org.openrewrite.recipe:rewrite-docker
License: Moderne Source Available License
1 recipe
- org.openrewrite.docker.search.FindDockerImageUses
- Find uses of docker base images
- Produce an impact analysis of base images used in Dockerfiles, .gitlab-ci files, Kubernetes Deployment file, etc.
org.openrewrite.recipe:rewrite-dotnet
License: Moderne Proprietary License
2 recipes
- org.openrewrite.dotnet.UpgradeAssistant
- Upgrade a .NET project using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to a newer version of .NET.
- org.openrewrite.dotnet.UpgradeAssistantAnalyze
- Analyze a .NET project using upgrade-assistant
- Run upgrade-assistant analyze across a repository to analyze changes required to upgrade projects to a newer version of .NET. This recipe will generate an
org.openrewrite.dotnet.UpgradeAssistantAnalysisdata table containing the report details.
org.openrewrite.recipe:rewrite-dropwizard
License: Apache License Version 2.0
9 recipes
- org.openrewrite.java.dropwizard.annotation.AddClassAnnotationIfAnnotationExists
- Add annotation if target annotations exist
- Adds annotation if class has any of the specified target annotations.
- org.openrewrite.java.dropwizard.annotation.AddClassAnnotationIfSuperTypeExists
- Add annotation if target supertypes exist
- Adds annotation if class extends or implements any of the specified target types.
- org.openrewrite.java.dropwizard.config.RemoveAndExcludeDependency
- Combined dependency management to remove and exclude
- Combines excluding transitive dependencies and removing direct dependencies.
- org.openrewrite.java.dropwizard.general.RemoveMethodsByPackage
- Remove methods referencing specified package
- Removes any method that has a return type or parameter type from the specified package.
- org.openrewrite.java.dropwizard.general.RemoveVariablesByPackage
- Remove class variables matching package filter
- Removes class-level variables from classes in the specified package.
- org.openrewrite.java.dropwizard.method.ChangeSuperType
- Change superclass
- Changes the superclass of a specified class to a new superclass.
- org.openrewrite.java.dropwizard.method.RemoveSuperTypeByType
- Remove supertype by fully qualified name matches
- Removes a specified type from class extends or implements clauses.
- org.openrewrite.java.dropwizard.method.RemoveUnnecessaryOverride
- Remove unnecessary
@Overrideannotations - Removes
@Overrideannotations from methods that don't actually override or implement any method. This helps maintain clean code by removing incorrect annotations that could be misleading.
- Remove unnecessary
- org.openrewrite.java.dropwizard.method.RemoveUnnecessarySuperCalls
- Remove
supercalls when the class does not extend another class - Removes calls to
super(...)orsuper.someMethod(...)if the class does not have a real superclass besidesjava.lang.Object.
- Remove
org.openrewrite.recipe:rewrite-feature-flags
License: Moderne Source Available License
25 recipes
- org.openrewrite.featureflags.RemoveBooleanFlag
- Remove a boolean feature flag for feature key
- Replace method invocations for feature key with value, and simplify constant if branch execution.
- org.openrewrite.featureflags.RemoveDoubleFlag
- Remove a double feature flag for feature key
- Replace method invocations for feature key with value, and simplify constant if branch execution.
- org.openrewrite.featureflags.RemoveIntegerFlag
- Remove an integer feature flag for feature key
- Replace method invocations for feature key with value, and simplify constant if branch execution.
- org.openrewrite.featureflags.RemoveStringFlag
- Remove a String feature flag for feature key
- Replace method invocations for feature key with value, and simplify constant if branch execution.
- org.openrewrite.featureflags.ff4j.RemoveCheck
- Remove FF4j's
checkfor feature key - Replace
check()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove FF4j's
- org.openrewrite.featureflags.ff4j.search.FindFeatureFlag
- Find a FF4j feature flag
- Find a FF4j feature flag.
- org.openrewrite.featureflags.launchdarkly.ChangeVariationDefault
- Change the default value for feature key
- Change the default value for
Variationinvocations for feature key.
- org.openrewrite.featureflags.launchdarkly.MigrateUserToContext
- Migrate
LDUsertoLDContext - Migrate from
LDUserandLDUser.BuildertoLDContextandContextBuilder.
- Migrate
- org.openrewrite.featureflags.launchdarkly.RemoveBoolVariation
- Remove LaunchDarkly's
boolVariationfor feature key - Replace
boolVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveDoubleVariation
- Remove LaunchDarkly's
doubleVariationfor feature key - Replace
doubleVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveIntVariation
- Remove LaunchDarkly's
intVariationfor feature key - Replace
intVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveStringVariation
- Remove LaunchDarkly's
boolVariationfor feature key - Replace
boolVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.search.FindFeatureFlag
- Find a LaunchDarkly feature flag
- Find a LaunchDarkly feature flag.
- org.openrewrite.featureflags.openfeature.RemoveGetBooleanValue
- Remove OpenFeature's
getBooleanValuefor feature key - Replace
getBooleanValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetDoubleValue
- Remove OpenFeature's
getDoubleValuefor feature key - Replace
getDoubleValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetIntegerValue
- Remove OpenFeature's
getIntegerValuefor feature key - Replace
getIntegerValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetStringValue
- Remove OpenFeature's
getStringValuefor feature key - Replace
getStringValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.search.FindFeatureFlag
- Find an OpenFeature feature flag
- Find an OpenFeature feature flag.
- org.openrewrite.featureflags.quarkus.RemoveGetInt
- Remove Quarkus feature flag's
getIntfor feature key - Replace
getInt()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.RemoveGetString
- Remove Quarkus feature flag's
getStringfor feature key - Replace
getString()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.RemoveIsEnabled
- Remove Quarkus feature flag's
isEnabledfor feature key - Replace
isEnabled()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.search.FindFeatureFlag
- Find a Quarkus feature flag
- Find a Quarkus feature flag.
- org.openrewrite.featureflags.search.FindFeatureFlag
- Find a feature flag
- Find a feature flag matching method pattern.
- org.openrewrite.featureflags.unleash.RemoveIsEnabled
- Remove Unleash's
isEnabledfor feature key - Replace
isEnabled()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Unleash's
- org.openrewrite.featureflags.unleash.search.FindFeatureFlag
- Find an Unleash feature flag
- Find an Unleash feature flag.
org.openrewrite.recipe:rewrite-github-actions
License: Moderne Source Available License
42 recipes
- org.openrewrite.github.AddCronTrigger
- Add cron workflow trigger
- The
scheduleevent allows you to trigger a workflow at a scheduled time.
- org.openrewrite.github.AddDependabotCooldown
- Add cooldown periods to Dependabot configuration
- Adds a
cooldownsection to each update configuration in Dependabot files. Supportsdefault-days,semver-major-days,semver-minor-days,semver-patch-days,include, andexcludeoptions. This implements a security best practice where dependencies are not immediately adopted upon release, allowing time for security vendors to identify potential supply chain compromises. Cooldown applies only to version updates, not security updates. Read more about dependency cooldowns. The available configuration options for dependabot are listed on GitHub.
- org.openrewrite.github.AutoCancelInProgressWorkflow
- Cancel in-progress workflow when it is triggered again
- When a workflow is already running and would be triggered again, cancel the existing workflow. See
styfle/cancel-workflow-actionfor details.
- org.openrewrite.github.ChangeAction
- Change GitHub Action
- Change a GitHub Action in any workflow.
- org.openrewrite.github.ChangeActionVersion
- Change GitHub Action version
- Change the version of a GitHub Action in any workflow.
- org.openrewrite.github.ChangeDependabotScheduleInterval
- Change dependabot schedule interval
- Change the schedule interval for a given package-ecosystem in a
dependabot.ymlconfiguration file. The available configuration options for dependabot are listed on GitHub.
- org.openrewrite.github.FindMissingTimeout
- Find jobs missing timeout
- Find GitHub Actions jobs missing a timeout.
- org.openrewrite.github.IsGitHubActionsWorkflow
- Is GitHub Actions Workflow
- Checks if the file is a GitHub Actions workflow file.
- org.openrewrite.github.PreferSecretsInheritWorkflow
- Use
secrets: inheritif possible - Pass all secrets to a reusable workflow using
secrets: inherit. See Simplify using secrets with reusable workflows for details.
- Use
- org.openrewrite.github.PreferTemurinDistributions
- Use
actions/setup-javatemurindistribution as they are cached in hosted runners - Host runners include Temurin by default as part of the hosted tool cache. Using Temurin speeds up builds as there is no need to download and configure the Java SDK with every build.
- Use
- org.openrewrite.github.RemoveAllCronTriggers
- Remove all cron triggers
- Removes all cron triggers from a workflow.
- org.openrewrite.github.RemoveUnusedWorkflowDispatchInputs
- Remove unused workflow dispatch inputs
- Remove workflow_dispatch inputs that are not referenced anywhere in the workflow file.
- org.openrewrite.github.RemoveWorkflowInputArgument
- Remove workflow input argument
- Remove a specific input argument from calls to a reusable workflow.
- org.openrewrite.github.ReplaceRunners
- Replace runners for a job
- Replaces the runners of a given job.
- org.openrewrite.github.ReplaceSecretKeys
- Replace secret key names in GitHub Actions
- Replace key names used for secrets in GitHub Actions workflow files.
- org.openrewrite.github.ReplaceSecrets
- Replace GitHub Action secret names
- Replace references to GitHub Action secrets in workflow files.
- org.openrewrite.github.SetupJavaAdoptOpenJDKToTemurin
- Use
actions/setup-javatemurindistribution - Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from adopt to temurin to keep receiving software and security updates. See more details in the Good-bye AdoptOpenJDK post.
- Use
- org.openrewrite.github.SetupJavaAdoptOpenj9ToSemeru
- Use
actions/setup-javaIBMsemerudistribution - Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from adopt-openj9 to IBM semeru to keep receiving software and security updates. See more details in the Good-bye AdoptOpenJDK post.
- Use
- org.openrewrite.github.SetupJavaCaching
- Setup Java dependency caching
- GitHub actions supports dependency caching on Maven and Gradle projects. See the blog post.
- org.openrewrite.github.SetupJavaUpgradeJavaVersion
- Upgrade
actions/setup-javajava-version - Update the Java version used by
actions/setup-javaif it is below the expected version number.
- Upgrade
- org.openrewrite.github.SetupNodeUpgradeNodeVersion
- Upgrade
actions/setup-nodenode-version - Update the Node.js version used by
actions/setup-nodeif it is below the expected version number.
- Upgrade
- org.openrewrite.github.SetupPythonToUv
- Replace
actions/setup-pythonwithastral-sh/setup-uv - Replace
actions/setup-pythonaction withastral-sh/setup-uvaction for faster Python environment setup and dependency management. Benefits of UV: - Significantly faster package installation and environment setup - Built-in dependency resolution and locking - Integrated caching for improved CI performance - Drop-in replacement for pip workflows Transformations applied: -actions/setup-python@v5→astral-sh/setup-uv@v6-cache: 'pip'→enable-cache: 'true'-pip install -r requirements.txt→uv sync(configurable strategy) -python -m <module>→uv run <module>- Removes unnecessarypip install --upgrade pipsteps Sync strategies: -basic: Basic synchronization (uv sync) -locked: Use locked dependencies (uv sync --locked) -full: Install all extras and dev dependencies (uv sync --all-extras --dev) See the UV GitHub integration guide for more details.
- Replace
- org.openrewrite.github.UpgradeSlackNotificationVersion2
- Upgrade
slackapi/slack-github-action - Update the Slack GitHub Action to use version 2.0.
- Upgrade
- org.openrewrite.github.security.AnonymousJobsRecipe
- Find jobs without descriptive names
- Find jobs that lack descriptive names, making them harder to identify in workflow runs. Jobs without
nameproperties default to their job ID, which may not be descriptive. Based on zizmor's anonymous-definition audit.
- org.openrewrite.github.security.ArtifactSecurityRecipe
- Find credential persistence through GitHub Actions artifacts
- Find workflows that may persist credentials through artifact uploads. This occurs when checkout actions don't disable credential persistence and upload actions include sensitive paths that may contain credentials, SSH keys, or configuration files. Based on zizmor's
artipackedaudit.
- org.openrewrite.github.security.BotConditionsRecipe
- Find spoofable bot actor checks
- Find workflow conditions that check for bot actors in ways that can be spoofed. Bot actor names (like
dependabot[bot]) can be easily spoofed by creating accounts with similar names. Useactor_idwith numeric comparison instead for secure bot validation. Based on zizmor'sbot-conditionsaudit.
- org.openrewrite.github.security.CachePoisoningRecipe
- Find cache poisoning vulnerabilities
- Detects potential cache poisoning vulnerabilities in workflows that use caching and publish artifacts. When workflows use caches during artifact publishing, attackers may be able to poison the cache with malicious content that gets included in published artifacts. Based on zizmor's cache-poisoning audit.
- org.openrewrite.github.security.DangerousTriggersRecipe
- Find dangerous workflow triggers
- Detects use of fundamentally insecure workflow triggers like
pull_request_targetandworkflow_run. These triggers run with elevated privileges and are almost always used insecurely, potentially allowing code injection from untrusted sources. Based on zizmor's dangerous-triggers audit.
- org.openrewrite.github.security.ExcessivePermissionsRecipe
- Find excessive permissions
- Find overly broad permissions in GitHub Actions workflows. Flags 'write-all' permissions and excessive write permissions that could be scoped more narrowly for security. Based on zizmor's excessive-permissions audit.
- org.openrewrite.github.security.ForbiddenUsesRecipe
- Find forbidden action usage
- Find usage of forbidden or dangerous GitHub Actions that have known security vulnerabilities or follow suspicious patterns. Based on zizmor's forbidden-uses audit.
- org.openrewrite.github.security.GitHubEnvRecipe
- Find dangerous GITHUB_ENV usage
- Detects dangerous usage of
GITHUB_ENVandGITHUB_PATHenvironment files in workflows with risky triggers likepull_request_targetorworkflow_run. Writing to these files can allow code injection when the content includes user-controlled data. Based on zizmor's github-env audit.
- org.openrewrite.github.security.HardcodedCredentialsRecipe
- Find hardcoded container credentials
- Detects hardcoded credentials in GitHub Actions container configurations. Container registry passwords should use secrets instead of hardcoded values. Based on zizmor's hardcoded-container-credentials audit.
- org.openrewrite.github.security.InsecureCommandsRecipe
- Find insecure commands configuration
- Detects when insecure workflow commands are enabled via
ACTIONS_ALLOW_UNSECURE_COMMANDS. This environment variable enables dangerous workflow commands that can lead to code injection vulnerabilities. Based on zizmor's insecure-commands audit.
- org.openrewrite.github.security.ObfuscationRecipe
- Find obfuscated GitHub Actions features
- Find workflows that use obfuscated action references or expressions that may be attempting to hide malicious behavior. This includes action paths with
'.','..', empty components, or expressions that use quote manipulation to hide their true intent. Based on zizmor'sobfuscationaudit.
- org.openrewrite.github.security.RefVersionMismatchRecipe
- Find commit SHAs with potentially mismatched version comments
- Find GitHub Actions that are pinned to commit SHAs but have version comments that may not match the actual pinned version. This can lead to confusion about which version is actually being used and potential security issues if the comment misleads developers about the pinned version. Based on zizmor's
ref-version-mismatchaudit.
- org.openrewrite.github.security.SecretsInheritRecipe
- Find unconditional secrets inheritance
- Detects when reusable workflows unconditionally inherit all parent secrets via
secrets: inherit. This practice can lead to over-privileged workflows and potential secret exposure to called workflows that may not need access to all secrets. Consider explicitly passing only required secrets. Based on zizmor's secrets-inherit audit.
- org.openrewrite.github.security.SelfHostedRunnerRecipe
- Find usage of self-hosted runners
- Find workflows that use
self-hostedrunners, which may have security implications in public repositories due to potential persistence between workflow runs and lack of isolation. Self-hosted runners should be properly secured and ideally ephemeral. Based on zizmor'sself-hosted-runneraudit.
- org.openrewrite.github.security.TemplateInjectionRecipe
- Find template injection vulnerabilities
- Find GitHub Actions workflows vulnerable to template injection attacks. These occur when user-controllable input (like pull request titles, issue bodies, or commit messages) is used directly in
runcommands orscriptinputs without proper escaping. Attackers can exploit this to execute arbitrary code. Based on zizmor'stemplate-injectionaudit.
- org.openrewrite.github.security.TrustedPublishingRecipe
- Find manual credentials instead of trusted publishing
- Find workflows that use manual credentials for publishing instead of OIDC trusted publishing. Trusted publishing eliminates the need for long-lived API tokens and provides better security through short-lived, automatically-rotated tokens. Based on zizmor's use-trusted-publishing audit.
- org.openrewrite.github.security.UndocumentedPermissionsRecipe
- Document permissions usage
- Add documentation comments for permissions blocks in GitHub Actions workflows. Documenting permissions helps reviewers understand why specific permissions are needed and ensures security-conscious development practices. Based on zizmor's undocumented-permissions audit.
- org.openrewrite.github.security.UnpinnedActionsRecipe
- Pin GitHub Actions to specific commits
- Pin GitHub Actions to specific commit SHAs for security and reproducibility. Actions pinned to tags or branches can be changed by the action author, while SHA pins are immutable. Based on zizmor's unpinned-uses audit.
- org.openrewrite.github.security.UnpinnedDockerImagesRecipe
- Pin Docker images to digests
- Pin Docker images to specific digest hashes for security and reproducibility. Images pinned to tags can be changed by the image author, while digest pins are immutable. Based on zizmor's unpinned-images audit.
org.openrewrite.recipe:rewrite-gitlab
License: Moderne Source Available License
8 recipes
- org.openrewrite.gitlab.AddComponent
- Add GitLab component
- Add a GitLab component to an existing list, or add a new list where none was present.
- org.openrewrite.gitlab.AddStages
- Add GitLab stages
- Add or Update the set of stages defined in
.gitlab-ci.yml.
- org.openrewrite.gitlab.AddTemplate
- Add GitLab template
- Add a GitLab template to an existing list, or add a new list where none was present.
- org.openrewrite.gitlab.ChangeComponent
- Change GitLab Component
- Change a GitLab Component in use.
- org.openrewrite.gitlab.ChangeTemplate
- Change GitLab template
- Change a GitLab template in use.
- org.openrewrite.gitlab.RemoveTemplate
- Remove GitLab template
- Remove a GitLab template from use.
- org.openrewrite.gitlab.search.FindComponent
- Find GitLab Component
- Find a GitLab Component in use.
- org.openrewrite.gitlab.search.FindTemplate
- Find GitLab Template
- Find a GitLab Template in use.
org.openrewrite.recipe:rewrite-hibernate
License: Moderne Source Available License
8 recipes
- org.openrewrite.hibernate.AddScalarPreferStandardBasicTypes
- AddScalarPreferStandardBasicTypesForHibernate5 (Community Edition)
- Prefer the use of
StandardBasicTypes.*inNativeQuery.addScalar(...)invocations.
- org.openrewrite.hibernate.EmptyInterceptorToInterface
- Replace
extends EmptyInterceptorwithimplements Interceptorand potentiallyStatementInspector(Community Edition) - In Hibernate 6.0 the
Interceptorinterface received default implementations therefore the NOOP implementation that could be extended was no longer needed. This recipe migrates 5.xInterceptor#onPrepareStatement(String)to 6.0StatementInspector#inspect().
- Replace
- org.openrewrite.hibernate.MigrateBooleanMappings
- Replace boolean type mappings with converters (Community Edition)
- Replaces type mapping of booleans with appropriate attribute converters.
- org.openrewrite.hibernate.MigrateResultCheckStyleToExpectation
- Migration of
ResultCheckStyletoExpectation(Community Edition) - Will migrate the usage of
org.hibernate.annotations.ResultCheckStyletoorg.hibernate.jdbc.Expectationin@SQLInsert,@SqlUpdate,@SqlDeleteand@SqlDeleteAllannotations.
- Migration of
- org.openrewrite.hibernate.MigrateUserType
- Migrate
UserTypeto Hibernate 6 (Community Edition) - With Hibernate 6 the
UserTypeinterface received a type parameter making it more strictly typed. This recipe applies the changes required to adhere to this change.
- Migrate
- org.openrewrite.hibernate.RemoveInvalidHibernateGeneratedValueAnnotation
- Remove invalid
@GeneratedValueannotation (Community Edition) - Removes
@GeneratedValueannotation from fields that are not also annotated with@Id.
- Remove invalid
- org.openrewrite.hibernate.ReplaceLazyCollectionAnnotation
- Replace
@LazyCollectionwithjakarta.persistence.FetchType(Community Edition) - Adds the
FetchTypeto jakarta annotations and deletes@LazyCollection.
- Replace
- org.openrewrite.hibernate.TypeAnnotationParameter
@Typeannotation type parameter migration (Community Edition)- Hibernate 6.x has 'type' parameter of type String replaced with 'value' of type class.
org.openrewrite.recipe:rewrite-jackson
License: Apache License Version 2.0
14 recipes
- org.openrewrite.java.jackson.Jackson3JsonNodeFieldIterators
- Migrate
JSONNodefield iterator for Jackson 3 JSONNodefields are usingCollectionsinstead ofIteratorsinge Jackson 3. To mimic Jackson 2s behavior an additional call toCollection#iterator()is needed.
- Migrate
- org.openrewrite.java.jackson.RemoveBuiltInModuleRegistrations
- Remove registrations of modules built-in to Jackson 3
- In Jackson 3,
ParameterNamesModule,Jdk8Module, andJavaTimeModuleare built intojackson-databindand no longer need to be registered manually. This recipe removesObjectMapper.registerModule()andMapperBuilder.addModule()calls for these modules.
- org.openrewrite.java.jackson.RemoveRedundantFeatureFlags
- Remove redundant Jackson 3 feature flag configurations
- Remove
ObjectMapperfeature flag configurations that set values to their new Jackson 3 defaults. For example,disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)andconfigure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)are redundant since this is now disabled by default in Jackson 3.
- org.openrewrite.java.jackson.RemoveRedundantJsonPropertyValue
- Remove redundant
@JsonPropertyargument - Remove
@JsonPropertyannotation or value attribute when the value matches the argument name.
- Remove redundant
- org.openrewrite.java.jackson.ReplaceStreamWriteCapability
- Replace removed
JsonGeneratorcapability methods withStreamWriteCapability - In Jackson 3,
JsonGenerator.canWriteBinaryNatively()andcanWriteFormattedNumbers()were removed and replaced with theStreamWriteCapabilityenum. This recipe updates these method calls to usegetWriteCapabilities().isEnabled(StreamWriteCapability.*)instead.
- Replace removed
- org.openrewrite.java.jackson.SimplifyJacksonExceptionCatch
- Simplify catch clauses for Jackson exceptions
- In Jackson 3,
JacksonExceptionand its subtypes extendRuntimeException. This recipe simplifies multi-catch clauses by removing Jackson exception types whenRuntimeExceptionis also caught, since catching both is redundant. For example,catch (JacksonException | RuntimeException e)becomescatch (RuntimeException e).
- org.openrewrite.java.jackson.UpdateSerializationInclusionConfiguration
- Update configuration of serialization inclusion in ObjectMapper for Jackson 3
- In Jackson 3,
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL)is no longer supported and should be replaced bychangeDefaultPropertyInclusion()for bothvalueInclusionandcontentInclusion.
- org.openrewrite.java.jackson.UseFormatAlignedObjectMappers
- Use format alignment
ObjectMappers - Replace wrapping
ObjectMappercalls with their format aligned implementation.
- Use format alignment
- org.openrewrite.java.jackson.UseModernDateTimeSerialization
- Use modern date/time serialization defaults
- Remove redundant
@JsonFormatannotations onjava.timetypes that specify ISO-8601 patterns, as Jackson 3 uses ISO-8601 as the default format (withWRITE_DATES_AS_TIMESTAMPSnow disabled by default).
- org.openrewrite.java.jackson.codehaus.CodehausDependencyToFasterXML
- Migrate dependencies from Jackson Codehaus (legacy) to FasterXML
- Replace Codehaus Jackson dependencies with FasterXML Jackson dependencies, and add databind if needed.
- org.openrewrite.java.jackson.codehaus.JsonIncludeAnnotation
- Migrate to Jackson
@JsonInclude - Move Codehaus'
@JsonSerialize.includeargument to FasterXMLs@JsonIncludeannotation.
- Migrate to Jackson
- org.openrewrite.java.jackson.codehaus.RemoveDoublyAnnotatedCodehausAnnotations
- Remove Codehaus Jackson annotations if doubly annotated
- Remove Codehaus Jackson annotations if they are doubly annotated with Jackson annotations from the
com.fasterxml.jacksonpackage.
- org.openrewrite.java.jackson.codehaus.ReplaceSerializationConfigAnnotationIntrospector
- Migrate serialization annotation processor
- Migrate serialization annotation processor to use the codehaus config method.
- org.openrewrite.java.jackson.codehaus.TransferJsonSerializeArgumentsFromCodehausToFasterXML
- Transfer @JsonSerialize arguments from Codehaus to FasterXML
- Transfer @JsonSerialize annotation arguments (using, contentUsing, keyUsing, nullUsing) from Codehaus to FasterXML. If the argument was set already, it will not be transferred.
org.openrewrite.recipe:rewrite-java-dependencies
License: Apache License Version 2.0
16 recipes
- org.openrewrite.java.dependencies.AddDependency
- Add Gradle or Maven dependency
- For a Gradle project, add a gradle dependency to a
build.gradlefile in the correct configuration based on where it is used. Or For a maven project, Add a Maven dependency to apom.xmlfile in the correct scope based on where it is used.
- org.openrewrite.java.dependencies.ChangeDependency
- Change Gradle or Maven dependency
- Change the group ID, artifact ID, and/or the version of a specified Gradle or Maven dependency.
- org.openrewrite.java.dependencies.DependencyInsight
- Dependency insight for Gradle and Maven
- Finds dependencies, including transitive dependencies, in both Gradle and Maven projects. Matches within all Gradle dependency configurations and Maven scopes.
- org.openrewrite.java.dependencies.DependencyList
- Dependency report
- Emits a data table detailing all Gradle and Maven dependencies. This recipe makes no changes to any source file.
- org.openrewrite.java.dependencies.DependencyResolutionDiagnostic
- Dependency resolution diagnostic
- Recipes which manipulate dependencies must be able to successfully access the artifact repositories and resolve dependencies from them. This recipe produces two data tables used to understand the state of dependency resolution. The Repository accessibility report lists all the artifact repositories known to the project and whether respond to network access. The network access is attempted while the recipe is run and so is representative of current conditions. The Gradle dependency configuration errors lists all the dependency configurations that failed to resolve one or more dependencies when the project was parsed. This is representative of conditions at the time the LST was parsed.
- org.openrewrite.java.dependencies.FindDependency
- Find Maven and Gradle dependencies
- Finds direct dependencies declared in Maven and Gradle build files. This does not search transitive dependencies. To detect both direct and transitive dependencies use
org.openrewrite.java.dependencies.DependencyInsightThis recipe works for both Maven and Gradle projects.
- org.openrewrite.java.dependencies.RelocatedDependencyCheck
- Find relocated dependencies
- Find Maven and Gradle dependencies and Maven plugins that have relocated to a new
groupIdorartifactId. Relocation information comes from the oga-maven-plugin maintained by Jonathan Lermitage, Filipe Roque and others. This recipe makes no changes to any source file by default. AddchangeDependencies=trueto change dependencies, but note that you might need to run additional recipes to update imports and adopt other breaking changes.
- org.openrewrite.java.dependencies.RemoveDependency
- Remove a Gradle or Maven dependency
- For Gradle project, removes a single dependency from the dependencies section of the
build.gradle. For Maven project, removes a single dependency from the<dependencies>section of the pom.xml.
- org.openrewrite.java.dependencies.RemoveRedundantDependencies
- Remove redundant explicit dependencies
- Remove explicit dependencies that are already provided transitively by a specified dependency. This recipe downloads and resolves the parent dependency's POM to determine its true transitive dependencies, allowing it to detect redundancies even when both dependencies are explicitly declared.
- org.openrewrite.java.dependencies.UpgradeDependencyVersion
- Upgrade Gradle or Maven dependency versions
- For Gradle projects, upgrade the version of a dependency in a
build.gradlefile. Supports updating dependency declarations of various forms: *Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'It is possible to update version numbers which are defined earlier in the same file in variable declarations. For Maven projects, upgrade the version of a dependency by specifying a group ID and (optionally) an artifact ID using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
- org.openrewrite.java.dependencies.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle or Maven dependencies
- Upgrades the version of a transitive dependency in a Maven pom.xml or Gradle build.gradle. Leaves direct dependencies unmodified. Can be paired with the regular Upgrade Dependency Version recipe to upgrade a dependency everywhere, regardless of whether it is direct or transitive.
- org.openrewrite.java.dependencies.search.DoesNotIncludeDependency
- Does not include dependency for Gradle and Maven
- A precondition which returns false if visiting a Gradle file / Maven pom which includes the specified dependency in the classpath of some Gradle configuration / Maven scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.java.dependencies.search.FindMinimumDependencyVersion
- Find the oldest matching dependency version in use
- The oldest dependency version in use is the lowest dependency version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Jackson 2.11, but a test source set uses Jackson 2.16. In this case, the oldest Jackson version in use is Java 2.11.
- org.openrewrite.java.dependencies.search.FindMinimumJUnitVersion
- Find minimum JUnit version
- A recipe to find the minimum version of JUnit dependencies. This recipe is designed to return the minimum version of JUnit in a project. It will search for JUnit 4 and JUnit 5 dependencies in the project. If both versions are found, it will return the minimum version of JUnit 4. If a minimumVersion is provided, the recipe will search to see if the minimum version of JUnit used by the project is no lower than the minimumVersion. For example: if the minimumVersion is 4, and the project has JUnit 4.12 and JUnit 5.7, the recipe will return JUnit 4.12. If the project has only JUnit 5.7, the recipe will return JUnit 5.7. Another example: if the minimumVersion is 5, and the project has JUnit 4.12 and JUnit 5.7, the recipe will not return any results.
- org.openrewrite.java.dependencies.search.ModuleHasDependency
- Module has dependency
- Searches for both Gradle and Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) or pom.xml file applying the plugin, use theFindDependencyrecipe instead.
- org.openrewrite.java.dependencies.search.RepositoryHasDependency
- Repository has dependency
- Searches for both Gradle and Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a repository with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use a springframework dependency, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) or pom.xml file applying the plugin, use theFindDependencyrecipe instead.
org.openrewrite.recipe:rewrite-java-security
License: Moderne Proprietary License
32 recipes
- org.openrewrite.csharp.dependencies.DependencyInsight
- Dependency insight for C#
- Finds dependencies in
*.csprojandpackages.config.
- org.openrewrite.csharp.dependencies.DependencyVulnerabilityCheck
- Find and fix vulnerable Nuget dependencies
- This software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe only upgrades to the latest patch version. If a minor or major upgrade is required to reach the fixed version, this recipe will not make any changes. Vulnerability information comes from the GitHub Security Advisory Database, which aggregates vulnerability data from several public databases, including the National Vulnerability Database maintained by the United States government. Dependencies following Semantic Versioning will see their patch version updated where applicable.
- org.openrewrite.csharp.dependencies.UpgradeDependencyVersion
- Upgrade C# dependency versions
- Upgrades dependencies in
*.csprojandpackages.config.
- org.openrewrite.java.dependencies.DependencyLicenseCheck
- Find licenses in use in third-party dependencies
- Locates and reports on all licenses in use.
- org.openrewrite.java.dependencies.DependencyVulnerabilityCheck
- Find and fix vulnerable dependencies
- This software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe by default only upgrades to the latest patch version. If a minor or major upgrade is required to reach the fixed version, this can be controlled using the
maximumUpgradeDeltaoption. Vulnerability information comes from the GitHub Security Advisory Database, which aggregates vulnerability data from several public databases, including the National Vulnerability Database maintained by the United States government. Upgrades dependencies versioned according to Semantic Versioning. ## Customizing Vulnerability Data This recipe can be customized by extendingDependencyVulnerabilityCheckBaseand overriding the vulnerability data sources: -baselineVulnerabilities(ExecutionContext ctx): Provides the default set of known vulnerabilities. The base implementation loads vulnerability data from the GitHub Security Advisory Database CSV file usingResourceUtils.parseResourceAsCsv(). Override this method to replace the entire vulnerability dataset with your own curated list. -supplementalVulnerabilities(ExecutionContext ctx): Allows adding custom vulnerability data beyond the baseline. The base implementation returns an empty list. Override this method to add organization-specific vulnerabilities, internal security advisories, or vulnerabilities from additional sources while retaining the baseline GitHub Advisory Database. Both methods returnList<Vulnerability>objects. Vulnerability data can be loaded from CSV files usingResourceUtils.parseResourceAsCsv(path, Vulnerability.class, consumer)or constructed programmatically. To customize, extendDependencyVulnerabilityCheckBaseand override one or both methods depending on your needs. For example, overridesupplementalVulnerabilities()to add custom CVEs while keeping the standard vulnerability database, or overridebaselineVulnerabilities()to use an entirely different vulnerability data source. Last updated: 2026-01-05T1103.
- org.openrewrite.java.dependencies.RemoveUnusedDependencies
- Remove unused dependencies
- Scans through source code collecting references to types and methods, removing any dependencies that are not used from Maven or Gradle build files. This recipe takes reflective access into account: When reflective access to a class is made unambiguously via a string literal, such as:
Class.forName("java.util.List")that is counted correctly. When reflective access to a class is made ambiguously via anything other than a string literal no dependencies will be removed. This recipe takes transitive dependencies into account: When a direct dependency is not used but a transitive dependency it brings in is in use the direct dependency is not removed.
- 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.
- 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.FixCwe338
- Fix CWE-338 with
SecureRandom - Use a cryptographically strong pseudo-random number generator (PRNG).
- Fix CWE-338 with
- org.openrewrite.java.security.ImproperPrivilegeManagement
- Improper privilege management
- Marking code as privileged enables a piece of trusted code to temporarily enable access to more resources than are available directly to the code that called it.
- org.openrewrite.java.security.PartialPathTraversalVulnerability
- Partial path traversal vulnerability
- Replaces
dir.getCanonicalPath().startsWith(parent.getCanonicalPath(), which is vulnerable to partial path traversal attacks, with the more securedir.getCanonicalFile().toPath().startsWith(parent.getCanonicalFile().toPath()). To demonstrate this vulnerability, consider"/usr/outnot".startsWith("/usr/out"). The check is bypassed although/outnotis not under the/outdirectory. It's important to understand that the terminating slash may be removed when using variousStringrepresentations of theFileobject. For example, on Linux,println(new File("/var"))will print/var, butprintln(new File("/var", "/")will print/var/; however,println(new File("/var", "/").getCanonicalPath())will print/var.
- org.openrewrite.java.security.RegularExpressionDenialOfService
- Regular Expression Denial of Service (ReDOS)
- ReDoS is a Denial of Service attack that exploits the fact that most Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size). See the OWASP description of this attack here for more details.
- org.openrewrite.java.security.SecureRandom
- Secure random
- Use cryptographically secure Pseudo Random Number Generation in the "main" source set. Replaces instantiation of
java.util.Randomwithjava.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.SecureTempFileCreation
- Use secure temporary file creation
java.io.File.createTempFile()has exploitable default file permissions. This recipe migrates to the more securejava.nio.file.Files.createTempFile().
- org.openrewrite.java.security.UseFilesCreateTempDirectory
- Use
Files#createTempDirectory - Use
Files#createTempDirectorywhen the sequenceFile#createTempFile(..)->File#delete()->File#mkdir()is used for creating a temp directory.
- Use
- org.openrewrite.java.security.XmlParserXXEVulnerability
- XML parser XXE vulnerability
- Avoid exposing dangerous features of the XML parser by updating certain factory settings.
- org.openrewrite.java.security.ZipSlip
- Zip slip
- Zip slip is an arbitrary file overwrite critical vulnerability, which typically results in remote command execution. A fuller description of this vulnerability is available in the Snyk documentation on it.
- org.openrewrite.java.security.marshalling.InsecureJmsDeserialization
- Insecure JMS deserialization
- JMS
Objectmessages depend on Java Serialization for marshalling/unmarshalling of the message payload whenObjectMessage#getObjectis called. Deserialization of untrusted data can lead to security flaws.
- org.openrewrite.java.security.marshalling.SecureJacksonDefaultTyping
- Secure the use of Jackson default typing
- See the blog post on this subject.
- org.openrewrite.java.security.marshalling.SecureSnakeYamlConstructor
- Secure the use of SnakeYAML's constructor
- See the paper on this subject.
- org.openrewrite.java.security.search.FindSensitiveApiEndpoints
- Find sensitive API endpoints
- Find data models exposed by REST APIs that contain sensitive information like PII and secrets.
- org.openrewrite.java.security.secrets.FindJwtSecrets
- Find JWT secrets
- Locates JWTs stored in plain text in code.
- org.openrewrite.java.security.secrets.FindSecretsByPattern
- Find secrets with regular expressions
- A secret is a literal that matches any one of the provided patterns.
- org.openrewrite.java.security.secrets.FindSlackSecrets
- Find Slack secrets
- Locates Slack secrets stored in plain text in code.
- org.openrewrite.java.security.servlet.CookieSetSecure
- Insecure cookies
- Check for use of insecure cookies. Cookies should be marked as secure. This ensures that the cookie is sent only over HTTPS to prevent cross-site scripting attacks.
- org.openrewrite.java.security.spring.CsrfProtection
- Enable CSRF attack prevention
- Cross-Site Request Forgery (CSRF) is a type of attack that occurs when a malicious web site, email, blog, instant message, or program causes a user's web browser to perform an unwanted action on a trusted site when the user is authenticated. See the full OWASP cheatsheet.
- org.openrewrite.java.security.spring.InsecureSpringServiceExporter
- Secure Spring service exporters
- The default Java deserialization mechanism is available via
ObjectInputStreamclass. 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’sRemoteInvocationSerializingExporteruses 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 leastHttpInvokerServiceExporterandSimpleHttpInvokerServiceExporterthat extendRemoteInvocationSerializingExporter. 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.
- org.openrewrite.java.security.spring.PreventClickjacking
- Prevent clickjacking
- The
frame-ancestorsdirective can be used in a Content-Security-Policy HTTP response header to indicate whether or not a browser should be allowed to render a page in a<frame>or<iframe>. Sites can use this to avoid Clickjacking attacks by ensuring that their content is not embedded into other sites.
- org.openrewrite.text.FindHardcodedLoopbackAddresses
- Find hard-coded loopback IPv4 addresses
- Locates mentions of hard-coded IPv4 addresses from the loopback IP range. The loopback IP range includes
127.0.0.0to127.255.255.255. This detects the entire localhost/loopback subnet range, not just the commonly used127.0.0.1.
- org.openrewrite.text.FindHardcodedPrivateIPAddresses
- Find hard-coded private IPv4 addresses
- Locates mentions of hard-coded IPv4 addresses from private IP ranges. Private IP ranges include: *
192.168.0.0to192.168.255.255*10.0.0.0to10.255.255.255*172.16.0.0to172.31.255.255It is not detecting the localhost subnet127.0.0.0to127.255.255.255.
- org.openrewrite.text.RemoveHardcodedIPAddressesFromComments
- Remove hard-coded IP addresses from comments
- Removes hard-coded IPv4 addresses from comments when they match private IP ranges or loopback addresses. This targets IP addresses that are commented out in various comment formats: Private IP ranges: *
192.168.0.0to192.168.255.255*10.0.0.0to10.255.255.255*172.16.0.0to172.31.255.255Loopback IP range: *127.0.0.0to127.255.255.255Supported comment formats: * C-style line comments (//) * C-style block comments (/* */) * Shell/Python style comments (#) * XML comments (<!-- -->) * YAML comments (#) * Properties file comments (#or!) For line comments, the entire line is removed. For block comments, only the IP address is removed.
org.openrewrite.recipe:rewrite-jenkins
License: Moderne Source Available License
10 recipes
- org.openrewrite.jenkins.AddJellyXmlDeclaration
- Add XML declaration to Jelly files
- Ensure the XML declaration
<?jelly escape-by-default='true'?>is present in all.jellyfiles.
- org.openrewrite.jenkins.AddPluginsBom
- Add or correct Jenkins plugins BOM
- Adds Jenkins plugins BOM at the latest release if the project depends on any managed versions or an outdated BOM is present. BOMs are expected to be synchronized to Jenkins LTS versions, so this will also remove any mismatched BOMs (Such as using Jenkins 2.387.3, but importing bom-2.319.x). If the expected BOM is already added, the version will not be upgraded.
- org.openrewrite.jenkins.CreateIndexJelly
- Create
index.jellyif it doesn't exist - Jenkins tooling requires
src/main/resources/index.jellyexists with a description.
- Create
- org.openrewrite.jenkins.DisableLocalResolutionForParentPom
- Disables local file resolution for parent POM
- Explicitly sets
<relativePath/>to disable file resolution, as recommended in the plugin development guide.
- org.openrewrite.jenkins.IsJenkinsPlugin
- Is the project a Jenkins plugin?
- Checks if the project is a Jenkins plugin by the presence of a managed version of
jenkins-core.
- org.openrewrite.jenkins.JenkinsfileAsGroovy
- Parse
Jenkinsfileas Groovy - Parse any
Jenkinsfileas Groovy code.
- Parse
- org.openrewrite.jenkins.ReplaceLibrariesWithApiPlugin
- Use Jenkins API plugin instead of libraries
- Prefer Jenkins API plugins over bundling libraries for slimmer plugins.
- org.openrewrite.jenkins.UpgradeJavaVersion
- Upgrade jenkins java version
- Upgrades the version of java specified in Jenkins groovy scripts. Will not downgrade if the version is newer than the specified version.
- org.openrewrite.jenkins.UpgradeVersionProperty
- Upgrade property's value to version
- If the current value is < given version, upgrade it.
- org.openrewrite.jenkins.github.AddTeamToCodeowners
- Add plugin developer team to CODEOWNERS
- Adds the
{artifactId}-plugin-developersteam to all files in.github/CODEOWNERSif absent.
org.openrewrite.recipe:rewrite-joda
License: Moderne Source Available License
1 recipe
- org.openrewrite.java.joda.time.JodaTimeRecipe
- Migrate Joda-Time to Java time
- Prefer the Java standard library over third-party usage of Joda Time.
org.openrewrite.recipe:rewrite-kubernetes
License: Moderne Proprietary License
18 recipes
- org.openrewrite.kubernetes.AddConfiguration
- Add Kubernetes configuration
- Add default required configuration when it is missing.
- org.openrewrite.kubernetes.ChangeApiVersion
- Change Kubernetes API version
- Change the Kubernetes API version in a resource.
- org.openrewrite.kubernetes.UpdateContainerImageName
- Update image name
- Search for image names that match patterns and replace the components of the name with new values.
- org.openrewrite.kubernetes.rbac.AddRuleToRole
- Add RBAC rules
- Add RBAC rules to ClusterRoles or namespaced Roles.
- org.openrewrite.kubernetes.resource.CapResourceValueToMaximum
- Cap exceeds resource value
- Cap resource values that exceed a specific maximum.
- org.openrewrite.kubernetes.resource.FindExceedsResourceRatio
- Find exceeds resource ratio
- Find resource manifests that have requests to limits ratios beyond a specific maximum.
- org.openrewrite.kubernetes.resource.FindExceedsResourceValue
- Find exceeds resource limit
- Find resource manifests that have limits set beyond a specific maximum.
- org.openrewrite.kubernetes.search.FindAnnotation
- Find annotation
- Find annotations that optionally match a given regex.
- org.openrewrite.kubernetes.search.FindDisallowedImageTags
- Find disallowed image tags
- The set of image tags to find which are considered disallowed.
- org.openrewrite.kubernetes.search.FindImage
- Find image by name
- The image name to search for in containers and initContainers.
- org.openrewrite.kubernetes.search.FindMissingDigest
- Find missing image digest
- Find instances of a container name that fails to specify a digest.
- org.openrewrite.kubernetes.search.FindMissingOrInvalidAnnotation
- Find annotation
- Find annotations that optionally match a given value.
- org.openrewrite.kubernetes.search.FindMissingOrInvalidLabel
- Find label
- Find labels that optionally match a given regex.
- org.openrewrite.kubernetes.search.FindNonTlsIngress
- Find non-TLS Ingresses
- Find Ingress resources that don't disallow HTTP or don't have TLS configured.
- org.openrewrite.kubernetes.search.FindResourceMissingConfiguration
- Find missing configuration
- Find Kubernetes resources with missing configuration.
- org.openrewrite.kubernetes.services.FindServiceExternalIPs
- Find uses of
externalIP - Find any
ServicewhoseexternalIPlist contains, or does not contain, one of a list of IPs.
- Find uses of
- org.openrewrite.kubernetes.services.FindServicesByType
- Service type
- Type of Kubernetes
Serviceto find.
- org.openrewrite.kubernetes.services.UpdateServiceExternalIP
- Update
ServiceexternalIP - Swap out an IP address with another one in
ServiceexternalIPsettings.
- Update
org.openrewrite.recipe:rewrite-liberty
License: Apache License Version 2.0
6 recipes
- org.openrewrite.java.liberty.RemoveWas2LibertyNonPortableJndiLookup
- Removes invalid JNDI properties
- Remove the use of invalid JNDI properties from Hashtable.
- org.openrewrite.java.liberty.ReplaceWSPrincipalGetCredential
- Replace
WSPrincipal.getCredential()withWSSubjectlookup - Replaces
WSCredential credential = WSPrincipal.getCredential();with anullinitializer +try/catchlookup.
- Replace
- org.openrewrite.java.liberty.ServerName
- Use
getProperty("wlp.server.name") ServerName.getDisplayName()is not available in Liberty.
- Use
- org.openrewrite.java.liberty.WebSphereUnavailableSSOCookieMethod
- Replace
revokeSSOCookieswithlogout - Replace
WSSecurityHelper.revokeSSOCookies(request, response)withrequest.logout().
- Replace
- org.openrewrite.xml.liberty.PersistenceXmlLocationRule
- Move persistence.xml file
- This recipes moves persistence.xml files into the root META-INF directory in source folder.
- org.openrewrite.xml.liberty.WebBeansXmlRule
- Replace beans.xml file
- This Recipe replaces OpenWebBeans schema in every beans.xml with the standard CDI schema.
org.openrewrite.recipe:rewrite-logging-frameworks
License: Moderne Source Available License
101 recipes
- org.openrewrite.java.logging.ArgumentArrayToVarargs
- Unpack Logger method
new Object[] {...}into varargs - For Logger methods that support varargs, convert any final explicit
Object[]arguments into their unpacked values.
- Unpack Logger method
- org.openrewrite.java.logging.CatchBlockLogLevel
- Catch block log level
- Sometimes exceptions are caught and logged at the wrong log level. This will set the log level of logging statements within a catch block not containing an exception to "warn", and the log level of logging statements containing an exception to "error". This supports SLF4J, Log4J1, Log4j2, and Logback.
- org.openrewrite.java.logging.ChangeLoggersToPrivate
- Change logger fields to
private - Ensures that logger fields are declared as
privateto encapsulate logging mechanics within the class.
- Change logger fields to
- org.openrewrite.java.logging.ChangeLombokLogAnnotation
- Replace any Lombok log annotations with target logging framework annotation
- Replace Lombok annotations such as
@CommonsLogand@Log4jwith the target logging framework annotation, or@Sl4fjif not provided.
- 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)becomeslogger.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.PrintStackTraceToLogError
- Use logger instead of
printStackTrace() - When a logger is present, log exceptions rather than calling
printStackTrace().
- Use logger instead of
- org.openrewrite.java.logging.SystemErrToLogging
- Use logger instead of
System.errprint statements - Replace
System.errprint statements with a logger.
- Use logger instead of
- org.openrewrite.java.logging.SystemOutToLogging
- Use logger instead of
System.outprint statements - Replace
System.outprint statements with a logger.
- Use logger instead of
- org.openrewrite.java.logging.SystemPrintToLogging
- Use logger instead of system print statements
- Replace
System.outandSystem.errprint statements with a logger.
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes
- Replace deprecated JBoss Logging Logger formatted message invocations with the v-version of methods
- Replace
logger.level("hello {0}", arg)withlogger.levelv("hello {0}", arg).
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$DebugToVDebugRecipe
- Refaster template
FormattedArgumentsToVMethod.DebugToVDebug - Recipe created for the following Refaster template:
java public static class DebugToVDebug { @BeforeTemplate void before(Logger logger, String message, Object[] args) { logger.debug(message, args); } @AfterTemplate void after(Logger logger, String message, Object[] args) { logger.debugv(message, args); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$DebugToVDebugWithThrowableRecipe
- Refaster template
FormattedArgumentsToVMethod.DebugToVDebugWithThrowable - Recipe created for the following Refaster template:
java public static class DebugToVDebugWithThrowable { @BeforeTemplate void before(Logger logger, String message, Object[] args, Throwable t) { logger.debug((Object)message, args, t); } @AfterTemplate void after(Logger logger, String message, Object[] args, Throwable t) { logger.debugv(message, args, t); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$ErrorToVErrorRecipe
- Refaster template
FormattedArgumentsToVMethod.ErrorToVError - Recipe created for the following Refaster template:
java public static class ErrorToVError { @BeforeTemplate void before(Logger logger, String message, Object[] args) { logger.error(message, args); } @AfterTemplate void after(Logger logger, String message, Object[] args) { logger.errorv(message, args); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$ErrorToVErrorWithThrowableRecipe
- Refaster template
FormattedArgumentsToVMethod.ErrorToVErrorWithThrowable - Recipe created for the following Refaster template:
java public static class ErrorToVErrorWithThrowable { @BeforeTemplate void before(Logger logger, String message, Object[] args, Throwable t) { logger.error((Object)message, args, t); } @AfterTemplate void after(Logger logger, String message, Object[] args, Throwable t) { logger.errorv(message, args, t); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$FatalToVFatalRecipe
- Refaster template
FormattedArgumentsToVMethod.FatalToVFatal - Recipe created for the following Refaster template:
java public static class FatalToVFatal { @BeforeTemplate void before(Logger logger, String message, Object[] args) { logger.fatal(message, args); } @AfterTemplate void after(Logger logger, String message, Object[] args) { logger.fatalv(message, args); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$FatalToVFatalWithThrowableRecipe
- Refaster template
FormattedArgumentsToVMethod.FatalToVFatalWithThrowable - Recipe created for the following Refaster template:
java public static class FatalToVFatalWithThrowable { @BeforeTemplate void before(Logger logger, String message, Object[] args, Throwable t) { logger.fatal((Object)message, args, t); } @AfterTemplate void after(Logger logger, String message, Object[] args, Throwable t) { logger.fatalv(message, args, t); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$InfoToVInfoRecipe
- Refaster template
FormattedArgumentsToVMethod.InfoToVInfo - Recipe created for the following Refaster template:
java public static class InfoToVInfo { @BeforeTemplate void before(Logger logger, String message, Object[] args) { logger.info(message, args); } @AfterTemplate void after(Logger logger, String message, Object[] args) { logger.infov(message, args); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$InfoToVInfoWithThrowableRecipe
- Refaster template
FormattedArgumentsToVMethod.InfoToVInfoWithThrowable - Recipe created for the following Refaster template:
java public static class InfoToVInfoWithThrowable { @BeforeTemplate void before(Logger logger, String message, Object[] args, Throwable t) { logger.info((Object)message, args, t); } @AfterTemplate void after(Logger logger, String message, Object[] args, Throwable t) { logger.infov(message, args, t); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$TraceToVTraceRecipe
- Refaster template
FormattedArgumentsToVMethod.TraceToVTrace - Recipe created for the following Refaster template:
java public static class TraceToVTrace { @BeforeTemplate void before(Logger logger, String message, Object[] args) { logger.trace(message, args); } @AfterTemplate void after(Logger logger, String message, Object[] args) { logger.tracev(message, args); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$TraceToVTraceWithThrowableRecipe
- Refaster template
FormattedArgumentsToVMethod.TraceToVTraceWithThrowable - Recipe created for the following Refaster template:
java public static class TraceToVTraceWithThrowable { @BeforeTemplate void before(Logger logger, String message, Object[] args, Throwable t) { logger.trace((Object)message, args, t); } @AfterTemplate void after(Logger logger, String message, Object[] args, Throwable t) { logger.tracev(message, args, t); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$WarnToVWarnRecipe
- Refaster template
FormattedArgumentsToVMethod.WarnToVWarn - Recipe created for the following Refaster template:
java public static class WarnToVWarn { @BeforeTemplate void before(Logger logger, String message, Object[] args) { logger.warn(message, args); } @AfterTemplate void after(Logger logger, String message, Object[] args) { logger.warnv(message, args); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.FormattedArgumentsToVMethodRecipes$WarnToVWarnWithThrowableRecipe
- Refaster template
FormattedArgumentsToVMethod.WarnToVWarnWithThrowable - Recipe created for the following Refaster template:
java public static class WarnToVWarnWithThrowable { @BeforeTemplate void before(Logger logger, String message, Object[] args, Throwable t) { logger.warn((Object)message, args, t); } @AfterTemplate void after(Logger logger, String message, Object[] args, Throwable t) { logger.warnv(message, args, t); } }.
- Refaster template
- org.openrewrite.java.logging.jboss.LoggerLevelArgumentToMethod
- Replace JBoss Logging Level arguments with the corresponding eponymous level method calls
- Replace calls to
Logger.log(Level, ...)with the corresponding eponymous level method calls. For exampleLogger.log(Level.INFO, ...)toLogger.info(...).
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes
- Replace JUL Level arguments with the corresponding method calls
- Replace calls to
Logger.log(Level, String)with the corresponding method calls.
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelConfigSupplierToMethodRecipe
- Replace JUL
Logger.log(Level.CONFIG, Supplier<String>)withLogger.config(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.CONFIG, Supplier<String>)withLogger.config(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelConfigToMethodRecipe
- Replace JUL
Logger.log(Level.CONFIG, String)withLogger.config(String) - Replace calls to
java.util.logging.Logger.log(Level.CONFIG, String)withLogger.config(String).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFineSupplierToMethodRecipe
- Replace JUL
Logger.log(Level.FINE, Supplier<String>)withLogger.fine(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINE, Supplier<String>)withLogger.fine(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFineToMethodRecipe
- Replace JUL
Logger.log(Level.FINE, String)withLogger.fine(String) - Replace calls to
java.util.logging.Logger.log(Level.FINE, String)withLogger.fine(String).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinerSupplierToMethodRecipe
- Replace JUL
Logger.log(Level.FINER, Supplier<String>)withLogger.finer(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINER, Supplier<String>)withLogger.finer(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinerToMethodRecipe
- Replace JUL
Logger.log(Level.FINER, String)withLogger.finer(String) - Replace calls to
java.util.logging.Logger.log(Level.FINER, String)withLogger.finer(String).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinestSupplierToMethodRecipe
- Replace JUL
Logger.log(Level.FINEST, Supplier<String>)withLogger.finest(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINEST, Supplier<String>)withLogger.finest(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelFinestToMethodRecipe
- Replace JUL
Logger.log(Level.FINEST, String)withLogger.finest(String) - Replace calls to
java.util.logging.Logger.log(Level.FINEST, String)withLogger.finest(String).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelInfoSupplierToMethodRecipe
- Replace JUL
Logger.log(Level.INFO, Supplier<String>)withLogger.info(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.INFO, Supplier<String>)withLogger.info(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelInfoToMethodRecipe
- Replace JUL
Logger.log(Level.INFO, String)withLogger.info(String) - Replace calls to
java.util.logging.Logger.log(Level.INFO, String)withLogger.info(String).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelSevereSupplierToMethodRecipe
- Replace JUL
Logger.log(Level.SEVERE, Supplier<String>)withLogger.severe(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.SEVERE, Supplier<String>)withLogger.severe(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelSevereToMethodRecipe
- Replace JUL
Logger.log(Level.SEVERE, String)withLogger.severe(String) - Replace calls to
java.util.logging.Logger.log(Level.SEVERE, String)withLogger.severe(String).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelWarningSupplierToMethodRecipe
- Replace JUL
Logger.log(Level.WARNING, Supplier<String>)withLogger.warning(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.WARNING, Supplier<String>)withLogger.warning(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.jul.LoggerLevelArgumentToMethodRecipes$LogLevelWarningToMethodRecipe
- Replace JUL
Logger.log(Level.WARNING, String)withLogger.warning(String) - Replace calls to
java.util.logging.Logger.log(Level.WARNING, String)withLogger.warning(String).
- Replace JUL
- org.openrewrite.java.logging.log4j.ConvertJulEntering
- Rewrites JUL's Logger#entering method to Log4j API
- Replaces JUL's Logger#entering method calls to Log4j API Logger#traceEntry calls.
- org.openrewrite.java.logging.log4j.ConvertJulExiting
- Rewrites JUL's Logger#exiting method to Log4j API
- Replaces JUL's Logger#exiting method calls to Log4j API Logger#traceEntry calls.
- org.openrewrite.java.logging.log4j.LoggerSetLevelToConfiguratorRecipe
- Convert Log4j
Logger.setLevelto Log4j2Configurator.setLevel - Converts
org.apache.log4j.Logger.setLeveltoorg.apache.logging.log4j.core.config.Configurator.setLevel.
- Convert Log4j
- org.openrewrite.java.logging.log4j.LoggingExceptionConcatenationRecipe
- Log exceptions as parameters rather than as string concatenations
- By using the exception as another parameter you get the whole stack trace.
- org.openrewrite.java.logging.log4j.PrependRandomName
- Prepend a random name to each Log4J statement
- To make finding the callsite of a logging statement easier in code search.
- org.openrewrite.java.logging.logback.ConfigureLoggerLevel
- Configure logback logger level
- Within logback.xml configuration files sets the specified log level for a particular class. Will not create a logback.xml if one does not already exist.
- org.openrewrite.java.logging.logback.Log4jAppenderToLogback
- Migrate Log4j 2.x Appender to logback-classic equivalents
- Migrates custom Log4j 2.x Appender components to
logback-classic. This recipe operates on the following assumptions: 1.) The contents of theappend()method remains unchanged. 2.) TherequiresLayout()method is not used in logback and can be removed. 3.) In logback, thestop()method is the equivalent of log4j's close() method. For more details, see this page from logback:Migration from log4j.
- org.openrewrite.java.logging.logback.Log4jLayoutToLogback
- Migrate Log4j 2.x Layout to logback-classic equivalents
- Migrates custom Log4j 2.x Layout components to
logback-classic. This recipe operates on the following assumptions: 1. A logback-classic layout must extend theLayoutBase<ILoggingEvent>class. 2. log4j'sformat()is renamed todoLayout()in a logback-classic layout. 3. LoggingEventgetRenderedMessage()is converted to LoggingEventgetMessage(). 4. The log4j ignoresThrowable() method is not needed and has no equivalent in logback-classic. 5. The activateOptions() method merits further discussion. In log4j, a layout will have its activateOptions() method invoked by log4j configurators, that is PropertyConfigurator or DOMConfigurator just after all the options of the layout have been set. Thus, the layout will have an opportunity to check that its options are coherent and if so, proceed to fully initialize itself. 6. In logback-classic, layouts must implement the LifeCycle interface which includes a method called start(). The start() method is the equivalent of log4j's activateOptions() method. For more details, see this page from logback:Migration from log4j.
- org.openrewrite.java.logging.slf4j.ChangeLogLevel
- Change SLF4J log level
- Change the log level of SLF4J log statements.
- org.openrewrite.java.logging.slf4j.CompleteExceptionLogging
- Enhances logging of exceptions by including the full stack trace in addition to the exception message
- It is a common mistake to call
Exception.getMessage()when passing an exception into a log method. Not all exception types have useful messages, and even if the message is useful this omits the stack trace. Including a complete stack trace of the error along with the exception message in the log allows developers to better understand the context of the exception and identify the source of the error more quickly and accurately. If the method invocation includes any call toException.getMessage()orException.getLocalizedMessage()and not an exception is already passed as the last parameter to the log method, then we will append the exception as the last parameter in the log method.
- org.openrewrite.java.logging.slf4j.JulGetLoggerToLoggerFactoryRecipes
- Replace JUL Logger creation with SLF4J LoggerFactory
- Replace calls to
Logger.getLoggerwithLoggerFactory.getLogger.
- org.openrewrite.java.logging.slf4j.JulGetLoggerToLoggerFactoryRecipes$GetLoggerClassCanonicalNameToLoggerFactoryRecipe
- Replace JUL
Logger.getLogger(Some.class.getCanonicalName())with SLF4J'sLoggerFactory.getLogger(Some.class) - Replace calls to
java.util.logging.Logger.getLogger(Some.class.getCanonicalName())withorg.slf4j.LoggerFactory.getLogger(Some.class).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulGetLoggerToLoggerFactoryRecipes$GetLoggerClassNameToLoggerFactoryRecipe
- Replace JUL
Logger.getLogger(Some.class.getName())with SLF4J'sLoggerFactory.getLogger(Some.class) - Replace calls to
java.util.logging.Logger.getLogger(Some.class.getName())withorg.slf4j.LoggerFactory.getLogger(Some.class).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes
- Replace JUL active Level check with corresponding SLF4J method calls
- Replace calls to
Logger.isLoggable(Level)with the corresponding SLF4J method calls.
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelAllRecipe
- Replace JUL
Logger.isLoggable(Level.ALL)with SLF4J'sLogger.isTraceEnabled - Replace calls to
java.util.logging.Logger.isLoggable(Level.ALL)withorg.slf4j.Logger.isTraceEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelConfigRecipe
- Replace JUL
Logger.isLoggable(Level.CONFIG)with SLF4J'sLogger.isInfoEnabled() - Replace calls to
java.util.logging.Logger.isLoggable(Level.CONFIG)withorg.slf4j.Logger.isInfoEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelFineRecipe
- Replace JUL
Logger.isLoggable(Level.FINE)with SLF4J'sLogger.isDebugEnabled() - Replace calls to
java.util.logging.Logger.isLoggable(Level.FINE)withorg.slf4j.Logger.isDebugEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelFinerRecipe
- Replace JUL
Logger.isLoggable(Level.FINER)with SLF4J'sLogger.isTraceEnabled() - Replace calls to
java.util.logging.Logger.isLoggable(Level.FINER)withorg.slf4j.Logger.isTraceEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelFinestRecipe
- Replace JUL
Logger.isLoggable(Level.FINEST)with SLF4J'sLogger.isTraceEnabled - Replace calls to
java.util.logging.Logger.isLoggable(Level.FINEST)withorg.slf4j.Logger.isTraceEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelInfoRecipe
- Replace JUL
Logger.isLoggable(Level.INFO)with SLF4J'sLogger.isInfoEnabled() - Replace calls to
java.util.logging.Logger.isLoggable(Level.INFO)withorg.slf4j.Logger.isInfoEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelSevereRecipe
- Replace JUL
Logger.isLoggable(Level.SEVERE)with SLF4J'sLogger.isErrorEnabled() - Replace calls to
java.util.logging.Logger.isLoggable(Level.SEVERE)withorg.slf4j.Logger.isErrorEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulIsLoggableToIsEnabledRecipes$LoggerIsLoggableLevelWarningRecipe
- Replace JUL
Logger.isLoggable(Level.WARNING)with SLF4J'sLogger.isWarnEnabled() - Replace calls to
java.util.logging.Logger.isLoggable(Level.WARNING)withorg.slf4j.Logger.isWarnEnabled().
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulLevelAllToTraceRecipe
- Replace JUL
Level.ALLlogging with SLF4J's trace level - Replace
java.util.logging.Logger#log(Level.ALL, String)withorg.slf4j.Logger#trace(String).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulParameterizedArguments
- Replace parameterized JUL level call with corresponding SLF4J method calls
- Replace calls to parameterized
Logger.log(Level,String,…)call with the corresponding slf4j method calls transforming the formatter and parameter lists.
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes
- Replace JUL active Level check with corresponding SLF4J method calls
- Replace calls to
Logger.isLoggable(Level)with the corresponding SLF4J method calls.
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierConfigRecipe
- Replace JUL
Logger.config(Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.config(Supplier<String>)withorg.slf4j.Logger.atInfo().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierFineRecipe
- Replace JUL
Logger.fine(Supplier<String>)with SLF4J'sLogger.atDebug().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.fine(Supplier<String>)withorg.slf4j.Logger.atDebug().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierFinerRecipe
- Replace JUL
Logger.finer(Supplier<String>)with SLF4J'sLogger.atTrace().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.finer(Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierFinestRecipe
- Replace JUL
Logger.finest(Supplier<String>)with SLF4J'sLogger.atTrace().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.finest(Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierInfoRecipe
- Replace JUL
Logger.info(Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.info(Supplier<String>)withorg.slf4j.Logger.atInfo().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogAllRecipe
- Replace JUL
Logger.log(Level.ALL, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.ALL, Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogConfigRecipe
- Replace JUL
Logger.log(Level.CONFIG, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.CONFIG, Supplier<String>)withorg.slf4j.Logger.atInfo().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogFineRecipe
- Replace JUL
Logger.log(Level.FINE, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINE, Supplier<String>)withorg.slf4j.Logger.atDebug().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogFinerRecipe
- Replace JUL
Logger.log(Level.FINER, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINER, Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogFinestRecipe
- Replace JUL
Logger.log(Level.FINEST, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINEST, Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogInfoRecipe
- Replace JUL
Logger.log(Level.INFO, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.INFO, Supplier<String>)withorg.slf4j.Logger.atInfo().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogSevereRecipe
- Replace JUL
Logger.log(Level.SEVERE, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.SEVERE, Supplier<String>)withorg.slf4j.Logger.atError().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierLogWarningRecipe
- Replace JUL
Logger.log(Level.WARNING, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.WARNING, Supplier<String>)withorg.slf4j.Logger.atWarn().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierSevereRecipe
- Replace JUL
Logger.severe(Supplier<String>)with SLF4J'sLogger.atError().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.severe(Supplier<String>)withorg.slf4j.Logger.atError().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierRecipes$JulToSlf4jSupplierWarningRecipe
- Replace JUL
Logger.warning(Supplier<String>)with SLF4J'sLogger.atWarn().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.warning(Supplier<String>)withorg.slf4j.Logger.atWarn().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes
- Replace JUL
log(Level, Throwable, Supplier<String>)with corresponding SLF4J method calls - Replace calls to
Logger.log(Level, Throwable, Supplier<String>)with the corresponding SLF4J method calls.
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierAllRecipe
- Replace JUL
logger.log(Level.ALL, e, Supplier<String>)with SLF4J'sLogger.atTrace().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.ALL, e, Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierConfigRecipe
- Replace JUL
logger.log(Level.CONFIG, e, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.CONFIG, e, Supplier<String>)withorg.slf4j.Logger.atInfo().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierFineRecipe
- Replace JUL
logger.log(Level.FINE, e, Supplier<String>)with SLF4J'sLogger.atDebug().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINE, e, Supplier<String>)withorg.slf4j.Logger.atDebug().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierFinerRecipe
- Replace JUL
logger.log(Level.FINER, e, Supplier<String>)with SLF4J'sLogger.atTrace().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINER, e, Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierFinestRecipe
- Replace JUL
logger.log(Level.FINEST, e, Supplier<String>)with SLF4J'sLogger.atTrace().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.FINEST, e, Supplier<String>)withorg.slf4j.Logger.atTrace().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierInfoRecipe
- Replace JUL
logger.log(Level.INFO, e, Supplier<String>)with SLF4J'sLogger.atInfo().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.INFO, e, Supplier<String>)withorg.slf4j.Logger.atInfo().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierSevereRecipe
- Replace JUL
logger.log(Level.SEVERE, e, Supplier<String>)with SLF4J'sLogger.atError().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.SEVERE, e, Supplier<String>)withorg.slf4j.Logger.atError().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jLambdaSupplierWithThrowableRecipes$JulToSlf4jSupplierWarningRecipe
- Replace JUL
logger.log(Level.WARNING, e, Supplier<String>)with SLF4J'sLogger.atWarn().log(Supplier<String>) - Replace calls to
java.util.logging.Logger.log(Level.WARNING, e, Supplier<String>)withorg.slf4j.Logger.atWarn().log(Supplier<String>).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes
- Replace JUL
log(Level, String, Throwable)with corresponding SLF4J method calls - Replace calls to
Logger.log(Level, String, Throwable)with the corresponding SLF4J method calls.
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierAllRecipe
- Replace JUL
logger.log(Level.ALL, String message, Throwable e)with SLF4J'sLogger.trace(message, e) - Replace calls to
java.util.logging.Logger.log(Level.ALL, String message, Throwable e)withorg.slf4j.Logger.trace(message, e).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierConfigRecipe
- Replace JUL
logger.log(Level.CONFIG, String message, Throwable e)with SLF4J'sLogger.info(message, e) - Replace calls to
java.util.logging.Logger.log(Level.CONFIG, String message, Throwable e)withorg.slf4j.Logger.info(message, e).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierFineRecipe
- Replace JUL
logger.log(Level.FINE, String message, Throwable e)with SLF4J'sLogger.debug(message, e) - Replace calls to
java.util.logging.Logger.log(Level.FINE, String message, Throwable e)withorg.slf4j.Logger.debug(message, e).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierFinerRecipe
- Replace JUL
logger.log(Level.FINER, String message, Throwable e)with SLF4J'sLogger.trace(message, e) - Replace calls to
java.util.logging.Logger.log(Level.FINER, String message, Throwable e)withorg.slf4j.Logger.trace(message, e).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierFinestRecipe
- Replace JUL
logger.log(Level.FINEST, String message, Throwable e)with SLF4J'sLogger.trace(message, e) - Replace calls to
java.util.logging.Logger.log(Level.FINEST, String message, Throwable e)withorg.slf4j.Logger.trace(message, e).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierInfoRecipe
- Replace JUL
logger.log(Level.INFO, String message, Throwable e)with SLF4J'sLogger.info(message, e) - Replace calls to
java.util.logging.Logger.log(Level.INFO, String message, Throwable e)withorg.slf4j.Logger.info(message, e).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierSevereRecipe
- Replace JUL
logger.log(Level.SEVERE, String message, Throwable e)with SLF4J'sLogger.error(message, e) - Replace calls to
java.util.logging.Logger.log(Level.SEVERE, String message, Throwable e)withorg.slf4j.Logger.error(message, e).
- Replace JUL
- org.openrewrite.java.logging.slf4j.JulToSlf4jSimpleCallsWithThrowableRecipes$JulToSlf4jSupplierWarningRecipe
- Replace JUL
logger.log(Level.WARNING, String message, Throwable e)with SLF4J'sLogger.warn(message, e) - Replace calls to
java.util.logging.Logger.log(Level.WARNING, String message, Throwable e)withorg.slf4j.Logger.warn(message, e).
- Replace JUL
- 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.MatchIsLogLevelEnabledWithLogStatements
- Match
if (is*Enabled())with logging statements - Change any
if (is*Enabled())statements that do not match the maximum log level used in thethenpart to use the matchingis*Enabled()method for that log level. This ensures that the logging condition is consistent with the actual logging statements.
- Match
- org.openrewrite.java.logging.slf4j.Slf4jLogShouldBeConstant
- SLF4J logging statements should begin with constants
- Logging statements shouldn't begin with
String#format, calls totoString(), etc.
- org.openrewrite.java.logging.slf4j.StripToStringFromArguments
- Strip
toString()from arguments - Remove
.toString()from logger call arguments; SLF4J will automatically calltoString()on an argument when not a string, and do so only if the log level is enabled.
- Strip
- org.openrewrite.java.logging.slf4j.WrapExpensiveLogStatementsInConditionals
- Optimize log statements
- When trace, debug and info log statements use methods for constructing log messages, those methods are called regardless of whether the log level is enabled. This recipe optimizes these statements by either wrapping them in if-statements (SLF4J 1.x) or converting them to fluent API calls (SLF4J 2.0+) to ensure expensive methods are only called when necessary.
org.openrewrite.recipe:rewrite-micrometer
License: Moderne Source Available License
4 recipes
- org.openrewrite.micrometer.TimerToObservation
- Convert Micrometer
TimertoObservations - Convert Micrometer
TimertoObservationsto instrument once, and get multiple benefits out of it.
- Convert Micrometer
- org.openrewrite.micrometer.dropwizard.FindDropwizardMetrics
- Find Dropwizard metrics
- Find uses of Dropwizard metrics that could be converted to a more modern metrics instrumentation library.
- org.openrewrite.micrometer.misk.MigrateEmptyLabelMiskCounter
- Migrate Misk counter to Micrometer
- Convert a Misk (Prometheus) counter to a Micrometer counter.
- org.openrewrite.micrometer.misk.NoExplicitEmptyLabelList
- Don't use an explicit empty label list
listOf()is the default argument for thelabelsparameter.
org.openrewrite.recipe:rewrite-micronaut
License: Apache License Version 2.0
19 recipes
- org.openrewrite.java.micronaut.AddAnnotationProcessorPath
- Add Maven annotation processor path
- Add the groupId, artifactId, version, and exclusions of a Maven annotation processor path.
- org.openrewrite.java.micronaut.AddHttpRequestTypeParameter
- Add
HttpRequesttype parameter for implemented interfaces - Add an
HttpRequesttype parameter to a classimplementsstatement for interfaces that have been generically parameterized where they previously specifiedHttpRequestexplicitly.
- Add
- org.openrewrite.java.micronaut.AddSnakeYamlDependencyIfNeeded
- Add
snakeyamldependency if needed - This recipe will add the
snakeyamldependency to a Micronaut 4 application that uses yaml configuration.
- Add
- org.openrewrite.java.micronaut.AddTestResourcesClientDependencyIfNeeded
- Add
micronaut-test-resources-clientif needed - Add the
micronaut-test-resources-clientdependency to pom.xml iftest.resources.client.enabled property=true.
- Add
- org.openrewrite.java.micronaut.BeanPropertyCapitalizationStrategy
- De-capitalize
BeanIntrospectiongetProperty(..)andgetRequiredProperty(..)name arguments - As of Micronaut 3.x property names for getters like
getXForwarded()are de-capitalized fromXForwardedtoxForwarded.
- De-capitalize
- org.openrewrite.java.micronaut.ChangeAnnotationProcessorPath
- Change Maven annotation processor path
- Change the groupId, artifactId, and version of a Maven annotation processor path.
- org.openrewrite.java.micronaut.CopyNonInheritedAnnotations
- Copy non-inherited annotations from super class
- As of Micronaut 3.x only annotations that are explicitly meta-annotated with
@Inheritedare inherited from parent classes and interfaces.
- org.openrewrite.java.micronaut.FindPropertiesConfig
- Find Micronaut properties config
- Find Micronaut properties configuration files.
- org.openrewrite.java.micronaut.FindYamlConfig
- Find Micronaut yaml config
- Find Micronaut yaml configuration files.
- org.openrewrite.java.micronaut.FixDeprecatedExceptionHandlerConstructors
- Fix deprecated no-arg
ExceptionHandlerconstructors - Adds
ErrorResponseProcessorargument to deprecated no-argExceptionHandlerconstructors.
- Fix deprecated no-arg
- org.openrewrite.java.micronaut.OncePerRequestHttpServerFilterToHttpServerFilter
- Convert
OncePerRequestServerFilterextensions toHttpServerFilter - Starting in Micronaut 3.0 all filters are executed once per request. Directly implement
HttpServerFilterinstead of extendingOncePerRequestHttpServerFilterand replace any usages ofmicronaut.onceattributes with a custom attribute name.
- Convert
- org.openrewrite.java.micronaut.ProviderImplementationsToMicronautFactories
Providerimplementation beans to Micronaut@Factory- As of Micronaut 3.x the
@Factoryannotation is required for creating beans fromjavax.inject.Provider get()implementations.
- org.openrewrite.java.micronaut.RemoveAnnotationProcessorPath
- Remove Maven annotation processor path
- Remove the Maven annotation processor path that matches the given groupId and artifactId.
- org.openrewrite.java.micronaut.SubclassesReturnedFromFactoriesNotInjectable
- Change factory method return types to reflect their resolved return type
- As of Micronaut 3.x It is no longer possible to inject the internal implementation type from beans produced via factories. Factory method return types are changed to reflect the resolved return type if the method returns a single non-null type that does not match the method declaration return type.
- org.openrewrite.java.micronaut.TypeRequiresIntrospection
- Add
@Introspectedto classes requiring a map representation - In Micronaut 2.x a reflection-based strategy was used to retrieve that information if the class was not annotated with
@Introspected. As of Micronaut 3.x it is required to annotate classes with@Introspectedthat are used in this way.
- Add
- org.openrewrite.java.micronaut.UpdateSecurityPropertiesIfNeeded
- Update relocated Micronaut Security config properties
- This recipe will update relocated security config keys in Micronaut configuration property files.
- org.openrewrite.java.micronaut.UpdateSecurityYamlIfNeeded
- Update relocated Micronaut Security config yaml keys
- This recipe will update relocated security config keys in Micronaut configuration yaml files.
- org.openrewrite.java.micronaut.UpgradeMicronautGradlePropertiesVersion
- Upgrade gradle.properties Micronaut version
- Set the gradle.properties version number according to a node-style semver selector or to a specific version number.
- org.openrewrite.java.micronaut.UpgradeMicronautMavenPropertyVersion
- Upgrade
micronaut.versionMaven property - Set the maven micronaut.version property according to a node-style semver selector or to a specific version number.
- Upgrade
org.openrewrite.recipe:rewrite-migrate-java
License: Moderne Source Available License
167 recipes
- org.openrewrite.java.migrate.AddJDeprScanPlugin
- Add
JDeprScanMaven Plug-in - Add the
JDeprScanMaven plugin to scan class files for uses of deprecated APIs.
- Add
- org.openrewrite.java.migrate.AddMissingMethodImplementation
- Adds missing method implementations
- Check for missing methods required by interfaces and adds them.
- org.openrewrite.java.migrate.AddStaticVariableOnProducerSessionBean
- Adds
staticmodifier to@Producesfields that are in session beans - Ensures that the fields annotated with
@Produceswhich is inside the session bean (@Stateless,@Stateful, or@Singleton) are declaredstatic.
- Adds
- org.openrewrite.java.migrate.AddSuppressionForIllegalReflectionWarningsPlugin
- Add maven jar plugin to suppress illegal reflection warnings
- Adds a maven jar plugin that's configured to suppress Illegal Reflection Warnings.
- org.openrewrite.java.migrate.ArrayStoreExceptionToTypeNotPresentException
- Catch
TypeNotPresentExceptionthrown byClass.getAnnotation() - Replace catch blocks for
ArrayStoreExceptionaroundClass.getAnnotation()withTypeNotPresentExceptionto ensure compatibility with Java 11+.
- Catch
- org.openrewrite.java.migrate.BeanDiscovery
- Behavior change to bean discovery in modules with
beans.xmlfile with no version specified - Alters beans with missing version attribute to include this attribute as well as the bean-discovery-mode="all" attribute to maintain an explicit bean archive.
- Behavior change to bean discovery in modules with
- org.openrewrite.java.migrate.BeansXmlNamespace
- Change
beans.xmlschemaLocationto match XML namespace - Set the
schemaLocationthat corresponds to thexmlnsset inbeans.xmlfiles.
- Change
- org.openrewrite.java.migrate.CastArraysAsListToList
- Remove explicit casts on
Arrays.asList(..).toArray() - Convert code like
(Integer[]) Arrays.asList(1, 2, 3).toArray()toArrays.asList(1, 2, 3).toArray(new Integer[0]).
- Remove explicit casts on
- org.openrewrite.java.migrate.ChangeDefaultKeyStore
- Return String
jkswhenKeyStore.getDefaultType()is called - In Java 11 the default keystore was updated from JKS to PKCS12. As a result, applications relying on KeyStore.getDefaultType() may encounter issues after migrating, unless their JKS keystore has been converted to PKCS12. This recipe returns default key store of
jkswhenKeyStore.getDefaultType()method is called to use the pre Java 11 default keystore.
- Return String
- org.openrewrite.java.migrate.ChangeMethodInvocationReturnType
- Change method invocation return type
- Changes the return type of a method invocation.
- org.openrewrite.java.migrate.DontOverfetchDto
- Replace DTO method parameters with data elements
- Replace method parameters that have DTOs with their data elements when only the specified data element is used.
- org.openrewrite.java.migrate.IllegalArgumentExceptionToAlreadyConnectedException
- Replace
IllegalArgumentExceptionwithAlreadyConnectedExceptioninDatagramChannel.send()method - Replace
IllegalArgumentExceptionwithAlreadyConnectedExceptionfor DatagramChannel.send() to ensure compatibility with Java 11+.
- Replace
- org.openrewrite.java.migrate.JREThrowableFinalMethods
- Rename final method declarations
getSuppressed()andaddSuppressed(Throwable exception)in classes that extendThrowable - The recipe renames
getSuppressed()andaddSuppressed(Throwable exception)methods in classes that extendjava.lang.ThrowabletomyGetSuppressedandmyAddSuppressed(Throwable). These methods were added to Throwable in Java 7 and are marked final which cannot be overridden.
- Rename final method declarations
- org.openrewrite.java.migrate.JpaCacheProperties
- Disable the persistence unit second-level cache
- Sets an explicit value for the shared cache mode.
- org.openrewrite.java.migrate.MXBeanRule
- MBean and MXBean interfaces must be public
- Sets visibility of MBean and MXBean interfaces to public.
- org.openrewrite.java.migrate.ReferenceCloneMethod
- Replace
java.lang.ref.Reference.clone()with constructor call - The recipe replaces any clone calls that may resolve to a
java.lang.ref.Reference.clone()or any of its known subclasses:java.lang.ref.PhantomReference,java.lang.ref.SoftReference, andjava.lang.ref.WeakReferencewith a constructor call passing in the referent and reference queue as parameters.
- Replace
- org.openrewrite.java.migrate.RemoveIllegalSemicolons
- Remove illegal semicolons
- Remove semicolons after package declarations and imports, no longer accepted in Java 21 as of JDK-8027682.
- org.openrewrite.java.migrate.RemovedSecurityManagerMethods
- Replace deprecated methods in
SecurityManager - Replace
SecurityManagermethodscheckAwtEventQueueAccess(),checkSystemClipboardAccess(),checkMemberAccess()andcheckTopLevelWindow()deprecated in Java SE 11 bycheckPermission(new java.security.AllPermission()).
- Replace deprecated methods in
- org.openrewrite.java.migrate.ReplaceAWTGetPeerMethod
- Replace AWT
getPeer()method - This recipe replaces the use of
getPeer()method injava.awt.*classes.component.getPeer() != nullis replaced withcomponent.isDisplayable()andcomponent.getPeer() instanceof LightweightPeeris replaced withcomponent.isLightweight().
- Replace AWT
- org.openrewrite.java.migrate.ReplaceComSunAWTUtilitiesMethods
- Replace
com.sun.awt.AWTUtilitiesstatic method invocations - This recipe replaces several static calls in
com.sun.awt.AWTUtilitieswith the JavaSE 11 equivalent. The methods replaced areAWTUtilities.isTranslucencySupported(),AWTUtilities.setWindowOpacity(),AWTUtilities.getWindowOpacity(),AWTUtilities.getWindowShape(),AWTUtilities.isWindowOpaque(),AWTUtilities.isTranslucencyCapable()andAWTUtilities.setComponentMixingCutoutShape().
- Replace
- org.openrewrite.java.migrate.ReplaceLocalizedStreamMethods
- Replace
getLocalizedInputStreamandgetLocalizedOutputStreamwith direct assignment - Replaces
Runtime.getLocalizedInputStream(InputStream)andRuntime.getLocalizedOutputStream(OutputStream)with their direct arguments. This modification is made because the previous implementation ofgetLocalizedInputStreamandgetLocalizedOutputStreammerely returned the arguments provided.
- Replace
- org.openrewrite.java.migrate.ReplaceStringLiteralValue
- Replace
Stringliteral - Replace the value of a complete
Stringliteral.
- Replace
- org.openrewrite.java.migrate.UpdateSdkMan
- Update SDKMan Java version
- Update the SDKMAN JDK version in the
.sdkmanrcfile. Given a major release (e.g., 17), the recipe will update the current distribution to the current default SDKMAN version of the specified major release. The distribution option can be used to specify a specific JVM distribution. Note that these must correspond to valid SDKMAN distributions.
- org.openrewrite.java.migrate.UpgradeJavaVersion
- Upgrade Java version
- Upgrade build plugin configuration to use the specified Java version. This recipe changes
java.toolchain.languageVersioninbuild.gradle(.kts)of gradle projects, or maven-compiler-plugin target version and related settings. Will not downgrade if the version is newer than the specified version.
- org.openrewrite.java.migrate.UseJavaUtilBase64
- Prefer
java.util.Base64instead ofsun.misc - Prefer
java.util.Base64instead of usingsun.miscin Java 8 or higher.sun.miscis not exported by the Java module system and accessing this class will result in a warning in Java 11 and an error in Java 17.
- Prefer
- org.openrewrite.java.migrate.UseTabsOrSpaces
- Force indentation to either tabs or spaces
- This is useful for one-off migrations of a codebase that has mixed indentation styles, while preserving all other auto-detected formatting rules.
- org.openrewrite.java.migrate.guava.NoGuavaAtomicsNewReference
- Prefer
new AtomicReference<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaCollections2Transform
- Prefer
Collection.stream().map(Function)overCollections2.transform - Prefer
Collection.stream().map(Function)overCollections2.transform(Collection, Function).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaCreateTempDir
- Prefer
Files#createTempDirectory() - Replaces Guava
Files#createTempDir()with JavaFiles#createTempDirectory(..). Transformations are limited to scopes throwing or catchingjava.io.IOException.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaDirectExecutor
- Prefer
Runnable::run Executoris a SAM-compatible interface, soRunnable::runis just as succinct asMoreExecutors.directExecutor()but without the third-party library requirement.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaFunctionsCompose
- Prefer
Function.compose(Function) - Prefer
Function.compose(Function)overFunctions.compose(Function, Function).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaImmutableListOf
- Prefer
List.of(..)in Java 9 or higher - Replaces
.common.collect.ImmutableList.of(..)if the returned type is immediately down-cast.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaImmutableMapOf
- Prefer
Map.of(..)in Java 9 or higher - Replaces
.common.collect.ImmutableMap.of(..)if the returned type is immediately down-cast.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaImmutableSetOf
- Prefer
Set.of(..)in Java 9 or higher - Replaces
.common.collect.ImmutableSet.of(..)if the returned type is immediately down-cast.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaIterablesAll
- Prefer
Collection.stream().allMatch(Predicate) - Prefer
Collection.stream().allMatch(Predicate)overIterables.all(Collection, Predicate).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaIterablesAnyFilter
- Prefer
Collection.stream().anyMatch(Predicate) - Prefer
Collection.stream().anyMatch(Predicate)overIterables.any(Collection, Predicate).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaIterablesTransform
- Prefer
Collection.stream().map(Function)overIterables.transform - Prefer
Collection.stream().map(Function)overIterables.transform(Collection, Function).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaListsNewArrayList
- Prefer
new ArrayList<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaListsNewCopyOnWriteArrayList
- Prefer
new CopyOnWriteArrayList<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaListsNewLinkedList
- Prefer
new LinkedList<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaMapsNewHashMap
- Prefer
new HashMap<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaMapsNewLinkedHashMap
- Prefer
new LinkedHashMap<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaMapsNewTreeMap
- Prefer
new TreeMap<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaOptionalAsSet
- Prefer
Optional.stream().collect(Collectors.toSet()) - Prefer
Optional.stream().collect(Collectors.toSet())overOptional.asSet().
- Prefer
- 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.
- Replace
- org.openrewrite.java.migrate.guava.NoGuavaOptionalToJavaUtil
- Remove
com.google.common.base.Optional#toJavaUtil() - Remove calls to
com.google.common.base.Optional#toJavaUtil().
- Remove
- org.openrewrite.java.migrate.guava.NoGuavaPredicate
- Change Guava's
Predicateintojava.util.function.Predicatewhere possible - Change the type only where no methods are used that explicitly require a Guava
Predicate.
- Change Guava's
- org.openrewrite.java.migrate.guava.NoGuavaPredicatesAndOr
- Prefer
Predicate.and(Predicate) - Prefer
Predicate.and(Predicate)overPredicates.and(Predicate, Predicate).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaPredicatesEqualTo
- Prefer
Predicate.isEqual(Object) - Prefer
Predicate.isEqual(Object)overPredicates.equalTo(Object).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaPredicatesInstanceOf
- Prefer
A.class::isInstance - Prefer
A.class::isInstanceoverPredicates.instanceOf(A.class).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaPrimitiveAsList
- Prefer
Arrays.asList(..)over Guava primitives - Migrate from Guava
com.google.common.primitives.* asList(..)toArrays.asList(..).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaRefasterRecipes
- Refaster style Guava to Java migration recipes
- Recipes that migrate from Guava to Java, using Refaster style templates for cases beyond what declarative recipes can cover.
- org.openrewrite.java.migrate.guava.NoGuavaRefasterRecipes$PreconditionsCheckNotNullToObjectsRequireNonNullRecipe
Preconditions.checkNotNulltoObjects.requireNonNull- Migrate from Guava
Preconditions.checkNotNullto Java 8java.util.Objects.requireNonNull.
- org.openrewrite.java.migrate.guava.NoGuavaRefasterRecipes$PreconditionsCheckNotNullWithMessageToObjectsRequireNonNullMessageTypeObjectRecipe
Preconditions.checkNotNullwithObjectmessage toObjects.requireNonNullwithString.valueOf- Migrate from Guava
Preconditions.checkNotNullto Java 8java.util.Objects.requireNonNull.
- org.openrewrite.java.migrate.guava.NoGuavaRefasterRecipes$PreconditionsCheckNotNullWithMessageToObjectsRequireNonNullRecipe
Preconditions.checkNotNullwithStringmessage toObjects.requireNonNull- Migrate from Guava
Preconditions.checkNotNullto Java 8java.util.Objects.requireNonNull.
- org.openrewrite.java.migrate.guava.NoGuavaSetsFilter
- Prefer
Collection.stream().filter(Predicate) - Prefer
Collection.stream().filter(Predicate)overSets.filter(Set, Predicate).
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaSetsNewConcurrentHashSet
- Prefer
new ConcurrentHashMap<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaSetsNewHashSet
- Prefer
new HashSet<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoGuavaSetsNewLinkedHashSet
- Prefer
new LinkedHashSet<>() - Prefer the Java standard library over third-party usage of Guava in simple cases like this.
- Prefer
- org.openrewrite.java.migrate.guava.NoMapsAndSetsWithExpectedSize
- Prefer JDK methods for Maps and Sets of an expected size
- Prefer Java 19+ methods to create Maps and Sets of an expected size instead of using Guava methods.
- org.openrewrite.java.migrate.guava.PreferJavaStringJoin
- Prefer
String#join()over GuavaJoiner#join() - Replaces supported calls to
com.google.common.base.Joiner#join()withjava.lang.String#join().
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilOptionalOrElseNull
- Prefer
java.util.Optional#orElse(null)overcom.google.common.base.Optional#orNull() - Replaces
com.google.common.base.Optional#orNull()withjava.util.Optional#orElse(null).
- Prefer
- 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).
- Prefer
- org.openrewrite.java.migrate.io.AddInputStreamBulkReadMethod
- Add bulk read method to
InputStreamimplementations - Adds a
read(byte[], int, int)method toInputStreamsubclasses that only override the single-byteread()method. Java's defaultInputStream.read(byte[], int, int)implementation calls the single-byteread()method in a loop, which can cause severe performance degradation (up to 350x slower) for bulk reads. This recipe detectsInputStreamimplementations that delegate to another stream and adds the missing bulk read method to delegate bulk reads as well.
- Add bulk read method to
- org.openrewrite.java.migrate.io.ReplaceFileInOrOutputStreamFinalizeWithClose
- Replace invocations of
finalize()onFileInputStreamandFileOutputStreamwithclose() - Replace invocations of the deprecated
finalize()method onFileInputStreamandFileOutputStreamwithclose().
- Replace invocations of
- org.openrewrite.java.migrate.io.ReplaceSystemOutWithIOPrint
- Migrate
System.out.printto Java 25 IO utility class - Replace
System.out.print(),System.out.println()withIO.print()andIO.println(). Migrates to the new IO utility class introduced in Java 25.
- Migrate
- org.openrewrite.java.migrate.jakarta.ApplicationPathWildcardNoLongerAccepted
- Remove trailing slash from
jakarta.ws.rs.ApplicationPathvalues - Remove trailing
/*fromjakarta.ws.rs.ApplicationPathvalues.
- Remove trailing slash from
- org.openrewrite.java.migrate.jakarta.HasNoJakartaAnnotations
- Project has no Jakarta annotations
- Mark all source as found per
JavaProjectwhere no Jakarta annotations are found. This is useful mostly as a precondition for recipes that require Jakarta annotations to be present.
- org.openrewrite.java.migrate.jakarta.RemoveBeanIsNullable
- Remove
Bean.isNullable() Bean.isNullable()has been removed in CDI 4.0.0, and now always returnsfalse.
- Remove
- org.openrewrite.java.migrate.jakarta.UpdateAddAnnotatedTypes
- Replace
BeforeBeanDiscovery.addAnnotatedType(AnnotatedType)withaddAnnotatedType(AnnotatedType, String) BeforeBeanDiscovery.addAnnotatedType(AnnotatedType)is deprecated in CDI 1.1. It is Replaced byBeforeBeanDiscovery.addAnnotatedType(AnnotatedType, String).
- Replace
- org.openrewrite.java.migrate.jakarta.UpdateAnnotationAttributeJavaxToJakarta
- Update annotation attributes using
javaxtojakarta - Replace
javaxwithjakartain annotation attributes for matching annotation signatures.
- Update annotation attributes using
- org.openrewrite.java.migrate.jakarta.UpdateBeanManagerMethods
- Update
fireEvent()andcreateInjectionTarget()calls - Updates
BeanManager.fireEvent()orBeanManager.createInjectionTarget().
- Update
- org.openrewrite.java.migrate.jakarta.UpdateGetRealPath
- Updates
getRealPath()to callgetContext()followed bygetRealPath() - Updates
getRealPath()forjakarta.servlet.ServletRequestandjakarta.servlet.ServletRequestWrapperto useServletContext.getRealPath(String).
- Updates
- org.openrewrite.java.migrate.jakarta.UpdateManagedBeanToNamed
- Update Faces
@ManagedBeanto use CDI@Named - Faces ManagedBean was deprecated in JSF 2.3 (EE8) and removed in Jakarta Faces 4.0 (EE10). Replace
@ManagedBeanwith@Namedfor CDI-based bean management.
- Update Faces
- org.openrewrite.java.migrate.javax.AddColumnAnnotation
@ElementCollectionannotations must be accompanied by a defined@Columnannotation- When an attribute is annotated with
@ElementCollection, a separate table is created for the attribute that includes the attribute ID and value. In OpenJPA, the column for the annotated attribute is named element, whereas EclipseLink names the column based on the name of the attribute. To remain compatible with tables that were created with OpenJPA, add a@Columnannotation with the name attribute set to element.
- org.openrewrite.java.migrate.javax.AddDefaultConstructorToEntityClass
@Entityobjects with constructors must also have a default constructor- When a Java Persistence API (JPA) entity class has a constructor with arguments, the class must also have a default, no-argument constructor. The OpenJPA implementation automatically generates the no-argument constructor, but the EclipseLink implementation does not.
- 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+testImplementationand Mavenprovidedscope, to any project that has a transitive dependency on the JAXB API. The resulting dependencies still use thejavaxnamespace, 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+testImplementationand Mavenprovidedscope, to any project that has a transitive dependency on the JAX-WS API. The resulting dependencies still use thejavaxnamespace, despite the move to the Jakarta artifact.
- org.openrewrite.java.migrate.javax.AddJaxwsRuntime$AddJaxwsRuntimeGradle
- Use the latest JAX-WS API and runtime for Jakarta EE 8
- Update Gradle 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
compileOnly+testImplementationconfigurations, to any project that has a transitive dependency on the JAX-WS API. The resulting dependencies still use thejavaxnamespace, despite the move to the Jakarta artifact.
- org.openrewrite.java.migrate.javax.AddJaxwsRuntime$AddJaxwsRuntimeMaven
- Use the latest JAX-WS API and runtime for Jakarta EE 8
- Update maven 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
providedscope, to any project that has a transitive dependency on the JAX-WS API. The resulting dependencies still use thejavaxnamespace, despite the move to the Jakarta artifact.
- org.openrewrite.java.migrate.javax.AddScopeToInjectedClass
- Add scope annotation to injected classes
- Finds member variables annotated with
@Inject' and applies@Dependent` scope annotation to the variable's type.
- org.openrewrite.java.migrate.javax.AddTableGenerator
- Attributes with automatically generated values require configuration
- Adds missing
@TableGeneratorannotation and updates the@GeneratedValueannotation values when it uses automatically generated values.
- org.openrewrite.java.migrate.javax.AddTransientAnnotationToCollections
- Unannotated collection attributes require a Transient annotation
- In OpenJPA, attributes that inherit from the
java.util.Collection<E>interface are not a default persistent type, so these attributes are not persisted unless they are annotated. EclipseLink has a different default behavior and attempts to persist these attributes to the database. To keep the OpenJPA behavior of ignoring unannotated collection attributes, add thejavax.persistence.Transientannotation to these attributes in EclipseLink.
- org.openrewrite.java.migrate.javax.AddTransientAnnotationToEntity
- Unannotated entity attributes require a Transient annotation
- In OpenJPA, attributes that are themselves entity classes are not persisted by default. EclipseLink has a different default behavior and tries to persist these attributes to the database. To keep the OpenJPA behavior of ignoring unannotated entity attributes, add the
javax.persistence.Transientannotation to these attributes in EclipseLink.
- org.openrewrite.java.migrate.javax.AddTransientAnnotationToPrivateAccessor
- Private accessor methods must have a
@Transientannotation - According to the JPA 2.1 specification, when property access is used, the property accessor methods must be public or protected. OpenJPA ignores any private accessor methods, whereas EclipseLink persists those attributes. To ignore private accessor methods in EclipseLink, the methods must have a
@Transientannotation.
- Private accessor methods must have a
- org.openrewrite.java.migrate.javax.HttpSessionInvalidate
- Use HttpServletRequest
logoutmethod for programmatic security logout in Servlet 3.0 - Do not rely on HttpSession
invalidatemethod for programmatic security logout. Add the HttpServletRequestlogoutmethod which was introduced in Java EE 6 as part of the Servlet 3.0 specification.
- Use HttpServletRequest
- org.openrewrite.java.migrate.javax.RemoveEmbeddableId
@Embeddableclasses cannot have an@Idannotation when referenced by an@EmbeddedIdannotation- According to the Java Persistence API (JPA) specification, if an entity defines an attribute with an
@EmbeddedIdannotation, the embeddable class cannot contain an attribute with an@Idannotation. If both the@EmbeddedIdannotation and the@Idannotation are defined, OpenJPA ignores the@Idannotation, whereas EclipseLink throws an exception.
- org.openrewrite.java.migrate.javax.RemoveTemporalAnnotation
- Remove the
@Temporalannotation for somejava.sqlattributes - OpenJPA persists the fields of attributes of type
java.sql.Date,java.sql.Time, orjava.sql.Timestampthat have ajavax.persistence.Temporalannotation, whereas EclipseLink throws an exception. Remove the@Temporalannotation so the behavior in EclipseLink will match the behavior in OpenJPA.
- Remove the
- org.openrewrite.java.migrate.javax.UseJoinColumnForMapping
@JoinColumnannotations must be used with relationship mappings- In OpenJPA, when a relationship attribute has either a
@OneToOneor a@ManyToOneannotation with a@Columnannotation, the@Columnannotation is treated as a@JoinColumnannotation. EclipseLink throws an exception that indicates that the entity class must use@JoinColumninstead of@Columnto map a relationship attribute.
- org.openrewrite.java.migrate.lang.ExplicitRecordImport
- Add explicit import for
Recordclasses - Add explicit import for
Recordclasses when upgrading past Java 14+, to avoid conflicts withjava.lang.Record.
- Add explicit import for
- org.openrewrite.java.migrate.lang.IfElseIfConstructToSwitch
- If-else-if-else to switch
- Replace if-else-if-else with switch statements. In order to be replaced with a switch, all conditions must be on the same variable and there must be at least three cases.
- org.openrewrite.java.migrate.lang.MigrateClassLoaderDefineClass
- Use
ClassLoader#defineClass(String, byte[], int, int) - Use
ClassLoader#defineClass(String, byte[], int, int)instead of the deprecatedClassLoader#defineClass(byte[], int, int)in Java 1.1 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateClassNewInstanceToGetDeclaredConstructorNewInstance
- Use
Class#getDeclaredConstructor().newInstance() - Use
Class#getDeclaredConstructor().newInstance()instead of the deprecatedClass#newInstance()in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateMainMethodToInstanceMain
- Migrate
public static void main(String[] args)to instancevoid main() - Migrate
public static void main(String[] args)method to instancevoid main()method when theargsparameter is unused, as supported by JEP 512 in Java 25+.
- Migrate
- org.openrewrite.java.migrate.lang.MigrateProcessWaitForDuration
- Use
Process#waitFor(Duration) - Use
Process#waitFor(Duration)instead ofProcess#waitFor(long, TimeUnit)in Java 25 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateSecurityManagerMulticast
- Use
SecurityManager#checkMulticast(InetAddress) - Use
SecurityManager#checkMulticast(InetAddress)instead of the deprecatedSecurityManager#checkMulticast(InetAddress, byte)in Java 1.4 or higher.
- Use
- org.openrewrite.java.migrate.lang.NullCheckAsSwitchCase
- Add null check to existing switch cases
- In later Java 21+, null checks are valid in switch cases. This recipe will only add null checks to existing switch cases if there are no other statements in between them or if the block in the if statement is not impacting the flow of the switch.
- org.openrewrite.java.migrate.lang.RefineSwitchCases
- Use switch cases refinement when possible
- Use guarded switch case labels and guards if all the statements in the switch block do if/else if/else on the guarded label.
- org.openrewrite.java.migrate.lang.ReplaceUnusedVariablesWithUnderscore
- Replace unused variables with underscore
- Replace unused variable declarations with underscore (_) for Java 22+. This includes unused variables in enhanced for loops, catch blocks, and lambda parameters where the variable is never referenced.
- org.openrewrite.java.migrate.lang.StringFormatted
- Prefer
String.formatted(Object...) - Prefer
String.formatted(Object...)overString.format(String, Object...)in Java 17 or higher.
- Prefer
- org.openrewrite.java.migrate.lang.StringRulesRecipes
- A collection of
Stringrules - A collection of rules for refactoring methods called on
Stringinstances in Java code.
- A collection of
- org.openrewrite.java.migrate.lang.StringRulesRecipes$IndexOfCharRecipe
- Replace
String.indexOf(char, 0)withString.indexOf(char) - Replace
String.indexOf(char ch, int fromIndex)withString.indexOf(char).
- Replace
- org.openrewrite.java.migrate.lang.StringRulesRecipes$IndexOfStringRecipe
- Replace
String.indexOf(String, 0)withString.indexOf(String) - Replace
String.indexOf(String str, int fromIndex)withString.indexOf(String).
- Replace
- org.openrewrite.java.migrate.lang.StringRulesRecipes$RedundantCallRecipe
- Replace redundant
Stringmethod calls with self - Replace redundant
substring(..)andtoString()method calls with theStringself.
- Replace redundant
- org.openrewrite.java.migrate.lang.StringRulesRecipes$UseEqualsIgnoreCaseRecipe
- Replace lower and upper case
Stringcomparisons withString.equalsIgnoreCase(String) - Replace
Stringequality comparisons involving.toLowerCase()or.toUpperCase()withString.equalsIgnoreCase(String anotherString).
- Replace lower and upper case
- org.openrewrite.java.migrate.lang.SwitchCaseAssignmentsToSwitchExpression
- Convert assigning Switch statements to Switch expressions
- Switch statements for which each case is assigning a value to the same variable can be converted to a switch expression that returns the value of the variable. This recipe is only applicable for Java 21 and later.
- org.openrewrite.java.migrate.lang.SwitchCaseEnumGuardToLabel
- Use switch cases labels for enums
- Use switch case labels when a guard is checking equality with an enum.
- org.openrewrite.java.migrate.lang.SwitchCaseReturnsToSwitchExpression
- Convert switch cases where every case returns into a returned switch expression
- Switch statements where each case returns a value can be converted to a switch expression that returns the value directly. This recipe is only applicable for Java 21 and later.
- org.openrewrite.java.migrate.lang.SwitchExpressionYieldToArrow
- Convert switch expression yield to arrow
- Convert switch expressions with colon cases and yield statements to arrow syntax. This recipe is only applicable for Java 21 and later.
- org.openrewrite.java.migrate.lang.ThreadStopUnsupported
- Replace
Thread.resume(),Thread.stop(), andThread.suspend()withthrow new UnsupportedOperationException() Thread.resume(),Thread.stop(), andThread.suspend()always throws anew UnsupportedOperationExceptionin Java 21+. This recipe makes that explicit, as the migration is more complicated. See https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html .
- Replace
- org.openrewrite.java.migrate.lang.UseStringIsEmptyRecipe
- Replace
0 < s.length()with!s.isEmpty() - Replace
0 < s.length()ands.length() != 0with!s.isEmpty().
- Replace
- org.openrewrite.java.migrate.lang.UseTextBlocks
- Use text blocks
- Text blocks are easier to read than concatenated strings.
- org.openrewrite.java.migrate.lang.var.UseVarForGenericMethodInvocations
- Apply
varto generic method invocations - Apply
varto variables initialized by invocations of generic methods. This recipe ignores generic factory methods without parameters, because open rewrite cannot handle them correctly ATM.
- Apply
- org.openrewrite.java.migrate.lang.var.UseVarForGenericsConstructors
- Apply
varto Generic Constructors - Apply
varto generics variables initialized by constructor calls.
- Apply
- org.openrewrite.java.migrate.lang.var.UseVarForObject
- Use
varfor reference-typed variables - Try to apply local variable type inference
varto variables containing Objects where possible. This recipe will not touch variable declarations with generics or initializers containing ternary operators.
- Use
- org.openrewrite.java.migrate.lang.var.UseVarForPrimitive
- Use
varfor primitive-typed variables - Try to apply local variable type inference
varto primitive variables where possible. This recipe will not touch variable declarations with initializers containing ternary operators.
- Use
- org.openrewrite.java.migrate.logging.MigrateGetLoggingMXBeanToGetPlatformMXBean
- Use
ManagementFactory#getPlatformMXBean(PlatformLoggingMXBean.class) - Use
ManagementFactory#getPlatformMXBean(PlatformLoggingMXBean.class)instead of the deprecatedLogManager#getLoggingMXBean()in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.logging.MigrateLogRecordSetMillisToSetInstant
- Use
LogRecord#setInstant(Instant) - Use
LogRecord#setInstant(Instant)instead of the deprecatedLogRecord#setMillis(long)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.logging.MigrateLoggerGlobalToGetGlobal
- Use
Logger#getGlobal() - The preferred way to get the global logger object is via the call
Logger#getGlobal()over direct field access tojava.util.logging.Logger.global.
- Use
- org.openrewrite.java.migrate.logging.MigrateLoggerLogrbToUseResourceBundle
- Use
Logger#logrb(.., ResourceBundle bundleName, ..) - Use
Logger#logrb(.., ResourceBundle bundleName, ..)instead of the deprecatedjava.util.logging.Logger#logrb(.., String bundleName, ..)in Java 8 or higher.
- Use
- org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames
- Rename getter methods to fit Lombok
- Rename methods that are effectively getter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same getter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() { return ba; } int getBa() { return foo; }stays as it is.
- org.openrewrite.java.migrate.lombok.AdoptLombokSetterMethodNames
- Rename setter methods to fit Lombok
- Rename methods that are effectively setter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same setter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() { return ba; } int getBa() { return foo; }stays as it is.
- org.openrewrite.java.migrate.lombok.LombokOnXToOnX_
- Migrate Lombok's
@__syntax toonX_for Java 8+ - Migrates Lombok's
onXannotations from the Java 7 style using@__to the Java 8+ style usingonX_. For example,@Getter(onMethod=@__({@Id}))becomes@Getter(onMethod_={@Id}).
- Migrate Lombok's
- org.openrewrite.java.migrate.lombok.LombokValToFinalVar
- Prefer
final varoverlombok.val - Prefer the Java standard library's
final varandvarover third-party usage of Lombok'slombok.valandlombok.varin Java 10 or higher.
- Prefer
- org.openrewrite.java.migrate.lombok.LombokValueToRecord
- Convert
@lombok.Valueclass to Record - Convert Lombok
@Valueannotated classes to standard Java Records.
- Convert
- org.openrewrite.java.migrate.lombok.UseLombokGetter
- Convert getter methods to annotations
- Convert trivial getter methods to
@Getterannotations on their respective fields.
- org.openrewrite.java.migrate.lombok.UseLombokSetter
- Convert setter methods to annotations
- Convert trivial setter methods to
@Setterannotations on their respective fields.
- org.openrewrite.java.migrate.lombok.UseNoArgsConstructor
- Use
@NoArgsConstructorwhere applicable - Prefer the Lombok
@NoArgsConstructorannotation over explicitly written out constructors.
- Use
- org.openrewrite.java.migrate.lombok.log.UseCommonsLog
- Use
@CommonsLoginstead of explicit fields - Prefer the lombok annotation
@CommonsLogover explicitly written outorg.apache.commons.logging.Logfields.
- Use
- org.openrewrite.java.migrate.lombok.log.UseJBossLog
- Use
@JBossLoginstead of explicit fields - Prefer the lombok annotation
@JBossLogover explicitly written outorg.jboss.logging.Loggerfields.
- Use
- org.openrewrite.java.migrate.lombok.log.UseLog
- Use
@Loginstead of explicit fields - Prefer the lombok annotation
@Logover explicitly written outjava.util.logging.Loggerfields.
- Use
- org.openrewrite.java.migrate.lombok.log.UseLog4j2
- Use
@Log4j2instead of explicit fields - Prefer the lombok annotation
@Log4j2over explicitly written outorg.apache.logging.log4j.Loggerfields.
- Use
- org.openrewrite.java.migrate.lombok.log.UseSlf4j
- Use
@Slf4instead of explicit fields - Prefer the lombok annotation
@Slf4over explicitly written outorg.slf4j.Loggerfields.
- Use
- org.openrewrite.java.migrate.maven.UpdateMavenProjectPropertyJavaVersion
- Update Maven Java project properties
- The Java version is determined by several project properties, including: *
java.version*jdk.version*javaVersion*jdkVersion*maven.compiler.source*maven.compiler.target*maven.compiler.release*release.versionIf none of these properties are in use and the maven compiler plugin is not otherwise configured, adds themaven.compiler.releaseproperty.
- org.openrewrite.java.migrate.maven.UseMavenCompilerPluginReleaseConfiguration
- Use Maven compiler plugin release configuration
- Replaces any explicit
sourceortargetconfiguration (if present) on themaven-compiler-pluginwithrelease, and updates thereleasevalue if needed. Will not downgrade the Java version if the current version is higher.
- org.openrewrite.java.migrate.metrics.SimplifyMicrometerMeterTags
- Simplify Micrometer meter tags
- Use the simplest method to add new tags.
- org.openrewrite.java.migrate.net.MigrateHttpURLConnectionHttpServerErrorToHttpInternalError
- Use
java.net.HttpURLConnection.HTTP_INTERNAL_ERROR - Use
java.net.HttpURLConnection.HTTP_INTERNAL_ERRORinstead of the deprecatedjava.net.HttpURLConnection.HTTP_SERVER_ERROR.
- Use
- org.openrewrite.java.migrate.net.MigrateMulticastSocketSetTTLToSetTimeToLive
- Use
java.net.MulticastSocket#setTimeToLive(int) - Use
java.net.MulticastSocket#setTimeToLive(int)instead of the deprecatedjava.net.MulticastSocket#setTTL(byte)in Java 1.2 or higher.
- Use
- org.openrewrite.java.migrate.net.MigrateURLDecoderDecode
- Use
java.net.URLDecoder#decode(String, StandardCharsets.UTF_8) - Use
java.net.URLDecoder#decode(String, StandardCharsets.UTF_8)instead of the deprecatedjava.net.URLDecoder#decode(String)in Java 10 or higher.
- Use
- org.openrewrite.java.migrate.net.MigrateURLEncoderEncode
- Use
java.net.URLEncoder#encode(String, StandardCharsets.UTF_8) - Use
java.net.URLEncoder#encode(String, StandardCharsets.UTF_8)instead of the deprecatedjava.net.URLEncoder#encode(String)in Java 10 or higher.
- Use
- org.openrewrite.java.migrate.net.URLConstructorToURICreate
- Convert
new URL(String)toURI.create(String).toURL() - Converts
new URL(String)constructor toURI.create(String).toURL(). The URL constructor has been deprecated due to security vulnerabilities when handling malformed URLs. UsingURI.create(String)provides stronger validation and safer URL handling in modern Java applications.
- Convert
- org.openrewrite.java.migrate.net.URLConstructorsToNewURI
- Convert
new URL(String, ..)tonew URI(String, ..).toURL() - Converts
new URL(String, ..)constructors tonew URI(String, ..).toURL().
- Convert
- org.openrewrite.java.migrate.search.AboutJavaVersion
- Find which Java version is in use
- A diagnostic for studying the distribution of Java language version levels (both source and target compatibility across files and source sets).
- org.openrewrite.java.migrate.search.FindDataUsedOnDto
- Find data used on DTOs
- Find data elements used on DTOs. This is useful to provide information where data over-fetching may be a problem.
- org.openrewrite.java.migrate.search.FindDtoOverfetching
- Find methods that only use one DTO data element
- Find methods that have 'opportunities' for improvement.
- org.openrewrite.java.migrate.search.FindInternalJavaxApis
- Find uses of internal javax APIs
- The libraries that define these APIs will have to be migrated before any of the repositories that use them.
- org.openrewrite.java.migrate.search.FindJavaVersion
- Find Java versions in use
- Finds Java versions in use.
- org.openrewrite.java.migrate.search.PlanJavaMigration
- Plan a Java version migration
- Study the set of Java versions and associated tools in use across many repositories.
- org.openrewrite.java.migrate.sql.MigrateDriverManagerSetLogStream
- Use
DriverManager#setLogWriter(java.io.PrintWriter) - Use
DriverManager#setLogWriter(java.io.PrintWriter)instead of the deprecatedDriverManager#setLogStream(java.io.PrintStream)in Java 1.2 or higher.
- Use
- org.openrewrite.java.migrate.util.IteratorNext
- Replace
iterator().next()withgetFirst() - Replace
SequencedCollection.iterator().next()withgetFirst().
- Replace
- org.openrewrite.java.migrate.util.ListFirstAndLast
- Replace
List.get(int),add(int, Object), andremove(int)withSequencedCollection*Firstand*Lastmethods - Replace
list.get(0)withlist.getFirst(),list.get(list.size() - 1)withlist.getLast(), and similar foradd(int, E)andremove(int).
- Replace
- org.openrewrite.java.migrate.util.MigrateCollectionsSingletonList
- Prefer
List.of(..) - Prefer
List.of(..)instead of usingCollections.singletonList()in Java 9 or higher.
- Prefer
- org.openrewrite.java.migrate.util.MigrateCollectionsSingletonMap
- Prefer
Map.of(..) - Prefer
Map.of(..)instead of usingCollections.singletonMap()in Java 9 or higher.
- Prefer
- org.openrewrite.java.migrate.util.MigrateCollectionsSingletonSet
- Prefer
Set.of(..) - Prefer
Set.Of(..)instead of usingCollections.singleton()in Java 9 or higher.
- Prefer
- org.openrewrite.java.migrate.util.MigrateCollectionsUnmodifiableList
- Prefer
List.of(..) - Prefer
List.Of(..)instead of usingunmodifiableList(java.util.Arrays asList(<args>))in Java 9 or higher.
- Prefer
- org.openrewrite.java.migrate.util.MigrateCollectionsUnmodifiableSet
- Prefer
Set.of(..) - Prefer
Set.Of(..)instead of usingunmodifiableSet(java.util.Set(java.util.Arrays asList(<args>)))in Java 9 or higher.
- Prefer
- org.openrewrite.java.migrate.util.MigrateStringReaderToReaderOf
- Use
Reader.of(CharSequence)for non-synchronized readers - Migrate
new StringReader(String)toReader.of(CharSequence)in Java 25+. This only applies when assigning toReadervariables or returning from methods that returnReader. The new method creates non-synchronized readers which are more efficient when thread-safety is not required.
- Use
- org.openrewrite.java.migrate.util.OptionalNotEmptyToIsPresent
- Prefer
Optional.isPresent() - Prefer
Optional.isPresent()instead of using!Optional.isEmpty()in Java 11 or higher.
- Prefer
- org.openrewrite.java.migrate.util.OptionalNotPresentToIsEmpty
- Prefer
Optional.isEmpty() - Prefer
Optional.isEmpty()instead of using!Optional.isPresent()in Java 11 or higher.
- Prefer
- org.openrewrite.java.migrate.util.OptionalStreamRecipe
Stream<Optional>idiom recipe- Migrate Java 8
Optional<Stream>.filter(Optional::isPresent).map(Optional::get)to Java 11.flatMap(Optional::stream).
- org.openrewrite.java.migrate.util.RemoveFinalizerFromZip
- Remove invocations of deprecated invocations from Deflater, Inflater, ZipFile
- Remove invocations of finalize() deprecated invocations from Deflater, Inflater, ZipFile.
- org.openrewrite.java.migrate.util.ReplaceMathRandomWithThreadLocalRandomRecipe
- Replace
java.lang.Math random()withThreadLocalRandom nextDouble() - Replace
java.lang.Math random()withThreadLocalRandom nextDouble()to reduce contention.
- Replace
- org.openrewrite.java.migrate.util.ReplaceStreamCollectWithToList
- Replace
Stream.collect(Collectors.toUnmodifiableList())withStream.toList() - Replace
Stream.collect(Collectors.toUnmodifiableList())with Java 16+Stream.toList(). Also replacesStream.collect(Collectors.toList())ifconvertToListis set totrue.
- Replace
- org.openrewrite.java.migrate.util.StreamFindFirst
- Use
getFirst()instead ofstream().findFirst().orElseThrow() - For SequencedCollections, use
collection.getFirst()instead ofcollection.stream().findFirst().orElseThrow().
- Use
- org.openrewrite.java.migrate.util.UseEnumSetOf
- Prefer
EnumSet of(..) - Prefer
EnumSet of(..)instead of usingSet of(..)when the arguments are enums in Java 9 or higher.
- Prefer
- org.openrewrite.java.migrate.util.UseLocaleOf
- Prefer
Locale.of(..)overnew Locale(..) - Prefer
Locale.of(..)overnew Locale(..)in Java 19 or higher.
- Prefer
- org.openrewrite.java.migrate.util.UseMapOf
- Prefer
Map.of(..) - Prefer
Map.of(..)instead of usingjava.util.Map#put(..)in Java 10 or higher.
- Prefer
org.openrewrite.recipe:rewrite-netty
License: Apache License Version 2.0
4 recipes
- org.openrewrite.java.netty.EventLoopGroupToMultiThreadIoEventLoopGroupRecipes
- Replace all
EventLoopGroups withMultiThreadIoEventLoopGroup - Replaces Netty's
new *EventLoopGroupwithnew MultiThreadIoEventLoopGroup(*IoHandler.newFactory()).
- Replace all
- org.openrewrite.java.netty.EventLoopGroupToMultiThreadIoEventLoopGroupRecipes$EpollEventLoopGroupFactoryRecipe
- Replace
EpollEventLoopGroupwithMultiThreadIoEventLoopGroup - Replace
new EpollEventLoopGroup()withnew MultiThreadIoEventLoopGroup(EpollIoHandler.newFactory()).
- Replace
- org.openrewrite.java.netty.EventLoopGroupToMultiThreadIoEventLoopGroupRecipes$LocalEventLoopGroupFactoryRecipe
- Replace
LocalEventLoopGroupwithMultiThreadIoEventLoopGroup - Replace
new LocalEventLoopGroup()withnew MultiThreadIoEventLoopGroup(LocalIoHandler.newFactory()).
- Replace
- org.openrewrite.java.netty.EventLoopGroupToMultiThreadIoEventLoopGroupRecipes$NioEventLoopGroupFactoryRecipe
- Replace
NioEventLoopGroupwithMultiThreadIoEventLoopGroup - Replace
new NioEventLoopGroup()withnew MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()).
- Replace
org.openrewrite.recipe:rewrite-nodejs
License: Moderne Proprietary License
4 recipes
- org.openrewrite.nodejs.DependencyVulnerabilityCheck
- Find and fix vulnerable npm dependencies
- This software composition analysis (SCA) tool detects and upgrades dependencies with publicly disclosed vulnerabilities. This recipe both generates a report of vulnerable dependencies and upgrades to newer versions with fixes. This recipe only upgrades to the latest patch version. If a minor or major upgrade is required to reach the fixed version, this recipe will not make any changes. Vulnerability information comes from the GitHub Security Advisory Database, which aggregates vulnerability data from several public databases, including the National Vulnerability Database maintained by the United States government. Dependencies following Semantic Versioning will see their patch version updated where applicable.
- org.openrewrite.nodejs.UpgradeDependencyVersion
- Upgrade Node.js dependencies
- Upgrade matching Node.js direct dependencies.
- org.openrewrite.nodejs.search.DependencyInsight
- Node.js dependency insight
- Identify the direct and transitive Node.js dependencies used in a project.
- org.openrewrite.nodejs.search.FindNodeProjects
- Find Node.js projects
- Find Node.js projects and summarize data about them.
org.openrewrite.recipe:rewrite-openapi
License: Apache License Version 2.0
7 recipes
- org.openrewrite.openapi.swagger.ConvertApiResponseCodesToStrings
- Convert API response codes to strings
- Convert API response codes to strings.
- org.openrewrite.openapi.swagger.ConvertApiResponseToContent
- Convert API response to content annotation
- Add
content = @Content(mediaType = ...)andschemato@ApiResponse.
- org.openrewrite.openapi.swagger.MigrateApiImplicitParam
- Migrate
@ApiImplicitParamto@Parameter - Migrate
@ApiImplicitParamto@Parameter.
- Migrate
- org.openrewrite.openapi.swagger.MigrateApiModelToSchema
- Migrate from
@ApiModelto@Schema - Converts the
@ApiModelannotation to@Schemaand converts the "value" attribute to "name".
- Migrate from
- org.openrewrite.openapi.swagger.MigrateApiParamDefaultValue
- Migrate
@ApiParam(defaultValue)to@Parameter(schema) - Migrate
@ApiParam(defaultValue)to@Parameter(schema = @Schema(defaultValue)).
- Migrate
- org.openrewrite.openapi.swagger.MigrateApiToTag
- Migrate from
@Apito@Tag - Converts
@Apito@Tagannotation and converts the directly mappable attributes and removes the others.
- Migrate from
- org.openrewrite.openapi.swagger.MigrateSwaggerDefinitionToOpenAPIDefinition
- Migrate from
@SwaggerDefinitionto@OpenAPIDefinition - Migrate from
@SwaggerDefinitionto@OpenAPIDefinition.
- Migrate from
org.openrewrite.recipe:rewrite-quarkus
License: Apache License Version 2.0
17 recipes
- org.openrewrite.quarkus.AddQuarkusProperty
- Add a Quarkus configuration property
- Add a Quarkus configuration property to an existing configuration file if it does not already exist in that file.
- org.openrewrite.quarkus.ChangeQuarkusPropertyKey
- Change Quarkus configuration property key
- Change the key of a property in Quarkus configuration files.
- org.openrewrite.quarkus.ChangeQuarkusPropertyValue
- Change Quarkus configuration property value
- Change the value of a property in Quarkus configuration files.
- org.openrewrite.quarkus.ConfigPropertiesToConfigMapping
- Use
@ConfigMapping - Migrate Quarkus configuration classes annotated with
@ConfigPropertiesto the equivalent Smallrye@ConfigMapping.
- Use
- org.openrewrite.quarkus.ConfigureQuarkusMavenPluginWithReasonableDefaults
- Configure
quarkus-maven-pluginwith reasonable defaults - Configures the
quarkus-maven-pluginwith reasonable defaults, such as default activatedgoalsand<extensions>configuration.
- Configure
- org.openrewrite.quarkus.DeleteQuarkusProperty
- Delete Quarkus configuration property
- Delete a property from Quarkus configuration files.
- org.openrewrite.quarkus.MigrateQuarkusMavenPluginNativeImageGoal
- Use
nativeprofile inquarkus-maven-plugin - Migrates the
quarkus-maven-plugindeprecatednative-imagegoal. If thenative-imagegoal needs to be removed, this adds<quarkus.package.type>native</quarkus.package.type>to thenativeprofilepropertiessection, given thenativeprofile exists in thepom.xml.
- Use
- org.openrewrite.quarkus.MultiTransformHotStreamToMultiHotStream
- Use Mutiny
multi.toHotStream() - Replace Mutiny API usages of
multi.transform().toHotStream()withmulti.toHotStream().
- Use Mutiny
- org.openrewrite.quarkus.Slf4jToQuarkusLogger
- Migrate SLF4J Logger injection and usage to Quarkus static
Log - Removes usage of SLF4J Logger fields, adjusts imports, and replaces logger method calls with static Quarkus Log calls, including message formatting and method renaming for parameterized logging.
- Migrate SLF4J Logger injection and usage to Quarkus static
- org.openrewrite.quarkus.quarkus2.GrpcServiceAnnotationToGrpcClient
- Use
@GrpcClient - The
@GrpcServiceannotation is replaced with@GrpcClientin Quarkus 2.x. Removes the optional@GrpcClient.value()unless the service name is different from the name of annotated element.
- Use
- org.openrewrite.quarkus.quarkus2.RemoveAvroMavenPlugin
- Remove
avro-maven-plugin - Removes the
avro-maven-pluginif thequarkus-maven-pluginis found in the project'spom.xml. Avro has been integrated with the Quarkus code generation mechanism. This replaces the need to use the Avro plugin.
- Remove
- org.openrewrite.quarkus.quarkus2.UseIdentifierOnDefaultKafkaBroker
- Use
@Identifier("default-kafka-broker") - Use
@io.smallrye.common.annotation.Identifieron default kafka broker configuration.
- Use
- org.openrewrite.quarkus.quarkus2.UsePanacheEntityBaseStaticMethods
- Use
PanacheEntityBasestatic methods - The
getEntityManager()and theflush()methods ofPanacheEntityBaseare now static methods.
- Use
- org.openrewrite.quarkus.quarkus2.UsePanacheEntityBaseUniT
- Use
Uni<T extends PanacheEntityBase> - The
persist()andpersistAndFlush()methods now return anUni<T extends PanacheEntityBase>instead of anUni<Void>to allow chaining the methods.
- Use
- org.openrewrite.quarkus.quarkus2.UseReactivePanacheMongoEntityBaseUniT
- Use
Uni<T extends ReactivePanacheMongoEntityBase> - The
persist(),update(), andpersistOrUpdate()methods now return aUni<T extends ReactivePanacheMongoEntityBase>instead of aUni<Void>to allow chaining the methods.
- Use
- org.openrewrite.quarkus.search.FindQuarkusProfiles
- Search Quarkus profiles
- Search the properties for existing Quarkus profiles.
- org.openrewrite.quarkus.search.FindQuarkusProperties
- Find Quarkus property
- Finds occurrences of a Quarkus property key.
org.openrewrite.recipe:rewrite-reactive-streams
License: Moderne Proprietary License
23 recipes
- org.openrewrite.reactive.reactor.ReactorDoAfterSuccessOrErrorToTap
- Replace
doAfterSuccessOrErrorcalls withtapoperator - As of reactor-core 3.5 the
doAfterSuccessOrErrormethod is removed, this recipe replaces it with thetapoperator.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCacheToSinkRecipes
- Replace various
Processor.cachecalls with theirSinksequivalent - As of 3.5 Processors are deprecated and Sinks are preferred.
- Replace various
- org.openrewrite.reactive.reactor.ReactorProcessorCacheToSinkRecipes$ReplayProcessorCacheDefaultToSinkRecipe
- Replace
ReplayProcessor.cacheLast()withSinks.many().replay().latest() - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCacheToSinkRecipes$ReplayProcessorCacheToSinkRecipe
- Replace
ReplayProcessor.cacheLast()withSinks.many().replay().latest() - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes
- Replace various
Processor.createcalls with theirSinksequivalent - As of 3.5 Processors are deprecated and Sinks are preferred.
- Replace various
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$DirectProcessorCreateToSinkRecipe
- Replace
DirectProcessor.create()withSinks.many().multicast().directBestEffort() - As of 3.5 DirectProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$EmitterProcessorCreateBooleanToSinkRecipe
- Replace
EmitterProcessor.create(Boolean)withSinks.many().multicast().onBackpressureBuffer(Queues.SMALL_BUFFER_SIZE, Boolean) - As of 3.5 EmitterProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$EmitterProcessorCreateIntBooleanToSinkRecipe
- Replace
EmitterProcessor.create(int, Boolean)withSinks.many().multicast().onBackpressureBuffer(int, Boolean) - As of 3.5 EmitterProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$EmitterProcessorCreateIntToSinkRecipe
- Replace
EmitterProcessor.create(int)withSinks.many().multicast().onBackpressureBuffer(int) - As of 3.5 EmitterProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$EmitterProcessorCreateToSinkRecipe
- Replace
EmitterProcessor.create()withSinks.many().multicast().onBackpressureBuffer() - As of 3.5 EmitterProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$MonoProcessorCreateToSinkRecipe
- Replace
MonoProcessor.create()withSinks.one() - As of 3.5 MonoProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateIntLiteralFalseToSinkRecipe
- Replace
ReplayProcessor.create(int, false)withSinks.many().replay().limit(int) - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateIntLiteralTrueToSinkRecipe
- Replace
ReplayProcessor.create(int, true)withSinks.many().replay().all(int) - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateIntToSinkRecipe
- Replace
ReplayProcessor.create(int)withSinks.many().replay().limit(int) - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateSizeAndTimeoutSchedulerToSinkRecipe
- Replace
ReplayProcessor.createSizeAndTimeout(int, Duration, Scheduler)withSinks.many().replay().limit(int, Duration, Scheduler) - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateSizeAndTimeoutToSinkRecipe
- Replace
ReplayProcessor.createSizeAndTimeout(int, Duration)withSinks.many().replay().limit(int, duration) - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateTimeoutSchedulerToSinkRecipe
- Replace
ReplayProcessor.createTimeout(Duration, Scheduler)withSinks.many().replay().limit(Duration, Scheduler) - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateTimeoutToSinkRecipe
- Replace
ReplayProcessor.createTimeout(Duration)withSinks.many().replay().limit(duration) - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$ReplayProcessorCreateToSinkRecipe
- Replace
ReplayProcessor.create()withSinks.many().replay().all() - As of 3.5 ReplayProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$UnicastProcessorCreateQueueConsumerDisposableToSinkRecipe
- Replace
UnicastProcessor.create(Queue, Consumer, Disposable)withSinks.many().unicast().onBackpressureBuffer(Queue, Disposable) - As of 3.5 UnicastProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$UnicastProcessorCreateQueueDisposableToSinkRecipe
- Replace
UnicastProcessor.create(Queue, Disposable)withSinks.many().unicast().onBackpressureBuffer(Queue, Disposable) - As of 3.5 UnicastProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$UnicastProcessorCreateQueueToSinkRecipe
- Replace
UnicastProcessor.create(Queue)withSinks.many().unicast().onBackpressureBuffer(Queue) - As of 3.5 UnicastProcessor is deprecated and Sinks are preferred.
- Replace
- org.openrewrite.reactive.reactor.ReactorProcessorCreateToSinkRecipes$UnicastProcessorCreateToSinkRecipe
- Replace
UnicastProcessor.create()withSinks.many().unicast().onBackpressureBuffer() - As of 3.5 UnicastProcessor is deprecated and Sinks are preferred.
- Replace
org.openrewrite.recipe:rewrite-rewrite
License: Moderne Source Available License
20 recipes
- org.openrewrite.java.recipes.BlankLinesAroundFieldsWithAnnotations
- Add a blank line around fields with annotations
- Fields with annotations should have a blank line before them to clearly separate them from the field above. If another field follows, it should also have a blank line after so that the field with the annotation has space on either side of it, visually distinguishing it from its neighbors.
- org.openrewrite.java.recipes.CorrectlySpacedDescriptions
- Correctly spaced descriptions
- Recipe descriptions should be cleanly formatted. This recipe forces correct spacing in multiline descriptions. In a multi line description the lines should not start with whitespace and end with a single space except for the last line which should end with a "." (e.g.
return "This is a correct " + "multi line description";).
- org.openrewrite.java.recipes.ExamplesExtractor
- Extract documentation examples from tests
- Extract the before/after sources from tests annotated with
@DocumentExample, and generate a YAML file with those examples to be shown in the documentation to show usage.
- org.openrewrite.java.recipes.ExecutionContextParameterName
- Use a standard name for
ExecutionContext - Visitors that are parameterized with
ExecutionContextshould use the parameter namectx.
- Use a standard name for
- org.openrewrite.java.recipes.FindRecipes
- Find OpenRewrite recipes
- This recipe finds all OpenRewrite recipes, primarily to produce a data table that is being used to experiment with fine-tuning a large language model to produce more recipes.
- org.openrewrite.java.recipes.IsLiteralNullRecipe
- Refaster template
IsLiteralNull - Recipe created for the following Refaster template:
java public class IsLiteralNull { @BeforeTemplate boolean before(Expression expression) { return expression instanceof J.Literal && ((J.Literal)expression).getValue() == null; } @AfterTemplate boolean after(Expression expression) { return J.Literal.isLiteralValue(expression, null); } }.
- Refaster template
- org.openrewrite.java.recipes.MissingOptionExample
- Find missing
@Optionexamplevalues - Find
@Optionannotations that are missingexamplevalues for documentation.
- Find missing
- org.openrewrite.java.recipes.NoMutableStaticFieldsInRecipes
- Recipe classes should not have mutable
staticfields - Remove mutable static fields from Recipe classes to discourage their use.
- Recipe classes should not have mutable
- org.openrewrite.java.recipes.RecipeClassesShouldBePublic
- Recipe classes should be public
- Ensures that classes extending Recipe are declared as public for proper visibility and accessibility.
- org.openrewrite.java.recipes.RecipeEqualsAndHashCodeCallSuper
- Use of
@EqualsAndHashCodeonRecipe - Recipes are value objects, so should use
@EqualsAndHashCode(callSuper = false). While in most cases recipes do not extend other classes and so the option is moot, as a matter of stylistic consistency and to enforce the idea that recipes are value objects, this value should be set tofalse.
- Use of
- org.openrewrite.java.recipes.RemoveImportBeforeAddImport
- Reorder
maybeRemoveImportbeforemaybeAddImport - Reorders
maybeAddImportandmaybeRemoveImportcalls so that imports are removed before new imports are added. This ordering prevents potential conflicts when the import being added and the import being removed resolve to the same simple class name.
- Reorder
- org.openrewrite.java.recipes.ReorderTestMethods
- Show
@DocumentExamples first - Reorders
RewriteTestmethods to placedefaultsfirst, followed by any@DocumentExamples.
- Show
- org.openrewrite.java.recipes.ReplaceNullWithDoesNotExist
- Replace null with RewriteTest.doesNotExist()
- Replace the first or second
nullargument in OpenRewrite Assertions class methods withRewriteTest.doesNotExist().
- org.openrewrite.java.recipes.RewriteTestClassesShouldNotBePublic
- RewriteTest classes should not be public
- Remove the public modifier from classes that implement RewriteTest.
- org.openrewrite.java.recipes.SelectRecipeExamples
- Automatically select recipe examples from the unit test cases of a recipe
- Add
@DocumentExampleto the first non-issue and not a disabled unit test of a recipe as an example, if there are not any examples yet.
- org.openrewrite.java.recipes.SingleDocumentExample
- Single
@DocumentExampleper test class - Ensures there's only one
@DocumentExampleannotated@Testmethod per test class, as that looks best in our documentation.@ParameterizedTestmethods are not supported.
- Single
- org.openrewrite.java.recipes.SourceSpecTextBlockIndentation
- Minimal indentation for
SourceSpecstext blocks - Text blocks that assert before and after source code should have minimal indentation.
- Minimal indentation for
- org.openrewrite.java.recipes.SourceSpecTextBlockNewLine
- New line at the end of
SourceSpecstext blocks - Text blocks that assert before and after source code should have a new line after it is closed.
- New line at the end of
- org.openrewrite.java.recipes.UseRewriteTestDefaults
- Refactor RewriteTest to use defaults method
- When all
rewriteRunmethods in a test class use the same RecipeSpec configuration, refactor to use thedefaultsmethod instead.
- org.openrewrite.java.recipes.UseTreeRandomId
- Use
Tree.randomId()in LST constructors - Replaces occurrences of
UUID.randomUUID()withTree.randomId()when passed as an argument to a constructor call for LST elements.
- Use
org.openrewrite.recipe:rewrite-spring
License: Moderne Source Available License
137 recipes
- org.openrewrite.gradle.spring.AddSpringDependencyManagementPlugin
- Add
io.spring.dependency-managementplugin, if in use - Prior to Spring Boot 2.0 the dependency management plugin was applied automatically as part of the overall spring boot plugin. Afterwards the dependency-management plugin must be applied explicitly, or Gradle's
platform()feature may be used instead. This recipe makes usage of io-spring.dependency-management explicit in anticipation of upgrade to Spring Boot 2.0 or later.
- Add
- org.openrewrite.java.spring.AddSpringProperty
- Add a spring configuration property
- Add a spring configuration property to a configuration file if it does not already exist in that file.
- org.openrewrite.java.spring.ChangeMethodParameter
- Change parameter type for a method declaration
- Change parameter type for a method declaration, identified by a method pattern.
- org.openrewrite.java.spring.ChangeSpringPropertyKey
- Change the key of a Spring application property
- Change Spring application property keys existing in either Properties or YAML files, and in
@Value,@ConditionalOnPropertyor@SpringBootTestannotations.
- org.openrewrite.java.spring.ChangeSpringPropertyValue
- Change the value of a spring application property
- Change spring application property values existing in either Properties or Yaml files.
- org.openrewrite.java.spring.CommentOutSpringPropertyKey
- Comment out Spring properties
- Add comment to specified Spring properties, and comment out the property.
- org.openrewrite.java.spring.DeleteSpringProperty
- Delete a spring configuration property
- Delete a spring configuration property from any configuration file that contains a matching key.
- org.openrewrite.java.spring.ExpandProperties
- Expand Spring YAML properties
- Expand YAML properties to not use the dot syntax shortcut.
- org.openrewrite.java.spring.ImplicitWebAnnotationNames
- Remove implicit web annotation names
- Removes implicit web annotation names.
- org.openrewrite.java.spring.NoAutowiredOnConstructor
- Remove the
@Autowiredannotation on inferred constructor - Spring can infer an autowired constructor when there is a single constructor on the bean. This recipe removes unneeded
@Autowiredannotations on constructors.
- Remove the
- org.openrewrite.java.spring.NoRepoAnnotationOnRepoInterface
- Remove unnecessary
@Repositoryannotation from Spring DataRepositorysub-interface - Removes superfluous
@Repositoryannotation from Spring DataRepositorysub-interfaces.
- Remove unnecessary
- org.openrewrite.java.spring.NoRequestMappingAnnotation
- Remove
@RequestMappingannotations - Replace method declaration
@RequestMappingannotations with@GetMapping,@PostMapping, etc. when possible.
- Remove
- org.openrewrite.java.spring.PropertiesToKebabCaseProperties
- Normalize Spring
application*.propertiesproperties to kebab-case - Normalize Spring
application*.propertiesproperties to kebab-case.
- Normalize Spring
- org.openrewrite.java.spring.PropertiesToKebabCaseYaml
- Normalize Spring
application*.{yml,yaml}properties to kebab-case - Normalize Spring
application*.{yml,yaml}properties to kebab-case.
- Normalize Spring
- org.openrewrite.java.spring.RenameBean
- Rename bean
- Renames a Spring bean, both declaration and references.
- org.openrewrite.java.spring.SeparateApplicationPropertiesByProfile
- Separate
application.propertiesby profile - Separating
application.propertiesinto separate files based on profiles.
- Separate
- org.openrewrite.java.spring.SeparateApplicationYamlByProfile
- Separate application YAML by profile
- The Spring team's recommendation is to separate profile properties into their own YAML files now.
- org.openrewrite.java.spring.UpdateApiManifest
- Update the API manifest
- Keep a consolidated manifest of the API endpoints that this application exposes up-to-date.
- org.openrewrite.java.spring.amqp.UseTlsAmqpConnectionString
- Use TLS for AMQP connection strings
- Use TLS for AMQP connection strings.
- org.openrewrite.java.spring.batch.ConvertReceiveTypeWhenCallStepExecutionMethod
- Convert receive type in some invocation of StepExecution.xx()
- Convert receive type in some invocation of StepExecution.xx().
- org.openrewrite.java.spring.batch.JobParameterToString
- Migration invocation of JobParameter.toString to JobParameter.getValue.toString
- JobParameter.toString() logic is quite different in spring batch 5, need take JobParameter.getValue.toString replace the JobParameter.toString.
- org.openrewrite.java.spring.batch.MigrateItemWriterWrite
- Migrate
ItemWriter - In
ItemWriterthe signature of thewrite()method has changed in spring-batch 5.x.
- Migrate
- org.openrewrite.java.spring.batch.MigrateJobBuilderFactory
- Migrate
JobBuilderFactorytoJobBuilder JobBuilderFactorywas deprecated in spring-batch 5.x. It is replaced byJobBuilder.
- Migrate
- org.openrewrite.java.spring.batch.MigrateJobParameter
- Add class argument to
JobParameters - Migration Job Parameter, parameterized type is essential in Spring Batch 5.
- Add class argument to
- org.openrewrite.java.spring.batch.MigrateMethodAnnotatedByBatchAPI
- Migrate method when it annotated by Spring Batch API
- Migrate method when it annotated by Spring Batch API.
- org.openrewrite.java.spring.batch.MigrateStepBuilderFactory
- Migrate
StepBuilderFactorytoStepBuilder StepBuilderFactorywas deprecated in spring-batch 5.x. It is replaced byStepBuilder.
- Migrate
- org.openrewrite.java.spring.batch.RemoveDefaultBatchConfigurer
- Remove
DefaultBatchConfigurer - Remove
extends DefaultBatchConfigurerand@Overridefrom associated methods.
- Remove
- org.openrewrite.java.spring.batch.ReplaceSupportClassWithItsInterface
- Transform classes that extend a given Class to implement the given Interface instead
- As of spring-batch 5.x Listeners has default methods (made possible by a Java 8 baseline) and can be implemented directly without the need for this adapter.
- org.openrewrite.java.spring.boot2.AddConfigurationAnnotationIfBeansPresent
- Add missing
@Configurationannotation - Class having
@Beanannotation over any methods but missing@Configurationannotation over the declaring class would have@Configurationannotation added.
- Add missing
- org.openrewrite.java.spring.boot2.ChangeEmbeddedServletContainerCustomizer
- Adjust configuration classes to use the
WebServerFactoryCustomizerinterface - Find any classes implementing
EmbeddedServletContainerCustomizerand change the interface toWebServerFactoryCustomizer<ConfigurableServletWebServerFactory>.
- Adjust configuration classes to use the
- org.openrewrite.java.spring.boot2.ConditionalOnBeanAnyNestedCondition
- Migrate multi-condition
@ConditionalOnBeanannotations - Migrate multi-condition
@ConditionalOnBeanannotations toAnyNestedCondition.
- Migrate multi-condition
- org.openrewrite.java.spring.boot2.DatabaseComponentAndBeanInitializationOrderingUnconditionally
- Unconditionally adds
@DependsOnDatabaseInitializationto Spring Beans and Components depending onjavax.sql.DataSource - Beans of certain well-known types, such as
JdbcTemplate, will be ordered so that they are initialized after the database has been initialized. If you have a bean that works with theDataSourcedirectly, annotate its class or@Beanmethod with@DependsOnDatabaseInitializationto ensure that it too is initialized after the database has been initialized. See the release notes for more. This recipe will not check if the@DependsOnDatabaseInitializationannotation is on the classpath. This recipe is best combined with a precondition, as seen inDatabaseComponentAndBeanInitializationOrdering.
- Unconditionally adds
- org.openrewrite.java.spring.boot2.GetErrorAttributes
- Use
ErrorAttributes#getErrorAttributes(WebRequest, ErrorAttributeOptions) ErrorAttributes#getErrorAttributes(WebRequest, boolean)was deprecated in Spring Boot 2.3.
- Use
- org.openrewrite.java.spring.boot2.HeadersConfigurerLambdaDsl
- Convert
HeadersConfigurerchained calls into Lambda DSL - Converts
HeadersConfigurerchained call from Spring Security pre 5.2.x into new lambda DSL style calls and removesand()methods.
- Convert
- org.openrewrite.java.spring.boot2.HttpSecurityLambdaDsl
- Convert
HttpSecuritychained calls into Lambda DSL - Converts
HttpSecuritychained call from Spring Security pre 5.2.x into new lambda DSL style calls and removesand()methods.
- Convert
- org.openrewrite.java.spring.boot2.MergeBootstrapYamlWithApplicationYaml
- Merge Spring
bootstrap.ymlwithapplication.yml - In Spring Boot 2.4, support for
bootstrap.ymlwas removed. It's properties should be merged withapplication.yml.
- Merge Spring
- org.openrewrite.java.spring.boot2.MigrateActuatorMediaTypeToApiVersion
- Migrate deprecated
ActuatorMediaTypetoApiVersion#getProducedMimeType - Spring Boot
ActuatorMediaTypewas deprecated in 2.5 in favor ofApiVersion#getProducedMimeType(). ReplaceMediaType.parseMediaType(ActuatorMediaType.Vx_JSON)withMediaType.asMediaType(ApiVersion.Vx.getProducedMimeType()).
- Migrate deprecated
- org.openrewrite.java.spring.boot2.MigrateConfigurationPropertiesBindingPostProcessorValidatorBeanName
- Use
EnableConfigurationProperties.VALIDATOR_BEAN_NAME - Replaces field and static access of
ConfigurationPropertiesBindingPostProcessor.VALIDATOR_BEAN_NAMEwithEnableConfigurationProperties.VALIDATOR_BEAN_NAME. Deprecated in 2.2.x.
- Use
- org.openrewrite.java.spring.boot2.MigrateDatabaseCredentialsForToolProperties
- Migrate null credentials
- Migrate null credentials.
- org.openrewrite.java.spring.boot2.MigrateDatabaseCredentialsForToolYaml
- Migrate null credentials
- Migrate null credentials.
- org.openrewrite.java.spring.boot2.MigrateDiskSpaceHealthIndicatorConstructor
- Use
DiskSpaceHealthIndicator(File, DataSize) DiskSpaceHealthIndicator(File, long)was deprecated in Spring Data 2.1 for removal in 2.2.
- Use
- org.openrewrite.java.spring.boot2.MigrateErrorPropertiesIncludeStackTraceConstants
- Use
ErrorProperties#IncludeStacktrace.ON_PARAM ErrorProperties#IncludeStacktrace.ON_TRACE_PARAMwas deprecated in 2.3.x and removed in 2.5.0.
- Use
- org.openrewrite.java.spring.boot2.MigrateHsqlEmbeddedDatabaseConnection
- Migrate deprecated Spring-Boot
EmbeddedDatabaseConnection.HSQL - Spring-Boot
EmbeddedDatabaseConnection.HSQLwas deprecated in favor ofEmbeddedDatabaseConnection.HSQLDBin 2.4.
- Migrate deprecated Spring-Boot
- org.openrewrite.java.spring.boot2.MigrateLocalServerPortAnnotation
- Use
org.springframework.boot.web.server.LocalServerPort - Updates the package and adds the necessary dependency if
LocalServerPortis in use. The package ofLocalServerPortwas changed in Spring Boot 2.0, necessitating changes.
- Use
- org.openrewrite.java.spring.boot2.MigrateLoggingSystemPropertyConstants
- Migrate to recommended constants in
LogbackLoggingSystemPropertiesfrom deprecated values inLoggingSystemProperties - Replaces field and static access of deprecated fields in
LoggingSystemPropertieswith the recommendations fromLogbackLoggingSystemProperties. Deprecated in 2.4.x and removed in 2.6.0.
- Migrate to recommended constants in
- org.openrewrite.java.spring.boot2.MigrateMultipartConfigFactory
- Use
MultipartConfigFactorywithDataSizearguments - Methods to set
DataSizewith primitive arguments were deprecated in 2.1 and removed in 2.2.
- Use
- org.openrewrite.java.spring.boot2.MigrateRestTemplateBuilderTimeoutByInt
- Use
RestTemplateBuilder#setConnectTimeout(Duration)andRestTemplateBuilder#setReadTimeout(Duration) RestTemplateBuilder#setConnectTimeout(int)andRestTemplateBuilder#setReadTimeout(int)were deprecated in Spring Boot 2.1.
- Use
- org.openrewrite.java.spring.boot2.MoveAutoConfigurationToImportsFile
- Use
AutoConfiguration#imports - Use
AutoConfiguration#importsinstead of the deprecated entryEnableAutoConfigurationinspring.factorieswhen defining autoconfiguration classes.
- Use
- org.openrewrite.java.spring.boot2.OutputCaptureExtension
- Migrate
@OutputCaptureRuleto@ExtendWith(OutputCaptureExtension.class) - Use the JUnit Jupiter extension instead of JUnit 4 rule.
- Migrate
- org.openrewrite.java.spring.boot2.ReplaceDeprecatedEnvironmentTestUtils
- Replace
EnvironmentTestUtilswithTestPropertyValues - Replaces any references to the deprecated
EnvironmentTestUtilswithTestPropertyValuesand the appropriate functionality.
- Replace
- org.openrewrite.java.spring.boot2.ReplaceExtendWithAndContextConfiguration
- Replace
@ExtendWithand@ContextConfigurationwith@SpringJunitConfig - Replaces
@ExtendWith(SpringRunner.class)and@ContextConfigurationwith@SpringJunitConfig, preserving attributes on@ContextConfiguration, unless@ContextConfiguration(loader = ...)is used.
- Replace
- org.openrewrite.java.spring.boot2.RestTemplateBuilderRequestFactory
- Migrate
RestTemplateBuilder - Migrate
RestTemplateBuilder#requestFactorycalls to use aSupplier. See the migration guide for more.
- Migrate
- org.openrewrite.java.spring.boot2.SamlRelyingPartyPropertyApplicationPropertiesMove
- Move SAML relying party identity provider property to asserting party
- Renames spring.security.saml2.relyingparty.registration.(any).identityprovider to spring.security.saml2.relyingparty.registration.(any).assertingparty.
- org.openrewrite.java.spring.boot2.ServerHttpSecurityLambdaDsl
- Convert
ServerHttpSecuritychained calls into Lambda DSL - Converts
ServerHttpSecuritychained call from Spring Security pre 5.2.x into new lambda DSL style calls and removesand()methods.
- Convert
- org.openrewrite.java.spring.boot2.SpringBootMavenPluginMigrateAgentToAgents
- Use
spring-boot.run.agentsconfiguration key inspring-boot-maven-plugin - Migrate the
spring-boot.run.agentMaven plugin configuration key tospring-boot.run.agents. Deprecated in 2.2.x.
- Use
- org.openrewrite.java.spring.boot2.UnnecessarySpringExtension
- Remove
@SpringExtension @SpringBootTestand all test slice annotations already applies@SpringExtensionas of Spring Boot 2.1.0.
- Remove
- org.openrewrite.java.spring.boot2.search.CustomizingJooqDefaultConfiguration
- In Spring Boot 2.5 a
DefaultConfigurationCustomizercan now be used in favour of defining one or more*Providerbeans - To streamline the customization of jOOQ’s
DefaultConfiguration, a bean that implementsDefaultConfigurationCustomizercan now be defined. This customizer callback should be used in favour of defining one or more*Providerbeans, the support for which has now been deprecated. See Spring Boot 2.5 jOOQ customization.
- In Spring Boot 2.5 a
- org.openrewrite.java.spring.boot2.search.IntegrationSchedulerPoolRecipe
- Integration scheduler pool size
- Spring Integration now reuses an available
TaskSchedulerrather than configuring its own. In a typical application setup relying on the auto-configuration, this means that Spring Integration uses the auto-configured task scheduler that has a pool size of 1. To restore Spring Integration’s default of 10 threads, use thespring.task.scheduling.pool.sizeproperty.
- org.openrewrite.java.spring.boot2.search.LoggingShutdownHooks
- Applications using logging shutdown hooks
- Spring Boot registers a logging shutdown hook by default for JAR-based applications to ensure that logging resources are released when the JVM exits. If your application is deployed as a WAR then the shutdown hook is not registered since the servlet container usually handles logging concerns. Most applications will want the shutdown hook. However, if your application has complex context hierarchies, then you may need to disable it. You can use the
logging.register-shutdown-hookproperty to do that.
- org.openrewrite.java.spring.boot3.AddRouteTrailingSlash
- Add trailing slash to Spring routes
- This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is to add declaration of additional route explicitly on the controller handler (like@GetMapping("/some/greeting", "/some/greeting/").
- org.openrewrite.java.spring.boot3.AddSetUseTrailingSlashMatch
- Add
SetUseTrailingSlashMatch()in configuration - This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is change the default with the global Spring MVC or Webflux configuration.
- Add
- org.openrewrite.java.spring.boot3.AddValidToNestedConfigProperties
- Add
@Validto nested properties in@ConfigurationProperties - Adds
@Validannotation to fields in@ConfigurationPropertiesclasses that contain nested properties with validation constraints.
- Add
- org.openrewrite.java.spring.boot3.ConfigurationOverEnableSecurity
- Add
@Configurationto classes with@EnableXXXSecurityannotations - Prior to Spring Security 6,
@EnableXXXSecurityimplicitly had@Configuration.Configurationwas removed from the definitions of the@EnableSecuritydefinitions in Spring Security 6. Consequently classes annotated with@EnableXXXSecuritycoming from pre-Boot 3 should have@Configurationannotation added.
- Add
- 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-jettyas a first-order dependency and will add the maven propertyjakarta-servlet.versionsetting it's value to5.0.0. This will downgrade thejakarta-servletartifact if the pom's parent extends from the spring-boot-parent.
- org.openrewrite.java.spring.boot3.MaintainTrailingSlashURLMappings
- Maintain trailing slash URL mappings
- This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is to maintain trailing slash in all HTTP url mappings.
- org.openrewrite.java.spring.boot3.MigrateHooksToReactorContextProperty
- Use
spring.reactor.context-propagationproperty - Replace
Hooks.enableAutomaticContextPropagation()withspring.reactor.context-propagation=true.
- Use
- org.openrewrite.java.spring.boot3.MigrateWebMvcTagsToObservationConvention
- Migrate
WebMvcTagsProvidertoDefaultServerRequestObservationConvention - Migrate
WebMvcTagsProvidertoDefaultServerRequestObservationConventionas part of Spring Boot 3.2 removals.
- Migrate
- org.openrewrite.java.spring.boot3.PreciseBeanType
- Bean methods should return concrete types
- Replace Bean method return types with concrete types being returned. This is required for Spring 6 AOT.
- org.openrewrite.java.spring.boot3.RemoveConstructorBindingAnnotation
- Remove Unnecessary
@ConstructorBinding - As of Boot 3.0
@ConstructorBindingis no longer needed at the type level on@ConfigurationPropertiesclasses and should be removed.
- Remove Unnecessary
- org.openrewrite.java.spring.boot3.RemoveEnableBatchProcessing
- Enable Spring Batch Annotation
- Add or remove the
@EnableBatchProcessingannotation from a Spring Boot application.
- org.openrewrite.java.spring.boot3.RemoveSolrAutoConfigurationExclude
- Remove
SolrAutoConfiguration SolrAutoConfigurationwas removed in Spring Boot 3; remove references to it from exclusions on annotations.
- Remove
- org.openrewrite.java.spring.boot3.ReplaceRestTemplateBuilderRequestFactoryMethod
- Replace
RestTemplateBuilder.requestFactory(Function)withrequestFactoryBuilder RestTemplateBuilder.requestFactory(java.util.function.Function)was deprecated since Spring Boot 3.4, in favor ofrequestFactoryBuilder(ClientHttpRequestFactoryBuilder).
- Replace
- org.openrewrite.java.spring.cloud2022.AddLoggingPatternLevelForSleuth
- Add logging.pattern.level for traceId and spanId
- Add
logging.pattern.levelfor traceId and spanId which was previously set by default, if not already set.
- org.openrewrite.java.spring.cloud2022.MigrateRequestMappingOnFeignClient
- Migrate
@RequestMappingonFeignClientto@FeignClientpath attribute - Support for
@RequestMappingover aFeignClientinterface was removed in Spring Cloud OpenFeign 2.2.10.RELEASE.
- Migrate
- org.openrewrite.java.spring.data.JdbcTemplateQueryForLongMigration
- Convert
JdbcTemplate.queryForLong(..)toqueryForObject(..) - Replaces calls to
JdbcTemplate.queryForLong(..)withqueryForObject(String, Class, Object...).
- Convert
- org.openrewrite.java.spring.data.MigrateAuditorAwareToOptional
- Make AuditorAware.getCurrentAuditor return
Optional - As of Spring boot 2.0, the
AuditorAware.getCurrentAuditormethod should return anOptional. This recipe will update the implementations of this method to return anOptionalusing theofNullable.
- Make AuditorAware.getCurrentAuditor return
- org.openrewrite.java.spring.data.MigrateJpaSort
- Use
JpaSort.of(..) - Equivalent constructors in
JpaSortwere deprecated in Spring Data 2.3.
- Use
- org.openrewrite.java.spring.data.MigrateQueryToNativeQuery
- Replace
@Queryannotation by@NativeQuerywhen possible - Replace
@Queryannotation by@NativeQuerywhennativeQuery = true.@NativeQuerywas introduced in Spring Data JPA 3.4.
- Replace
- org.openrewrite.java.spring.data.MigrateQuerydslJpaRepository
- Use
QuerydslPredicateExecutor<T> QuerydslJpaRepository<T, ID extends Serializable>was deprecated in Spring Data 2.1.
- Use
- org.openrewrite.java.spring.data.RefactorSimpleMongoDbFactory
- Use
new SimpleMongoClientDbFactory(String) - Replace usage of deprecated
new SimpleMongoDbFactory(new MongoClientURI(String))withnew SimpleMongoClientDbFactory(String).
- Use
- org.openrewrite.java.spring.data.UseTlsJdbcConnectionString
- Use TLS for JDBC connection strings
- Increasingly, for compliance reasons (e.g. NACHA), JDBC connection strings should be TLS-enabled. This recipe will update the port and optionally add a connection attribute to indicate that the connection is TLS-enabled.
- org.openrewrite.java.spring.doc.ApiInfoBuilderToInfo
- Migrate
ApiInfoBuildertoInfo - Migrate SpringFox's
ApiInfoBuilderto Swagger'sInfo.
- Migrate
- org.openrewrite.java.spring.doc.MigrateDocketBeanToGroupedOpenApiBean
- Migrate
DockettoGroupedOpenAPI - Migrate a
Docketbean to aGroupedOpenAPIbean preserving group name, packages and paths. When possible the recipe will prefer property based configuration.
- Migrate
- org.openrewrite.java.spring.doc.RemoveBeanValidatorPluginsConfiguration
- Removes @Import(BeanValidatorPluginsConfiguration.class)
- As Springdoc OpenAPI supports Bean Validation out of the box, the BeanValidatorPluginsConfiguration is no longer supported nor needed. Thus remove @Import(BeanValidatorPluginsConfiguration.class).
- org.openrewrite.java.spring.doc.SecurityContextToSecurityScheme
- Replace elements of SpringFox's security with Swagger's security models
- Replace
ApiKey,AuthorizationScope, andSecuritySchemeelements with Swagger's equivalents.
- org.openrewrite.java.spring.framework.BeanMethodReturnNull
@Beanmethods may not returnvoid- Make
@Beanmethods returnObjectinstead ofvoid.
- org.openrewrite.java.spring.framework.BeanMethodsNotPublic
- Remove
publicfrom@Beanmethods - Remove public modifier from
@Beanmethods. They no longer have to be public visibility to be usable by Spring.
- Remove
- org.openrewrite.java.spring.framework.EnvironmentAcceptsProfiles
- Use
Environment#acceptsProfiles(Profiles) Environment#acceptsProfiles(String...)was deprecated in Spring Framework 5.1.
- Use
- org.openrewrite.java.spring.framework.HttpComponentsClientHttpRequestFactoryReadTimeout
- Migrate
setReadTimeout(java.lang.int)to SocketConfigsetSoTimeout(..) setReadTimeout(..)was removed in Spring Framework 6.1.
- Migrate
- org.openrewrite.java.spring.framework.JdbcTemplateObjectArrayArgToVarArgs
- Use varargs equivalents for deprecated JdbcTemplate signatures
JdbcTemplatesignatures withObject[]arguments are deprecated, in favor of their existing varargs equivalents.
- org.openrewrite.java.spring.framework.MigrateBase64Utils
- Migrate
org.springframework.util.Base64Utilstojava.io.Base64 - Replaces usages of deprecated
org.springframework.util.Base64Utilswithjava.util.Base64.
- Migrate
- org.openrewrite.java.spring.framework.MigrateClientHttpResponseGetRawStatusCodeMethod
- Replaces deprecated
ClientHttpResponse#getRawStatusCode() ClientHttpResponse#getRawStatusCode()was deprecated, so we replace it withgetStatusCode(), though the return type has changed frominttoHttpStatusCode, so we must account for that as well.
- Replaces deprecated
- org.openrewrite.java.spring.framework.MigrateHandlerInterceptor
- Migrate
HandlerInterceptorAdaptertoHandlerInterceptor - Deprecated as of 5.3 in favor of implementing
HandlerInterceptorand/orAsyncHandlerInterceptor.
- Migrate
- org.openrewrite.java.spring.framework.MigrateHandlerResultHasExceptionHandlerMethod
- Migrate
HandlerResult.hasExceptionHandler()togetExceptionHandler() org.springframework.web.reactive.HandlerResult.hasExceptionHandler()was deprecated, in favor ofgetExceptionHandler().
- Migrate
- org.openrewrite.java.spring.framework.MigrateHandlerResultSetExceptionHandlerMethod
- Migrate
org.springframework.web.reactive.HandlerResult.setExceptionHandlermethod org.springframework.web.reactive.HandlerResult.setExceptionHandler(Function<Throwable, Mono<HandlerResult>>)was deprecated, in favor ofsetExceptionHandler(DispatchExceptionHandler).
- Migrate
- org.openrewrite.java.spring.framework.MigrateInstantiationAwareBeanPostProcessorAdapter
- Convert
InstantiationAwareBeanPostProcessorAdaptertoSmartInstantiationAwareBeanPostProcessor - As of Spring-Framework 5.3
InstantiationAwareBeanPostProcessorAdapteris deprecated in favor of the existing default methods inSmartInstantiationAwareBeanPostProcessor.
- Convert
- org.openrewrite.java.spring.framework.MigrateMethodArgumentNotValidExceptionErrorMethod
- Migrate
MethodArgumentNotValidException.errorsToStringListandresolveErrorMessages org.springframework.web.bind.MethodArgumentNotValidException.errorsToStringListandresolveErrorMessagesmethod was deprecated, in favor ofBindErrorUtils.
- Migrate
- org.openrewrite.java.spring.framework.MigrateResourceHttpMessageWriterAddHeadersMethod
- Migrate
ResourceHttpMessageWriter.addHeaders org.springframework.http.codec.ResourceHttpMessageWriter.addHeaderswas deprecated, in favor ofaddDefaultHeadersmethod.
- Migrate
- org.openrewrite.java.spring.framework.MigrateResponseEntityExceptionHandlerHttpStatusToHttpStatusCode
- Migrate
ResponseEntityExceptionHandlerfrom HttpStatus to HttpStatusCode - With Spring 6
HttpStatuswas replaced byHttpStatusCodein most method signatures in theResponseEntityExceptionHandler.
- Migrate
- org.openrewrite.java.spring.framework.MigrateResponseStatusExceptionGetRawStatusCodeMethod
- Migrate
ResponseStatusException#getRawStatusCode()togetStatusCode().value() - Migrate Spring Framework 5.3's
ResponseStatusExceptionmethodgetRawStatusCode()to Spring Framework 6'sgetStatusCode().value().
- Migrate
- org.openrewrite.java.spring.framework.MigrateResponseStatusExceptionGetStatusCodeMethod
- Migrate
ResponseStatusException#getStatus()togetStatusCode() - Migrate Spring Framework 5.3's
ResponseStatusExceptionmethodgetStatus()to Spring Framework 6'sgetStatusCode().
- Migrate
- org.openrewrite.java.spring.framework.MigrateUriComponentsBuilderMethods
- Migrate
UriComponentsBuilder.fromHttpRequestandparseForwardedFor - The
fromHttpRequestandparseForwardedFormethods inorg.springframework.web.util.UriComponentsBuilderwere deprecated, in favor oforg.springframework.web.util.ForwardedHeaderUtils.
- Migrate
- org.openrewrite.java.spring.framework.MigrateUtf8MediaTypes
- Migrate deprecated Spring Web UTF8
MediaTypeenums - Spring Web
MediaType#APPLICATION_JSON_UTF8andMediaType#APPLICATION_PROBLEM_JSON_UTF8were deprecated in 5.2.
- Migrate deprecated Spring Web UTF8
- org.openrewrite.java.spring.framework.MigrateWebExchangeBindExceptionResolveErrorMethod
- Migrate
WebExchangeBindException.resolveErrorMessages org.springframework.web.bind.support.WebExchangeBindException.resolveErrorMessageswas deprecated, in favor ofBindErrorUtils.
- Migrate
- org.openrewrite.java.spring.framework.MigrateWebMvcConfigurerAdapter
- Replace
WebMvcConfigurerAdapterwithWebMvcConfigurer - As of 5.0
WebMvcConfigurerhas default methods (made possible by a Java 8 baseline) and can be implemented directly without the need for this adapter.
- Replace
- org.openrewrite.java.spring.http.ReplaceStringLiteralsWithHttpHeadersConstants
- Replace String literals with
HttpHeadersconstants - Replace String literals with
org.springframework.http.HttpHeadersconstants.
- Replace String literals with
- org.openrewrite.java.spring.http.ReplaceStringLiteralsWithMediaTypeConstants
- Replace String literals with
MediaTypeconstants - Replace String literals with
org.springframework.http.MediaTypeconstants.
- Replace String literals with
- org.openrewrite.java.spring.http.SimplifyMediaTypeParseCalls
- Simplify unnecessary
MediaType.parseMediaType()andMediaType.valueOf()calls - Replaces
MediaType.parseMediaType("application/json")andMediaType.valueOf("application/json")withMediaType.APPLICATION_JSON.
- Simplify unnecessary
- org.openrewrite.java.spring.http.SimplifyWebTestClientCalls
- Simplify WebTestClient expressions
- Simplifies various types of WebTestClient expressions to improve code readability.
- org.openrewrite.java.spring.kafka.KafkaOperationsSendReturnType
- Change
KafkaOperations.send*return type toCompletableFuture - Send operations used to return a
ListenableFuturebut as of 3.0 return aCompletableFuture. Adjust the usage to useCompletableFutureinstead.
- Change
- org.openrewrite.java.spring.kafka.KafkaTestUtilsDuration
- Use
DurationinKafkaTestUtils - Replace
KafkaTestUtilsmethods that take alongargument with methods that take aDuration.
- Use
- org.openrewrite.java.spring.kafka.RemoveUsingCompletableFuture
- Remove
KafkaOperations.usingCompletableFuture() - Remove the
KafkaOperations.usingCompletableFuture()bridge during Spring Kafka 2.9 to 3.0 migration.
- Remove
- org.openrewrite.java.spring.search.FindApiCalls
- Find HTTP API calls via
RestTemplate - Find outbound HTTP API calls made via Spring's
RestTemplateclass.
- Find HTTP API calls via
- org.openrewrite.java.spring.search.FindApiEndpoints
- Find Spring API endpoints
- Find all HTTP API endpoints exposed by Spring applications. More specifically, this marks method declarations annotated with
@RequestMapping,@GetMapping,@PostMapping,@PutMapping,@DeleteMapping, and@PatchMappingas search results.
- org.openrewrite.java.spring.search.FindConfigurationProperties
- Find Spring
@ConfigurationProperties - Find all classes annotated with
@ConfigurationPropertiesand extract their prefix values. This is useful for discovering all externalized configuration properties in Spring Boot applications.
- Find Spring
- org.openrewrite.java.spring.search.FindSpringComponents
- Find Spring components
- Find Spring components, including controllers, services, repositories, return types of
@Beanannotated methods, etc.
- org.openrewrite.java.spring.security5.AuthorizeHttpRequests
- Replace
HttpSecurity.authorizeRequests(...)withHttpSecurity.authorizeHttpRequests(...)andExpressionUrlAuthorizationConfigurer,AbstractInterceptUrlConfigurerwithAuthorizeHttpRequestsConfigurer, etc - Replace
HttpSecurity.authorizeRequests(...)deprecated in Spring Security 6 withHttpSecurity.authorizeHttpRequests(...)and all method calls on the resultant object respectively. Replace deprecatedAbstractInterceptUrlConfigurerand its deprecated subclasses withAuthorizeHttpRequestsConfigurerand its corresponding subclasses.
- Replace
- org.openrewrite.java.spring.security5.ReplaceGlobalMethodSecurityWithMethodSecurity
- Replace global method security with method security
@EnableGlobalMethodSecurityand<global-method-security>are deprecated in favor of@EnableMethodSecurityand<method-security>, respectively. The new annotation and XML element activate Spring’s pre-post annotations by default and use AuthorizationManager internally.
- org.openrewrite.java.spring.security5.UpdateArgon2PasswordEncoder
- Use new
Argon2PasswordEncoderfactory methods - In Spring Security 5.8 some
Argon2PasswordEncoderconstructors have been deprecated in favor of factory methods. Refer to the Spring Security migration docs for more information.
- Use new
- org.openrewrite.java.spring.security5.UpdatePbkdf2PasswordEncoder
- Use new
Pbkdf2PasswordEncoderfactory methods - In Spring Security 5.8 some
Pbkdf2PasswordEncoderconstructors have been deprecated in favor of factory methods. Refer to the Spring Security migration docs for more information.
- Use new
- org.openrewrite.java.spring.security5.UpdateSCryptPasswordEncoder
- Use new
SCryptPasswordEncoderfactory methods - In Spring Security 5.8 some
SCryptPasswordEncoderconstructors have been deprecated in favor of factory methods. Refer to the Spring Security migration docs for more information.
- Use new
- org.openrewrite.java.spring.security5.UseNewRequestMatchers
- Use the new
requestMatchersmethods - In Spring Security 5.8, the
antMatchers,mvcMatchers, andregexMatchersmethods were deprecated in favor of newrequestMatchersmethods. Refer to the Spring Security docs for more information.
- Use the new
- org.openrewrite.java.spring.security5.UseNewSecurityMatchers
- Use the new
securityMatcher()method - In Spring Security 5.8, the
HttpSecurity#antMatcher(),HttpSecurity#mvcMatcher(), andHttpSecurity#regexMatcher()methods were deprecated in favor of newHttpSecurity#securityMatcher()method. Refer to the Spring Security docs for more information.
- Use the new
- org.openrewrite.java.spring.security5.WebSecurityConfigurerAdapter
- Spring Security 5.4 introduces the ability to configure
HttpSecurityby creating aSecurityFilterChainbean - The Spring Security
WebSecurityConfigurerAdapterwas deprecated 5.7, this recipe will transformWebSecurityConfigurerAdapterclasses by using a component based approach. Check out the spring-security-without-the-websecurityconfigureradapter blog for more details.
- Spring Security 5.4 introduces the ability to configure
- org.openrewrite.java.spring.security6.ApplyToWithLambdaDsl
- Convert
HttpSecurity::applychained calls intoHttpSecurity::withLambda DSL - Converts
HttpSecurity::applychained call from Spring Security pre 6.2.x into new lambda DSL style calls and removesand()methods.
- Convert
- org.openrewrite.java.spring.security6.PropagateAuthenticationServiceExceptions
- Remove calls matching
AuthenticationEntryPointFailureHandler.setRethrowAuthenticationServiceException(true) - Remove any calls matching
AuthenticationEntryPointFailureHandler.setRethrowAuthenticationServiceException(true). See the corresponding Sprint Security 6.0 migration step for details.
- Remove calls matching
- org.openrewrite.java.spring.security6.RemoveFilterSecurityInterceptorOncePerRequest
- Remove unnecessary
filterSecurityInterceptorOncePerRequest(false)when upgrading to Spring Security 6 - In Spring Security 6.0,
<http>defaultsauthorizeRequests#filterSecurityInterceptorOncePerRequestto false. So, to complete migration, any defaults values can be removed.
- Remove unnecessary
- org.openrewrite.java.spring.security6.RemoveOauth2LoginConfig
- Remove unneeded
oauth2Loginconfig when upgrading to Spring Security 6 oauth2Login()is a Spring Security feature that allows users to authenticate with an OAuth2 or OpenID Connect 1.0 provider. When a user is authenticated using this feature, they are granted a set of authorities that determines what actions they are allowed to perform within the application. In Spring Security 5, the default authority given to a user authenticated with an OAuth2 or OpenID Connect 1.0 provider viaoauth2Login()isROLE_USER. This means that the user is allowed to access the application's resources as a regular user. However, in Spring Security 6, the default authority given to a user authenticated with an OAuth2 provider isOAUTH2_USER, and the default authority given to a user authenticated with an OpenID Connect 1.0 provider isOIDC_USER. These authorities are more specific and allow for better customization of the user's permissions within the application. If you are upgrading to Spring Security 6 and you have previously configured aGrantedAuthoritiesMapperto handle the authorities of users authenticated viaoauth2Login(), you can remove it completely as the new default authorities should be sufficient.
- Remove unneeded
- org.openrewrite.java.spring.security6.RequireExplicitSavingOfSecurityContextRepository
- Remove explicit
SecurityContextConfigurer.requireExplicitSave(true)opt-in - Remove explicit
SecurityContextConfigurer.requireExplicitSave(true)opt-in as that is the new default in Spring Security 6. See the corresponding Sprint Security 6.0 migration step for details.
- Remove explicit
- org.openrewrite.java.spring.security6.UpdateEnableReactiveMethodSecurity
- Remove the
useAuthorizationManager=trueattribute from@EnableReactiveMethodSecurity - In Spring security 6.0,
@EnableReactiveMethodSecuritydefaultsuseAuthorizationManagerto true. So, to complete migration,@EnableReactiveMethodSecurityremove theuseAuthorizationManagerattribute.
- Remove the
- org.openrewrite.java.spring.security6.UpdateRequestCache
- Keep the default RequestCache querying behavior in Spring Security 5
- By default, Spring Security 5 queries the saved request on every request, which means that in a typical setup, the HttpSession is queried on every request to use the RequestCache. In Spring Security 6, the default behavior has changed, and RequestCache will only be queried for a cached request if the HTTP parameter "continue" is defined. To maintain the same default behavior as Spring Security 5, either explicitly add the HTTP parameter "continue" to every request or use NullRequestCache to override the default behavior.
- org.openrewrite.java.spring.security6.UseSha256InRememberMe
- Remove explicit configuration of SHA-256 as encoding and matching algorithm for
TokenBasedRememberMeServices - As of Spring Security 6.0 the SHA-256 algorithm is the default for the encoding and matching algorithm used by
TokenBasedRememberMeServicesand does thus no longer need to be explicitly configured. See the corresponding Sprint Security 6.0 migration step for details.
- Remove explicit configuration of SHA-256 as encoding and matching algorithm for
- org.openrewrite.java.spring.security6.oauth2.client.OAuth2ClientLambdaDsl
- Convert
OAuth2ClientConfigurerchained calls into Lambda DSL - Converts
OAuth2ClientConfigurerchained call from Spring Security pre 5.2.x into new lambda DSL style calls and removesand()methods.
- Convert
- org.openrewrite.java.spring.security6.oauth2.client.OAuth2LoginLambdaDsl
- Convert
OAuth2LoginConfigurerchained calls into Lambda DSL - Converts
OAuth2LoginConfigurerchained call from Spring Security pre 5.2.x into new lambda DSL style calls and removesand()methods.
- Convert
- org.openrewrite.java.spring.security6.oauth2.server.resource.OAuth2ResourceServerLambdaDsl
- Convert
OAuth2ResourceServerConfigurerchained calls into Lambda DSL - Converts
OAuth2ResourceServerConfigurerchained call from Spring Security pre 5.2.x into new lambda DSL style calls and removesand()methods.
- Convert
- org.openrewrite.java.spring.test.SpringRulesToJUnitExtension
- Replace
SpringClassRuleandSpringMethodRulewith JUnit 5SpringExtension - Replace JUnit 4's
SpringClassRuleandSpringMethodRulewith JUnit 5'sSpringExtensionor rely on an existing@SpringBootTest.
- Replace
- org.openrewrite.maven.spring.UpgradeExplicitSpringBootDependencies
- Upgrade Spring dependencies
- Upgrades dependencies according to the specified version of spring boot. Spring boot has many direct and transitive dependencies. When a module has an explicit dependency on one of these it may also need to be upgraded to match the version used by spring boot.
org.openrewrite.recipe:rewrite-spring-to-quarkus
License: Moderne Source Available License
7 recipes
- org.openrewrite.quarkus.spring.AddQuarkusMavenPlugin
- Add Quarkus Maven plugin
- Adds the Quarkus Maven plugin using the same version as the quarkus-bom in dependency management.
- org.openrewrite.quarkus.spring.RemoveSpringBootParent
- Remove Spring Boot 3.x parent POM
- Removes the Spring Boot 3.x starter parent POM from Maven projects.
- org.openrewrite.quarkus.spring.ResponseEntityToJaxRsResponse
- Convert Spring
ResponseEntityto JAX-RSResponse - Transforms Spring
ResponseEntitypatterns to JAX-RSResponseAPI equivalents.
- Convert Spring
- org.openrewrite.quarkus.spring.SpringApplicationRunToQuarkusRun
- Replace
SpringApplication.run()withQuarkus.run() - Replace Spring Boot's
SpringApplication.run()method calls with Quarkus'sQuarkus.run().
- Replace
- org.openrewrite.quarkus.spring.SpringBeanToCdiProduces
- Replace Spring
@Beanwith CDI@Produces - Transform Spring
@Beanmethods to CDI@Producesmethods with appropriate scope annotations.
- Replace Spring
- org.openrewrite.quarkus.spring.ValueToCdiConfigProperty
- Replace Spring
@Valuewith CDI@ConfigProperty - Transform Spring
@Valueannotations to MicroProfile@ConfigPropertywith proper parameter mapping.
- Replace Spring
- org.openrewrite.quarkus.spring.WebToJaxRs
- Convert Spring Web annotations to JAX-RS
- Converts Spring Web annotations such as
@RestController,@RequestMapping,@GetMapping, etc., to their JAX-RS equivalents like@Path,@GET, etc.
org.openrewrite.recipe:rewrite-sql
License: Moderne Proprietary License
5 recipes
- org.openrewrite.sql.ChangeFunctionName
- Change a SQL function name
- When migrating between dialects, often one name can be substituted for another. For example, Oracle's
NVLfunction can be replaced with PostgresCOALESCE.
- org.openrewrite.sql.ConvertDataType
- Convert SQL data type
- When migrating between SQL dialects, data types often need to be converted. For example, Oracle's
VARCHAR2can be replaced with PostgresVARCHAR, orNUMBERwithNUMERIC.
- org.openrewrite.sql.FindSql
- Find SQL in code and resource files
- Find SQL in code (e.g. in string literals) and in resources like those ending with
.sql.
- org.openrewrite.sql.FormatSql
- Format SQL in string text blocks
- Checks whether a text block may contain SQL, and if so, formats the text accordingly.
- org.openrewrite.sql.search.FindFunction
- Find SQL function
- Find SQL functions by name.
org.openrewrite.recipe:rewrite-static-analysis
License: Moderne Source Available License
163 recipes
- org.openrewrite.staticanalysis.AbstractClassPublicConstructor
- Constructors of an
abstractclass should not be declaredpublic - Constructors of
abstractclasses can only be called in constructors of their subclasses. Therefore the visibility ofpublicconstructors are reduced toprotected.
- Constructors of an
- org.openrewrite.staticanalysis.AddSerialAnnotationToSerialVersionUID
- Add
@Serialannotation toserialVersionUID - Annotate any
serialVersionUIDfields with@Serialto indicate it's part of the serialization mechanism.
- Add
- org.openrewrite.staticanalysis.AddSerialVersionUidToSerializable
- Add
serialVersionUIDto aSerializableclass when missing - A
serialVersionUIDfield is strongly recommended in allSerializableclasses. If this is not defined on aSerializableclass, 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.
- Add
- org.openrewrite.staticanalysis.AnnotateNullableMethods
- Annotate methods which may return
nullwith@Nullable - Add
@Nullableto non-private methods that may returnnull. By defaultorg.jspecify.annotations.Nullableis used, but through thenullableAnnotationClassoption a custom annotation can be provided. When providing a customnullableAnnotationClassthat annotation should be meta annotated with@Target(TYPE_USE). This recipe scans for methods that do not already have a@Nullableannotation and checks their return statements for potential null values. It also identifies known methods from standard libraries that may return null, such as methods fromMap,Queue,Deque,NavigableSet, andSpliterator. The return of streams, or lambdas are not taken into account.
- Annotate methods which may return
- org.openrewrite.staticanalysis.AnnotateNullableParameters
- Annotate null-checked method parameters with
@Nullable - Add
@Nullableto parameters of public methods that are explicitly checked fornull. By defaultorg.jspecify.annotations.Nullableis used, but through thenullableAnnotationClassoption a custom annotation can be provided. When providing a customnullableAnnotationClassthat annotation should be meta annotated with@Target(TYPE_USE). This recipe scans for methods that do not already have parameters annotated with@Nullableannotation and checks their usages for potential null checks. Additional null-checking methods can be specified via theadditionalNullCheckingMethodsoption.
- Annotate null-checked method parameters with
- org.openrewrite.staticanalysis.AnnotateRequiredParameters
- Annotate required method parameters with
@NonNull - Add
@NonNullto parameters of public methods that are explicitly checked fornulland throw an exception if null. By defaultorg.jspecify.annotations.NonNullis used, but through thenonNullAnnotationClassoption a custom annotation can be provided. When providing a customnonNullAnnotationClassthat annotation should be meta annotated with@Target(TYPE_USE). This recipe scans for methods that do not already have parameters annotated with@NonNullannotation and checks for null validation patterns that throw exceptions, such asif (param == null) throw new IllegalArgumentException().
- Annotate required method parameters with
- org.openrewrite.staticanalysis.AtomicPrimitiveEqualsUsesGet
- Atomic Boolean, Integer, and Long equality checks compare their values
AtomicBoolean#equals(Object),AtomicInteger#equals(Object)andAtomicLong#equals(Object)are only equal to their instance. This recipe convertsa.equals(b)toa.get() == b.get().
- org.openrewrite.staticanalysis.AvoidBoxedBooleanExpressions
- Avoid boxed boolean expressions
- Under certain conditions the
java.lang.Booleantype is used as an expression, and it may throw aNullPointerExceptionif 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. UseBigDecimal.valueOf(double)instead. For example writingnew BigDecimal(0.1)does not create aBigDecimalwhich is exactly equal to0.1, but it is equal to0.1000000000000000055511151231257827021181583404541015625. This is because0.1cannot be represented exactly as a double (or, for that matter, as a binary fraction of any finite length).
- org.openrewrite.staticanalysis.BigDecimalRoundingConstantsToEnums
BigDecimalrounding constants toRoundingModeenums- Convert
BigDecimalrounding constants to the equivalentRoundingModeenum.
- 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.BufferedWriterCreationRecipes
- Modernize
BufferedWritercreation & prevent file descriptor leaks - The code
new BufferedWriter(new FileWriter(f))creates aBufferedWriterthat does not close the underlyingFileWriterwhen it is closed. This can lead to file descriptor leaks as per CWE-755. UseFiles.newBufferedWriterto create aBufferedWriterthat closes the underlying file descriptor when it is closed.
- Modernize
- org.openrewrite.staticanalysis.BufferedWriterCreationRecipes$BufferedWriterFromNewFileWriterWithFileAndBooleanArgumentsRecipe
- Convert
new BufferedWriter(new FileWriter(File, boolean))toFiles.newBufferedWriter(Path, StandardOpenOption) - Convert
new BufferedWriter(new FileWriter(f, b))toFiles.newBufferedWriter(f.toPath(), b ? StandardOpenOption.APPEND : StandardOpenOption.CREATE).
- Convert
- org.openrewrite.staticanalysis.BufferedWriterCreationRecipes$BufferedWriterFromNewFileWriterWithFileArgumentRecipe
- Convert
new BufferedWriter(new FileWriter(File))toFiles.newBufferedWriter(Path) - Convert
new BufferedWriter(new FileWriter(f))toFiles.newBufferedWriter(f.toPath()).
- Convert
- org.openrewrite.staticanalysis.BufferedWriterCreationRecipes$BufferedWriterFromNewFileWriterWithStringAndBooleanArgumentsRecipe
- Convert
new BufferedWriter(new FileWriter(String, boolean))toFiles.newBufferedWriter(Path, StandardOpenOption) - Convert
new BufferedWriter(new FileWriter(s, b))toFiles.newBufferedWriter(new java.io.File(s).toPath(), b ? StandardOpenOption.APPEND : StandardOpenOption.CREATE).
- Convert
- org.openrewrite.staticanalysis.BufferedWriterCreationRecipes$BufferedWriterFromNewFileWriterWithStringArgumentRecipe
- Convert
new BufferedWriter(new FileWriter(String))toFiles.newBufferedWriter(Path) - Convert
new BufferedWriter(new FileWriter(s))toFiles.newBufferedWriter(new java.io.File(s).toPath()).
- Convert
- org.openrewrite.staticanalysis.CaseInsensitiveComparisonsDoNotChangeCase
- CaseInsensitive comparisons do not alter case
- Remove
String#toLowerCase()orString#toUpperCase()fromString#equalsIgnoreCase(..)comparisons.
- org.openrewrite.staticanalysis.CatchClauseOnlyRethrows
- Catch clause should do more than just rethrow
- A
catchclause 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.ChainStringBuilderAppendCalls
- Chain
StringBuilder.append()calls - String concatenation within calls to
StringBuilder.append()causes unnecessary memory allocation. Except for concatenations of String literals, which are joined together at compile time. Replaces inefficient concatenations with chained calls toStringBuilder.append().
- Chain
- org.openrewrite.staticanalysis.CollectionToArrayShouldHaveProperType
- 'Collection.toArray()' should be passed an array of the proper type
- Using
Collection.toArray()without parameters returns anObject[], which requires casting. It is more efficient and clearer to useCollection.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.CompareEnumsWithEqualityOperator
- Enum values should be compared with "=="
- Replaces
Enum equals(java.lang.Object)withEnum == 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, andforcan 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 methodequals(Object). Covariantequals()means a method that is similar toequals(Object), but with a covariant parameter type (any subtype ofObject).
- org.openrewrite.staticanalysis.CustomImportOrder
- Custom import order
- Updates and reorders Java import declarations according to group and order settings compatible with the Checkstyle 'CustomImportOrder' check.
- org.openrewrite.staticanalysis.DeclarationSiteTypeVariance
- Properly use declaration-site type variance
- Currently, Java requires use-site type variance, so if someone has
Function<IN, OUT>method parameter, it should rather beFunction<? super IN, ? extends OUT>. Unfortunately, it is not easy to notice that? superand? extendsis missing, so this recipe adds it where that would improve the situation.
- org.openrewrite.staticanalysis.DefaultComesLast
- Default comes last
- Ensure the
defaultcase 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 assomeString.equals(anotherString = "text")). And removes redundant null checks in conjunction with equals comparisons.
- org.openrewrite.staticanalysis.EqualsToContentEquals
- Use
String.contentEquals(CharSequence)instead ofString.equals(CharSequence.toString()) - Use
String.contentEquals(CharSequence)instead ofString.equals(CharSequence.toString()).
- Use
- org.openrewrite.staticanalysis.ExplicitCharsetOnStringGetBytes
- Set charset encoding explicitly when calling
String#getBytes - This makes the behavior of the code platform neutral. It will not override any existing explicit encodings, even if they don't match the default encoding option.
- Set charset encoding explicitly when calling
- org.openrewrite.staticanalysis.ExplicitInitialization
- Explicit initialization
- Checks if any class or object member is explicitly initialized to default for its type value: -
nullfor object references - zero for numeric types andchar- andfalseforbooleanRemoves 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
Externalizableclasses have no-arguments constructorExternalizableclasses 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
breakstatements in locations where a case contains Java code but does not have abreak,return,throw, orcontinuestatement.
- org.openrewrite.staticanalysis.FinalClass
- Finalize classes with private constructors
- Adds the
finalmodifier to classes that expose no public or package-private constructors.
- org.openrewrite.staticanalysis.FinalizeLocalVariables
- Finalize local variables
- Adds the
finalmodifier keyword to local variables which are not reassigned.
- org.openrewrite.staticanalysis.FinalizeMethodArguments
- Finalize method arguments
- Adds the
finalmodifier keyword to method parameters.
- org.openrewrite.staticanalysis.FinalizePrivateFields
- Finalize private fields
- Adds the
finalmodifier keyword to private instance variables which are not reassigned.
- org.openrewrite.staticanalysis.FixStringFormatExpressions
- Fix
String#formatandString#formattedexpressions - Fix
String#formatandString#formattedexpressions by replacing\nnewline characters with%nand removing any unused arguments. Note this recipe is scoped to only transform format expressions which do not specify the argument index.
- Fix
- org.openrewrite.staticanalysis.ForLoopControlVariablePostfixOperators
forloop counters should use postfix operators- Replace
forloop control variables using pre-increment (++i) or pre-decrement (--i) operators with their post-increment (i++) or post-decrement (i++) notation equivalents.
- org.openrewrite.staticanalysis.ForLoopIncrementInUpdate
forloop 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.
- Use
- org.openrewrite.staticanalysis.IndexOfReplaceableByContains
indexOf()replaceable bycontains()- Checking if a value is included in a
StringorListusingindexOf(value)>-1orindexOf(value)>=0can be replaced withcontains(value).
- org.openrewrite.staticanalysis.IndexOfShouldNotCompareGreaterThanZero
indexOfshould not compare greater than zero- Replaces
String#indexOf(String) > 0andList#indexOf(Object) > 0with>=1. CheckingindexOfagainst>0ignores the first element, whereas>-1is inclusive of the first element. For clarity,>=1is used, because>0and>=1are semantically equal. Using>0may appear to be a mistake with the intent of including all elements. If the intent is to check whether a value in included in aStringorList, theString#contains(String)orList#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.InstanceOfPatternMatch
- Changes code to use Java 17's
instanceofpattern matching - Adds pattern variables to
instanceofexpressions wherever the same (side effect free) expression is referenced in a corresponding type cast expression within the flow scope of theinstanceof. Currently, this recipe supportsifstatements and ternary operator expressions.
- Changes code to use Java 17's
- org.openrewrite.staticanalysis.IsEmptyCallOnCollections
- Use
Collection#isEmpty()instead of comparingsize() - Also check for not
isEmpty()when testing for not equal to zero size.
- Use
- org.openrewrite.staticanalysis.LambdaBlockToExpression
- Simplify lambda blocks to expressions
- Single-line statement lambdas returning a value can be replaced with expression lambdas.
- 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.MaskCreditCardNumbers
- Mask credit card numbers
- When encountering string literals which appear to be credit card numbers, mask the last eight digits with the letter 'X'.
- 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 toString getFooBar()andint DoSomething()would be adjusted toint doSomething().
- org.openrewrite.staticanalysis.MinimumSwitchCases
switchstatements should have at least 3caseclausesswitchstatements 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 withifstatements.
- org.openrewrite.staticanalysis.MissingOverrideAnnotation
- Add missing
@Overrideto overriding and implementing methods - Adds
@Overrideto 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.
- Add missing
- org.openrewrite.staticanalysis.ModifierOrder
- Modifier order
- Modifiers should be declared in the correct order as recommended by the JLS.
- org.openrewrite.staticanalysis.MoveConditionsToWhile
- Convert
while (true)with initialifbreak to loop condition - Simplifies
while (true)loops where the first statement is anifstatement that only contains abreak. The condition is inverted and moved to the loop condition for better readability.
- Convert
- 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, anddo-whileblock 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
StringBuilderandStringBuffercharacter constructor argument toString - Instantiating a
StringBuilderor aStringBufferwith aCharacterresults in theintrepresentation of the character being used for the initial size.
- Change
- org.openrewrite.staticanalysis.NoDoubleBraceInitialization
- No double brace initialization
- Replace
List,Map, andSetdouble brace initialization with an initialization block.
- org.openrewrite.staticanalysis.NoEmptyCollectionWithRawType
- Use
Collections#emptyList(),emptyMap(), andemptySet() - Replaces
Collections#EMPTY_...with methods that return generic types.
- Use
- 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.NoFinalizedLocalVariables
- Don't use final on local variables
- Remove the
finalmodifier keyword from local variables regardless of whether they are used within a local class or an anonymous class.
- org.openrewrite.staticanalysis.NoFinalizer
- Remove
finalize()method - Finalizers are deprecated. Use of
finalize()can lead to performance issues, deadlocks, hangs, and other undesirable behavior.
- Remove
- 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#toStringinvocations on objects which are already a string.
- Unnecessary
- org.openrewrite.staticanalysis.NoValueOfOnStringType
- Unnecessary
String#valueOf(..) - Replace unnecessary
String#valueOf(..)method invocations with the argument directly. This occurs when the argument toString#valueOf(arg)is a string literal, such asString.valueOf("example"). Or, when theString#valueOf(..)invocation is used in a concatenation, such as"example" + String.valueOf("example").
- Unnecessary
- org.openrewrite.staticanalysis.NullableOnMethodReturnType
- Move
@Nullablemethod annotations to the return type - This is the way the cool kids do it.
- Move
- 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 thetryblock that are not already caught by more specificcatchclauses.
- Replace
- org.openrewrite.staticanalysis.OperatorWrap
- Operator wrapping
- Fixes line wrapping policies on operators.
- org.openrewrite.staticanalysis.PreferEqualityComparisonOverDifferenceCheck
- Prefer direct comparison of numbers
- Replace
a - b == 0witha == b,a - b != 0witha != b,a - b < 0witha < b, and similar transformations for all comparison operators to improve readability and avoid overflow issues.
- org.openrewrite.staticanalysis.PreferIncrementOperator
- Prefer increment/decrement and compound assignment operators
- Prefer the use of increment and decrement operators (
++,--,+=,-=) over their more verbose equivalents.
- org.openrewrite.staticanalysis.PreferSystemGetPropertyOverGetenv
- Prefer
System.getProperty("user.home")overSystem.getenv("HOME") - Replaces
System.getenv("HOME")withSystem.getProperty("user.home")for better portability.
- Prefer
- org.openrewrite.staticanalysis.PrimitiveWrapperClassConstructorToValueOf
- Use primitive wrapper
valueOfmethod - The constructor of all primitive types has been deprecated in favor of using the static factory method
valueOfavailable for each of the primitive type wrappers.
- Use primitive wrapper
- org.openrewrite.staticanalysis.RedundantFileCreation
- Redundant file creation
- Remove unnecessary intermediate creations of files.
- 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!=) overrideObject.equals(Object obj)except when the comparison is within an overriddenObject.equals(Object obj)method declaration itself. The resulting transformation must be carefully reviewed since any modifications change the program's semantics.
- Replace referential equality operators with Object equals method invocations when the operands both override
- 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.
- Remove
- org.openrewrite.staticanalysis.RemoveCallsToSystemGc
- Remove garbage collection invocations
- Removes calls to
System.gc()andRuntime.gc(). When to invoke garbage collection is best left to the JVM.
- org.openrewrite.staticanalysis.RemoveEmptyJavaDocParameters
- Remove JavaDoc
@param,@return, and@throwswith no description - Removes
@param,@return, and@throwswith no description from JavaDocs.
- Remove JavaDoc
- 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 withArrays.hashCode()because the results fromhashCode()are not helpful.
- org.openrewrite.staticanalysis.RemoveInstanceOfPatternMatch
- Removes from code Java 14's
instanceofpattern matching - Adds an explicit variable declaration at the beginning of
ifstatement instead ofinstanceofpattern matching.
- Removes from code Java 14's
- org.openrewrite.staticanalysis.RemoveJavaDocAuthorTag
- Remove author tags from JavaDocs
- Removes author tags from JavaDocs to reduce code maintenance.
- 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.RemoveRedundantNullCheckBeforeLiteralEquals
- Remove redundant null checks before literal equals
- Removes redundant null checks before
equals()comparisons when the receiver is a literal string, since literals can never be null andequals()returns false for null arguments.
- org.openrewrite.staticanalysis.RemoveRedundantTypeCast
- Remove redundant casts
- Removes unnecessary type casts. Does not currently check casts in lambdas and class constructors.
- org.openrewrite.staticanalysis.RemoveSystemOutPrintln
- Remove
System.out#printlnstatements - Print statements are often left accidentally after debugging an issue. This recipe removes all
System.out#printlnandSystem.err#printlnstatements from the code.
- Remove
- 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.
- Remove
- org.openrewrite.staticanalysis.RemoveUnneededAssertion
- Remove unneeded assertions
- Remove unneeded assertions like
assert true,assertTrue(true), orassertFalse(false).
- org.openrewrite.staticanalysis.RemoveUnneededBlock
- Remove unneeded block
- Flatten blocks into inline statements when possible.
- 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
privatemethods that are never executed are dead code and should be removed.
- org.openrewrite.staticanalysis.RenameExceptionInEmptyCatch
- Rename caught exceptions in empty catch blocks to
ignored - Renames caught exceptions in empty catch blocks to
ignored.ignoredwill be incremented by 1 if a namespace conflict exists.
- Rename caught exceptions in empty catch blocks to
- 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, ortostring - Methods should not be named
hashcode,equal, ortostring. Any of these are confusing as they appear to be intended as overridden methods from theObjectbase class, despite being case-insensitive.
- Rename methods named
- 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.ReorderAnnotationAttributes
- Reorder annotation attributes alphabetically
- Reorder annotation attributes to be alphabetical. Positional arguments (those without explicit attribute names) are left in their original position.
- org.openrewrite.staticanalysis.ReorderAnnotations
- Reorder annotations alphabetically
- Consistently order annotations by comparing their simple name.
- org.openrewrite.staticanalysis.ReplaceClassIsInstanceWithInstanceof
- Replace
A.class.isInstance(a)witha instanceof A - There should be no
A.class.isInstance(a), it should be replaced bya instanceof A.
- Replace
- org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray
- Use Empty Array for
Collection.toArray() - Changes new array creation with
Collection#toArray(T[])to use an empty array argument, which is better for performance. According to theCollection#toArray(T[])documentation: > If the collection fits in the specified array, it is returned therein. However, although it's not intuitive, allocating a right-sized array ahead of time to pass to the API appears to be generally worse for performance according to benchmarking and JVM developers due to a number of implementation details in both Java and the virtual machine. H2 achieved significant performance gains by switching to empty arrays instead pre-sized ones.
- Use Empty Array for
- org.openrewrite.staticanalysis.ReplaceDeprecatedRuntimeExecMethods
- Replace deprecated
Runtime#exec()methods - Replace
Runtime#exec(String)methods to useexec(String[])instead because the former is deprecated after Java 18 and is no longer recommended for use by the Java documentation.
- Replace deprecated
- org.openrewrite.staticanalysis.ReplaceDuplicateStringLiterals
- Replace duplicate
Stringliterals - Replaces
Stringliterals with a length of 5 or greater repeated a minimum of 3 times. QualifiedStringliterals include final Strings, method invocations, and new class invocations. Adds a newprivate static final Stringor 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.
- Replace duplicate
- 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 == nullwith the equivalent method reference.
- org.openrewrite.staticanalysis.ReplaceOptionalIsPresentWithIfPresent
- Replace
Optional#isPresent()withOptional#ifPresent() - Replace
Optional#isPresent()withOptional#ifPresent(). Please note that this recipe is only suitable for if-blocks that lack an Else-block and have a single condition applied.
- Replace
- org.openrewrite.staticanalysis.ReplaceRedundantFormatWithPrintf
- Replace redundant String format invocations that are wrapped with PrintStream operations
- Replaces
PrintStream.print(String.format(format, ...args))withPrintStream.printf(format, ...args)(and forprintln, appends a newline to the format string).
- org.openrewrite.staticanalysis.ReplaceStackWithDeque
- Replace
java.util.Stackwithjava.util.Deque - From the Javadoc of
Stack: > A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class.
- Replace
- org.openrewrite.staticanalysis.ReplaceStringBuilderWithString
- Replace
StringBuilder#appendwithString - Replace
StringBuilder.append()with String if you are only concatenating a small number of strings and the code is simple and easy to read, as the compiler can optimize simple string concatenation expressions into a single String object, which can be more efficient than using StringBuilder.
- Replace
- org.openrewrite.staticanalysis.ReplaceStringConcatenationWithStringValueOf
- Replace String concatenation with
String.valueOf() - Replace inefficient string concatenation patterns like
"" + ...withString.valueOf(...). This improves code readability and may have minor performance benefits.
- Replace String concatenation with
- org.openrewrite.staticanalysis.ReplaceTextBlockWithString
- Replace text block with regular string
- Replace text block with a regular multi-line string.
- org.openrewrite.staticanalysis.ReplaceValidateNotNullHavingVarargsWithObjectsRequireNonNull
- Replace
org.apache.commons.lang3.Validate#notNullwithObjects#requireNonNull - Replace
org.apache.commons.lang3.Validate.notNull(Object, String, Object[])withObjects.requireNonNull(Object, String).
- Replace
- 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"})becomesArrays.asList("a", "b", "c").
- Simplify
- 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 || !band!(a || b)to!a && !b.
- org.openrewrite.staticanalysis.SimplifyBooleanReturn
- Simplify boolean return
- Simplifies Boolean expressions by removing redundancies. For example,
a && truesimplifies toa.
- org.openrewrite.staticanalysis.SimplifyCompoundStatement
- Simplify compound statement
- Fixes or removes useless compound statements. For example, removing
b &= true, and replacingb &= falsewithb = false.
- org.openrewrite.staticanalysis.SimplifyConsecutiveAssignments
- Simplify consecutive assignments
- Combine consecutive assignments into a single statement where possible.
- org.openrewrite.staticanalysis.SimplifyConstantIfBranchExecution
- Simplify constant if branch execution
- Checks for if expressions that are always
trueorfalseand simplifies them.
- org.openrewrite.staticanalysis.SimplifyDurationCreationUnits
- Simplify
java.time.Durationunits - Simplifies
java.time.Durationunits to be more human-readable.
- Simplify
- org.openrewrite.staticanalysis.SimplifyElseBranch
- Simplify
elsebranch if it only has a singleif - Simplify
elsebranch if it only has a singleif.
- Simplify
- org.openrewrite.staticanalysis.SimplifyTernaryRecipes
- Simplify ternary expressions
- Simplifies various types of ternary expressions to improve code readability.
- org.openrewrite.staticanalysis.SimplifyTernaryRecipes$SimplifyTernaryFalseTrueRecipe
- Replace
booleanExpression ? false : truewith!booleanExpression - Replace ternary expressions like
booleanExpression ? false : truewith!booleanExpression.
- Replace
- org.openrewrite.staticanalysis.SimplifyTernaryRecipes$SimplifyTernaryTrueFalseRecipe
- Replace
booleanExpression ? true : falsewithbooleanExpression - Replace ternary expressions like
booleanExpression ? true : falsewithbooleanExpression.
- Replace
- org.openrewrite.staticanalysis.SortedSetStreamToLinkedHashSet
- Sorted set stream should be collected to LinkedHashSet
- Converts
set.stream().sorted().collect(Collectors.toSet())toset.stream().sorted().collect(LinkedHashSet::new).
- 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()onStringliterals 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.
- Use
- 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.TypecastParenPad
- Typecast parenthesis padding
- Fixes whitespace padding between a typecast type identifier and the enclosing left and right parentheses. For example, when configured to remove spacing,
( int ) 0L;becomes(int) 0L;.
- org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes
- URL Equals and Hash Code
- Uses of
equals()andhashCode()causejava.net.URLto make blocking internet connections. Instead, usejava.net.URI.
- org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes$URLEqualsRecipe
- URL Equals
- Uses of
equals()causejava.net.URLto make blocking internet connections. Instead, usejava.net.URI.
- org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes$URLHashCodeRecipe
- URL Hash Code
- Uses of
hashCode()causejava.net.URLto make blocking internet connections. Instead, usejava.net.URI.
- org.openrewrite.staticanalysis.UnnecessaryCatch
- Remove catch for a checked exception if the try block does not throw that exception
- A refactoring operation may result in a checked exception that is no longer thrown from a
tryblock. This recipe will find and remove unnecessary catch blocks.
- org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources
- Unnecessary close in try-with-resources
- Remove unnecessary
AutoCloseable#close()statements in try-with-resources.
- org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments
- Unnecessary explicit type arguments
- When explicit type arguments are inferable by the compiler, they may be removed.
- org.openrewrite.staticanalysis.UnnecessaryParentheses
- Remove unnecessary parentheses
- Removes unnecessary parentheses from code where extra parentheses pairs are redundant.
- org.openrewrite.staticanalysis.UnnecessaryPrimitiveAnnotations
- Remove
@Nullableand@CheckForNullannotations from primitives - Primitives can't be null anyway, so these annotations are not useful in this context.
- Remove
- org.openrewrite.staticanalysis.UnnecessaryReturnAsLastStatement
- Unnecessary
returnas last statement in void method - Removes
returnfrom avoidmethod if it's the last statement.
- Unnecessary
- org.openrewrite.staticanalysis.UnnecessaryThrows
- Unnecessary throws
- Remove unnecessary
throwsdeclarations. This recipe will only remove unused, checked exceptions if: - The declaring class or the method declaration isfinal. - The method declaration isstaticorprivate. - The method overrides a method declaration in a super class and the super class does not throw the exception. - The method ispublicorprotectedand the exception is not documented via a JavaDoc as a@throwstag.
- org.openrewrite.staticanalysis.UnwrapElseAfterReturn
- Unwrap else block after return or throw statement
- Unwraps the else block when the if block ends with a return or throw statement, reducing nesting and improving code readability.
- org.openrewrite.staticanalysis.UnwrapRepeatableAnnotations
- Unwrap
@Repeatableannotations - Java 8 introduced the concept of
@Repeatableannotations, making the wrapper annotation unnecessary.
- Unwrap
- org.openrewrite.staticanalysis.UpperCaseLiteralSuffixes
- Upper case literal suffixes
- Using upper case literal suffixes for declaring literals is less ambiguous, e.g.,
1lversus1L.
- org.openrewrite.staticanalysis.UseAsBuilder
- Chain calls to builder methods
- Chain calls to builder methods that are on separate lines into one chain of builder calls.
- org.openrewrite.staticanalysis.UseCollectionInterfaces
- Use
Collectioninterfaces - Use
Deque,List,Map,ConcurrentMap,Queue, andSetinstead of implemented collections. Replaces the return type of public method declarations and the variable type public variable declarations.
- Use
- 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 aList'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.UseForEachRemoveInsteadOfSetRemoveAll
- Replace
java.util.Set#removeAll(java.util.Collection)withjava.util.Collection#forEach(Set::remove) - Using
java.util.Collection#forEach(Set::remove)rather thanjava.util.Set#removeAll(java.util.Collection)may improve performance due to a possible O(n^2) complexity.
- Replace
- org.openrewrite.staticanalysis.UseJavaStyleArrayDeclarations
- No C-style array declarations
- Change C-Style array declarations
int i[];toint[] 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.UseListSort
- Replace invocations of
Collections#sort(List, Comparator)withList#sort(Comparator) - The
java.util.Collections#sort(..)implementation defers to thejava.util.List#sort(Comparator), replaced it with thejava.util.List#sort(Comparator)implementation for better readability.
- Replace invocations of
- org.openrewrite.staticanalysis.UseObjectNotifyAll
- Replaces
Object.notify()withObject.notifyAll() Object.notifyAll()andObject.notify()both wake up sleeping threads, butObject.notify()only rouses one whileObject.notifyAll()rouses all of them. SinceObject.notify()might not wake up the right thread,Object.notifyAll()should be used instead. See this for more information.
- Replaces
- 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.UseStandardCharset
- Use
StandardCharsetconstants - Replaces
Charset.forName(java.lang.String)with the equivalentStandardCharsetconstant.
- Use
- org.openrewrite.staticanalysis.UseStringReplace
- Use
String::replace()when first parameter is not a real regular expression - When
String::replaceAllis used, the first argument should be a real regular expression. If it’s not the case,String::replacedoes exactly the same thing asString::replaceAllwithout the performance drawback of the regex.
- Use
- org.openrewrite.staticanalysis.UseSystemLineSeparator
- Use
System.lineSeparator() - Replace calls to
System.getProperty("line.separator")withSystem.lineSeparator().
- Use
- org.openrewrite.staticanalysis.WhileInsteadOfFor
- Prefer
whileoverforloops - 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.
- Prefer
- org.openrewrite.staticanalysis.WriteOctalValuesAsDecimal
- Write octal values as decimal
- Developers may not recognize octal values as such, mistaking them instead for decimal values.
- org.openrewrite.staticanalysis.java.MoveFieldAnnotationToType
- Move annotation to type instead of field
- Annotations that could be applied to either a field or a type are better applied to the type, because similar annotations may be more restrictive, leading to compile errors like 'scoping construct cannot be annotated with type-use annotation' when migrating later.
- org.openrewrite.staticanalysis.maven.MavenJavadocNonAsciiRecipe
- Remove non-ASCII characters from Javadoc
- Maven's javadoc-plugin configuration does not support non-ASCII characters. What makes it tricky is the error is very ambiguous and doesn't help in any way. This recipe removes those non-ASCII characters.
org.openrewrite.recipe:rewrite-struts
License: Moderne Source Available License
4 recipes
- org.openrewrite.java.struts.MigrateStrutsDtd
- Migrate DTD to a specific Struts version
- Update Struts DTD to reflect the specified version.
- org.openrewrite.java.struts.migrate6.MigrateDynamicMethodInvocation
- Migrate Dynamic Method Invocation to explicit action mappings
- Identifies Struts configurations using Dynamic Method Invocation (DMI) and marks them for migration, as DMI is disabled by default in Struts 6 for security reasons.
- org.openrewrite.java.struts.search.FindStrutsActions
- Find Struts actions
- Find actions and their associated definitions.
- org.openrewrite.java.struts.search.FindStrutsXml
- Find struts XML files
- Struts XML files may have any name, and may be outside a resources directory, so the true test is to look at the content of the file.
org.openrewrite.recipe:rewrite-terraform
License: Moderne Proprietary License
4 recipes
- org.openrewrite.terraform.AddConfiguration
- Add Terraform configuration
- If the configuration has a different value, leave it alone. If it is missing, add it.
- org.openrewrite.terraform.SecureRandom
- Use a long enough byte length for
randomresources - Use a long enough byte length for
randomresources.
- Use a long enough byte length for
- org.openrewrite.terraform.search.FindRequiredProvider
- Find required providers
- Find
required_providersblocks in Terraform configuration files. Produces a data table of the provider names and their versions.
- org.openrewrite.terraform.search.FindResource
- Find Terraform resource
- Find a Terraform resource by resource type.
org.openrewrite.recipe:rewrite-testing-frameworks
License: Moderne Source Available License
166 recipes
- org.openrewrite.java.testing.arquillian.ReplaceArquillianInSequenceAnnotation
- Arquillian JUnit 4
@InSequenceto JUnit Jupiter@Order - Transforms the Arquillian JUnit 4
@InSequenceto the JUnit Jupiter@Order.
- Arquillian JUnit 4
- org.openrewrite.java.testing.assertj.AdoptAssertJDurationAssertions
- Adopt AssertJ Duration assertions
- Adopt AssertJ
DurationAssertassertions for more expressive messages.
- org.openrewrite.java.testing.assertj.AssertJBigIntegerRulesRecipes
- Adopt AssertJ BigInteger Assertions
- Adopt AssertJ BigInteger Assertions. Favor semantically explicit methods (e.g.
myBigInteger.isZero()overmyBigInteger.isEqualTo(0)).
- org.openrewrite.java.testing.assertj.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsEqualToRecipe
- Replace
isCloseTowithisEqualTo - Replace
isCloseTowithisEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsNotEqualToRecipe
- Replace
isNotCloseTowithisNotEqualTo - Replace
isNotCloseTowithisNotEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsNotZeroRecipe
- Replace
isNotEqualTo(0)withisNotZero() - Replace
isNotEqualTo(0)withisNotZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsOneRecipe
- Replace
isEqualTo(1)withisOne() - Replace
isEqualTo(1)withisOne().
- Replace
- org.openrewrite.java.testing.assertj.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsZeroRecipe
- Replace
isEqualTo(0)withisZero() - Replace
isEqualTo(0)withisZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJByteRulesRecipes
- Adopt AssertJ Byte Assertions
- Adopt AssertJ Byte Assertions. Favor semantically explicit methods (e.g.
myByte.isZero()overmyByte.isEqualTo(0)).
- org.openrewrite.java.testing.assertj.AssertJByteRulesRecipes$AbstractByteAssertIsEqualToRecipe
- Replace
isCloseTowithisEqualTo - Replace
isCloseTowithisEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJByteRulesRecipes$AbstractByteAssertIsNotEqualToRecipe
- Replace
isNotCloseTowithisNotEqualTo - Replace
isNotCloseTowithisNotEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJByteRulesRecipes$AbstractByteAssertIsNotZeroRecipe
- Replace
isNotEqualTo(0)withisNotZero() - Replace
isNotEqualTo(0)withisNotZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJByteRulesRecipes$AbstractByteAssertIsOneRecipe
- Replace
isEqualTo(1)withisOne() - Replace
isEqualTo(1)withisOne().
- Replace
- org.openrewrite.java.testing.assertj.AssertJByteRulesRecipes$AbstractByteAssertIsZeroRecipe
- Replace
isEqualTo(0)withisZero() - Replace
isEqualTo(0)withisZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJDoubleRulesRecipes
- Adopt AssertJ Double Assertions
- Adopt AssertJ Double Assertions. Favor semantically explicit methods (e.g.
myDouble.isZero()overmyDouble.isEqualTo(0.0)).
- org.openrewrite.java.testing.assertj.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsCloseToWithOffsetRecipe
- Replace
isEqualTowithisCloseTo - Replace
isEqualTowithisCloseTowhenoffsetorpercentageis provided.
- Replace
- org.openrewrite.java.testing.assertj.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsEqualToRecipe
- Replace
isCloseTowithisEqualTo - Replace
isCloseTowithisEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsNotEqualToRecipe
- Replace
isNotCloseTowithisNotEqualTo - Replace
isNotCloseTowithisNotEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsNotZeroRecipe
- Replace
isNotEqualTo(0)withisNotZero() - Replace
isNotEqualTo(0)withisNotZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsOneRecipe
- Replace
isEqualTo(1)withisOne() - Replace
isEqualTo(1)withisOne().
- Replace
- org.openrewrite.java.testing.assertj.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsZeroRecipe
- Replace
isEqualTo(0)withisZero() - Replace
isEqualTo(0)withisZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJFloatRulesRecipes
- Adopt AssertJ Float Assertions
- Adopt AssertJ Float Assertions. Favor semantically explicit methods (e.g.
myFloat.isZero()overmyFloat.isEqualTo(0.0f)).
- org.openrewrite.java.testing.assertj.AssertJFloatRulesRecipes$AbstractFloatAssertIsCloseToWithOffsetRecipe
- Replace
isEqualTowithisCloseTo - Replace
isEqualTowithisCloseTowhenoffsetorpercentageis provided.
- Replace
- org.openrewrite.java.testing.assertj.AssertJFloatRulesRecipes$AbstractFloatAssertIsEqualToRecipe
- Replace
isCloseTowithisEqualTo - Replace
isCloseTowithisEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJFloatRulesRecipes$AbstractFloatAssertIsNotEqualToRecipe
- Replace
isNotCloseTowithisNotEqualTo - Replace
isNotCloseTowithisNotEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJFloatRulesRecipes$AbstractFloatAssertIsNotZeroRecipe
- Replace
isNotEqualTo(0)withisNotZero() - Replace
isNotEqualTo(0)withisNotZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJFloatRulesRecipes$AbstractFloatAssertIsOneRecipe
- Replace
isEqualTo(1)withisOne() - Replace
isEqualTo(1)withisOne().
- Replace
- org.openrewrite.java.testing.assertj.AssertJFloatRulesRecipes$AbstractFloatAssertIsZeroRecipe
- Replace
isEqualTo(0)withisZero() - Replace
isEqualTo(0)withisZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJIntegerRulesRecipes
- Adopt AssertJ Integer Assertions
- Adopt AssertJ Integer Assertions. Favor semantically explicit methods (e.g.
myInteger.isZero()overmyInteger.isEqualTo(0)).
- org.openrewrite.java.testing.assertj.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsEqualToRecipe
- Replace
isCloseTowithisEqualTo - Replace
isCloseTowithisEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsNotEqualToRecipe
- Replace
isNotCloseTowithisNotEqualTo - Replace
isNotCloseTowithisNotEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsNotZeroRecipe
- Replace
isNotEqualTo(0)withisNotZero() - Replace
isNotEqualTo(0)withisNotZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsOneRecipe
- Replace
isEqualTo(1)withisOne() - Replace
isEqualTo(1)withisOne().
- Replace
- org.openrewrite.java.testing.assertj.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsZeroRecipe
- Replace
isEqualTo(0)withisZero() - Replace
isEqualTo(0)withisZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJLongRulesRecipes
- Adopt AssertJ Long Assertions
- Adopt AssertJ Long Assertions. Favor semantically explicit methods (e.g.
myLong.isZero()overmyLong.isEqualTo(0)).
- org.openrewrite.java.testing.assertj.AssertJLongRulesRecipes$AbstractLongAssertIsEqualToRecipe
- Replace
isCloseTowithisEqualTo - Replace
isCloseTowithisEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJLongRulesRecipes$AbstractLongAssertIsNotEqualToRecipe
- Replace
isNotCloseTowithisNotEqualTo - Replace
isNotCloseTowithisNotEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJLongRulesRecipes$AbstractLongAssertIsNotZeroRecipe
- Replace
isNotEqualTo(0)withisNotZero() - Replace
isNotEqualTo(0)withisNotZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJLongRulesRecipes$AbstractLongAssertIsOneRecipe
- Replace
isEqualTo(1)withisOne() - Replace
isEqualTo(1)withisOne().
- Replace
- org.openrewrite.java.testing.assertj.AssertJLongRulesRecipes$AbstractLongAssertIsZeroRecipe
- Replace
isEqualTo(0)withisZero() - Replace
isEqualTo(0)withisZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJShortRulesRecipes
- Adopt AssertJ Short Assertions
- Adopt AssertJ Short Assertions. Favor semantically explicit methods (e.g.
myShort.isZero()overmyShort.isEqualTo(0)).
- org.openrewrite.java.testing.assertj.AssertJShortRulesRecipes$AbstractShortAssertIsEqualToRecipe
- Replace
isCloseTowithisEqualTo - Replace
isCloseTowithisEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJShortRulesRecipes$AbstractShortAssertIsNotEqualToRecipe
- Replace
isNotCloseTowithisNotEqualTo - Replace
isNotCloseTowithisNotEqualTowhenoffsetorpercentageis zero.
- Replace
- org.openrewrite.java.testing.assertj.AssertJShortRulesRecipes$AbstractShortAssertIsNotZeroRecipe
- Replace
isNotEqualTo(0)withisNotZero() - Replace
isNotEqualTo(0)withisNotZero().
- Replace
- org.openrewrite.java.testing.assertj.AssertJShortRulesRecipes$AbstractShortAssertIsOneRecipe
- Replace
isEqualTo(1)withisOne() - Replace
isEqualTo(1)withisOne().
- Replace
- org.openrewrite.java.testing.assertj.AssertJShortRulesRecipes$AbstractShortAssertIsZeroRecipe
- Replace
isEqualTo(0)withisZero() - Replace
isEqualTo(0)withisZero().
- Replace
- org.openrewrite.java.testing.assertj.CollapseConsecutiveAssertThatStatements
- Collapse consecutive
assertThatstatements - Collapse consecutive
assertThatstatements into singleassertThatchained statement. This recipe ignoresassertThatstatements that have method invocation as parameter.
- Collapse consecutive
- org.openrewrite.java.testing.assertj.IsEqualToIgnoringMillisToIsCloseToRecipe
- Replace
AbstractDateAssert#isEqualToIgnoringMillis(java.util.Date)byby isCloseTo(Date, long) isEqualToIgnoringMillis()is deprecated in favor ofisCloseTo().
- Replace
- org.openrewrite.java.testing.assertj.JUnitAssertArrayEqualsToAssertThat
- JUnit
assertArrayEqualsto assertJ - Convert JUnit-style
assertArrayEquals()to AssertJ'sassertThat().contains()equivalents.
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertEqualsToAssertThat
- JUnit
assertEqualsto AssertJ - Convert JUnit-style
assertEquals()to AssertJ'sassertThat().isEqualTo().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertFalseToAssertThat
- JUnit
assertFalseto AssertJ - Convert JUnit-style
assertFalse()to AssertJ'sassertThat().isFalse().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertInstanceOfToAssertThat
- JUnit
assertInstanceOfto AssertJ - Convert JUnit-style
assertInstanceOf()to AssertJ'sassertThat().isInstanceOf().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertNotEqualsToAssertThat
- JUnit
assertNotEqualsto AssertJ - Convert JUnit-style
assertNotEquals()to AssertJ'sassertThat().isNotEqualTo().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertNotNullToAssertThat
- JUnit
assertNotNullto AssertJ - Convert JUnit-style
assertNotNull()to AssertJ'sassertThat().isNotNull().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertNullToAssertThat
- JUnit
assertNullto AssertJ - Convert JUnit-style
assertNull()to AssertJ'sassertThat().isNull().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertSameToAssertThat
- JUnit
assertSameto AssertJ - Convert JUnit-style
assertSame()to AssertJ'sassertThat().isSameAs().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitAssertThrowsToAssertExceptionType
- JUnit AssertThrows to AssertJ exceptionType
- Convert
JUnit#AssertThrowstoAssertJ#assertThatExceptionOfTypeto allow for chained assertions on the thrown exception.
- org.openrewrite.java.testing.assertj.JUnitAssertTrueToAssertThat
- JUnit
assertTrueto AssertJ - Convert JUnit-style
assertTrue()to AssertJ'sassertThat().isTrue().
- JUnit
- org.openrewrite.java.testing.assertj.JUnitFailToAssertJFail
- JUnit fail to AssertJ
- Convert JUnit-style
fail()to AssertJ'sfail().
- org.openrewrite.java.testing.assertj.JUnitTryFailToAssertThatThrownBy
- Convert try-catch-fail blocks to AssertJ's assertThatThrownBy
- Replace try-catch blocks where the try block ends with a
fail()statement and the catch block optionally contains assertions, with AssertJ'sassertThatThrownBy().
- org.openrewrite.java.testing.assertj.SimplifyAssertJAssertion
- Simplify AssertJ assertions with literal arguments
- Simplify AssertJ assertions by replacing them with more expressive dedicated assertions.
- 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.assertj.SimplifyHasSizeAssertion
- Simplify AssertJ assertions with
hasSizeargument - Simplify AssertJ assertions by replacing
hasSizewithhasSameSizeAsdedicated assertions.
- Simplify AssertJ assertions with
- org.openrewrite.java.testing.assertj.SimplifyRedundantAssertJChains
- Simplify redundant AssertJ assertion chains
- Removes redundant AssertJ assertions when chained methods already provide the same or stronger guarantees.
- org.openrewrite.java.testing.assertj.SimplifySequencedCollectionAssertions
- Simplify AssertJ assertions on SequencedCollection
- Simplify AssertJ assertions on SequencedCollection by using dedicated assertion methods. For example,
assertThat(sequencedCollection.getLast())can be simplified toassertThat(sequencedCollection).last().
- org.openrewrite.java.testing.assertj.SimplifyStreamMapToExtracting
- Simplify
assertThat(collection.stream().map(...))toassertThat(collection).extracting(...) - Simplifies AssertJ assertions that use
stream().map()to extract values from a collection by using the dedicatedextracting()method instead. This makes the assertion more readable and leverages AssertJ's built-in extraction capabilities.
- Simplify
- org.openrewrite.java.testing.cleanup.AssertEqualsBooleanToAssertBoolean
- Replace JUnit
assertEquals(false, <boolean>)toassertFalse(<boolean>)/assertTrue(<boolean>) - Using
assertFalseorassertTrueis simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertEqualsNullToAssertNull
assertEquals(a, null)toassertNull(a)- Using
assertNull(a)is simpler and more clear.
- org.openrewrite.java.testing.cleanup.AssertFalseEqualsToAssertNotEquals
- Replace JUnit
assertFalse(a.equals(b))toassertNotEquals(a,b) - Using
assertNotEquals(a,b)is simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertFalseNegationToAssertTrue
- Replace JUnit
assertFalse(!<boolean>)toassertTrue(<boolean>) - Using
assertTrueis simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertFalseNullToAssertNotNull
- Replace JUnit
assertFalse(a == null)toassertNotNull(a) - Using
assertNotNull(a)is simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertLiteralBooleanRemovedRecipe
- Remove JUnit
assertTrue(true)andassertFalse(false) - These assertions are redundant and do not provide any value. They can be safely removed.
- Remove JUnit
- org.openrewrite.java.testing.cleanup.AssertLiteralBooleanToFailRecipes
- Replace JUnit
assertTrue(false, "reason")andassertFalse(true, "reason")withfail("reason") - Using fail is more direct and clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertLiteralBooleanToFailRecipes$WithMessageRecipe
- Refaster template
AssertLiteralBooleanToFail.WithMessage - Recipe created for the following Refaster template:
java static class WithMessage { @BeforeTemplate void assertFalseBefore(String message) { assertFalse(true, message); } @BeforeTemplate void assertTrueBefore(String message) { assertTrue(false, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(String message) { fail(message); } }.
- Refaster template
- org.openrewrite.java.testing.cleanup.AssertLiteralBooleanToFailRecipes$WithoutMessageRecipe
- Refaster template
AssertLiteralBooleanToFail.WithoutMessage - Recipe created for the following Refaster template:
java static class WithoutMessage { @BeforeTemplate void assertFalseBefore() { assertFalse(true); } @BeforeTemplate void assertTrueBefore() { assertTrue(false); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after() { fail(); } }.
- Refaster template
- org.openrewrite.java.testing.cleanup.AssertNotEqualsBooleanToAssertBoolean
- Replace JUnit
assertNotEquals(false, <boolean>)toassertFalse(<boolean>)/assertTrue(<boolean>) - Using
assertFalseorassertTrueis simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertTrueComparisonToAssertEquals
- Junit
assertTrue(a == b)toassertEquals(a,b) - Using
assertEquals(a,b)is simpler and more clear.
- Junit
- org.openrewrite.java.testing.cleanup.AssertTrueEqualsToAssertEquals
- Replace JUnit
assertTrue(a.equals(b))toassertEquals(a,b) - Using
assertEquals(a,b)is simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertTrueNegationToAssertFalse
- Replace JUnit
assertTrue(!<boolean>)toassertFalse(<boolean>) - Using
assertFalseis simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertTrueNullToAssertNull
- Replace JUnit
assertTrue(a == null)toassertNull(a) - Using
assertNull(a)is simpler and more clear.
- Replace JUnit
- org.openrewrite.java.testing.cleanup.AssertionsArgumentOrder
- Assertion arguments should be passed in the correct order
- Assertions such as
org.junit.Assert.assertEqualsexpect the first argument to be the expected value and the second argument to be the actual value; fororg.testng.Assert, it’s the other way around. This recipe detectsJ.Literal,J.NewArray, andjava.util.Iterablearguments swapping them if necessary so that the error messages won't be confusing.
- org.openrewrite.java.testing.cleanup.KotlinTestMethodsShouldReturnUnit
- Kotlin test methods should have return type
Unit - Kotlin test methods annotated with
@Test,@ParameterizedTest,@RepeatedTest,@TestTemplateshould haveUnitreturn type. Other return types can cause test discovery issues, and warnings as of JUnit 5.13+. This recipe changes the return type toUnitand removesreturnstatements.
- Kotlin test methods should have return type
- org.openrewrite.java.testing.cleanup.RemoveEmptyTests
- Remove empty tests without comments
- Removes empty methods with a
@Testannotation if the body does not have comments.
- org.openrewrite.java.testing.cleanup.RemoveTestPrefix
- Remove
testprefix from JUnit 5 tests - Remove
testfrom methods with@Test,@ParameterizedTest,@RepeatedTestor@TestFactory. They no longer have to prefix test to be usable by JUnit 5.
- Remove
- org.openrewrite.java.testing.cleanup.SimplifyTestThrows
- Simplify
throwsstatements of tests - Replace all thrown exception classes of test method signatures by
Exception.
- Simplify
- org.openrewrite.java.testing.cleanup.TestMethodsShouldBeVoid
- Test methods should have void return type
- Test methods annotated with
@Test,@ParameterizedTest,@RepeatedTest,@TestTemplateshould havevoidreturn type. Non-void return types can cause test discovery issues, and warnings as of JUnit 5.13+. This recipe changes the return type tovoidand removesreturnstatements.
- 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
publicvisibility of JUnit 5 tests - Remove
publicand optionallyprotectedmodifiers 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.
- Remove
- org.openrewrite.java.testing.dbrider.ExecutionListenerToDbRiderAnnotation
- Migrate the
DBRiderTestExecutionListenerto the@DBRiderannotation - Migrate the
DBRiderTestExecutionListenerto the@DBRiderannotation. This recipe is useful when migrating from JUnit 4dbrider-springto JUnit 5dbrider-junit5.
- Migrate the
- org.openrewrite.java.testing.easymock.EasyMockVerifyToMockitoVerify
- Replace EasyMock
verifycalls with Mockitoverifycalls - Replace
EasyMock.verify(dependency)with individualMockito.verify(dependency).method()calls based on expected methods.
- Replace EasyMock
- org.openrewrite.java.testing.easymock.RemoveExtendsEasyMockSupport
- Migrate Test classes that extend
org.easymock.EasyMockSupportto use Mockito - Modify test classes by removing extends EasyMockSupport and replacing EasyMock methods with Mockito equivalents.
- Migrate Test classes that extend
- org.openrewrite.java.testing.hamcrest.AssertThatBooleanToAssertJ
- Migrate Hamcrest
assertThat(boolean, Matcher)to AssertJ - Replace Hamcrest
assertThat(String, boolean)with AssertJassertThat(boolean).as(String).isTrue().
- Migrate Hamcrest
- org.openrewrite.java.testing.hamcrest.HamcrestInstanceOfToJUnit5
- Migrate from Hamcrest
instanceOfmatcher to JUnit 5 - Migrate from Hamcrest
instanceOfandisAmatcher to JUnit5assertInstanceOfassertion.
- Migrate from Hamcrest
- org.openrewrite.java.testing.hamcrest.HamcrestIsMatcherToAssertJ
- Migrate Hamcrest
is(Object)to AssertJ - Migrate Hamcrest
is(Object)to AssertJAssertions.assertThat(..).
- Migrate Hamcrest
- org.openrewrite.java.testing.hamcrest.HamcrestMatcherToAssertJ
- Migrate from Hamcrest
Matcherto AssertJ - Migrate from Hamcrest
Matcherto AssertJ assertions.
- Migrate from Hamcrest
- org.openrewrite.java.testing.hamcrest.HamcrestMatcherToJUnit5
- Migrate from Hamcrest
Matcherto JUnit 5 - Migrate from Hamcrest
Matcherto JUnit 5 assertions.
- Migrate from Hamcrest
- org.openrewrite.java.testing.hamcrest.HamcrestNotMatcherToAssertJ
- Migrate Hamcrest
not(Matcher)to AssertJ - Migrate from Hamcrest
not(Matcher)to AssertJ assertions.
- Migrate Hamcrest
- org.openrewrite.java.testing.hamcrest.HamcrestOfMatchersToAssertJ
- Migrate
anyOfHamcrest Matcher to AssertJ - Migrate the
anyOfHamcrest Matcher to AssertJ'ssatisfiesAnyOfassertion.
- Migrate
- org.openrewrite.java.testing.hamcrest.RemoveIsMatcher
- Remove Hamcrest
is(Matcher) - Remove Hamcrest
is(Matcher)ahead of migration.
- Remove Hamcrest
- org.openrewrite.java.testing.jmockit.JMockitAnnotatedArgumentToMockito
- Convert JMockit
@Mockedand@Injectableannotated arguments - Convert JMockit
@Mockedand@Injectableannotated arguments into Mockito statements.
- Convert JMockit
- org.openrewrite.java.testing.jmockit.JMockitBlockToMockito
- Rewrite JMockit Expectations, NonStrictExpectations, Verifications, VerificationsInOrder, FullVerifications
- Rewrites JMockit
Expectations, NonStrictExpectations, Verifications, VerificationsInOrder, FullVerificationsblocks to Mockito statements.
- org.openrewrite.java.testing.jmockit.JMockitMockUpToMockito
- Rewrite JMockit MockUp to Mockito statements
- Rewrites JMockit
MockUpblocks to Mockito statements. This recipe will not rewrite private methods in MockUp.
- org.openrewrite.java.testing.junit5.AddHamcrestJUnitDependency
- Add Hamcrest JUnit dependency
- Add Hamcrest JUnit dependency only if JUnit 4's
assertThatorassumeThatis used.
- org.openrewrite.java.testing.junit5.AddJupiterDependencies
- Add JUnit Jupiter dependencies
- Adds JUnit Jupiter dependencies to a Maven or Gradle project. JUnit Jupiter can be added either with the artifact
junit-jupiter, or both ofjunit-jupiter-apiandjunit-jupiter-engine. This addsjunit-jupiterdependency unlessjunit-jupiter-apiorjunit-jupiter-engineare already present.
- org.openrewrite.java.testing.junit5.AddMissingNested
- JUnit 5 inner test classes should be annotated with
@Nested - Adds
@Nestedto inner classes that contain JUnit 5 tests.
- JUnit 5 inner test classes should be annotated with
- org.openrewrite.java.testing.junit5.AddMissingTestBeforeAfterAnnotations
- Add missing
@BeforeEach,@AfterEach,@Testto overriding methods - Adds
@BeforeEach,@AfterEach,@Testto methods overriding superclass methods if the annotations are present on the superclass method.
- Add missing
- org.openrewrite.java.testing.junit5.AddParameterizedTestAnnotation
- Add missing
@ParameterizedTestannotation when@ValueSourceis used or replace@Testwith@ParameterizedTest - Add missing
@ParameterizedTestannotation when@ValueSourceis used or replace@Testwith@ParameterizedTest.
- Add missing
- org.openrewrite.java.testing.junit5.AssertThrowsOnLastStatement
- Applies JUnit 5
assertThrowson last statement in lambda block only - Applies JUnit 5
assertThrowson last statement in lambda block only. In rare cases may cause compilation errors if the lambda uses effectively non final variables. In some cases, tests might fail if earlier statements in the lambda block throw exceptions.
- Applies JUnit 5
- org.openrewrite.java.testing.junit5.AssertToAssertions
- JUnit 4
AssertTo JUnit JupiterAssertions - Change JUnit 4's
org.junit.Assertinto JUnit Jupiter'sorg.junit.jupiter.api.Assertions.
- JUnit 4
- org.openrewrite.java.testing.junit5.AssertTrueInstanceofToAssertInstanceOf
assertTrue(x instanceof y)toassertInstanceOf(y.class, x)- Migration of JUnit4 (or potentially JUnit5) test case in form of assertTrue(x instanceof y) to assertInstanceOf(y.class, x).
- org.openrewrite.java.testing.junit5.CategoryToTag
- JUnit 4
@Categoryto JUnit Jupiter@Tag - Transforms the JUnit 4
@Category, which can list multiple categories, into one@Tagannotation per category listed.
- JUnit 4
- org.openrewrite.java.testing.junit5.CleanupJUnitImports
- Cleanup JUnit imports
- Removes unused
org.junitimport symbols.
- org.openrewrite.java.testing.junit5.CsvSourceToValueSource
- Replace
@CsvSourcewith@ValueSourcefor single method arguments - Replaces JUnit 5's
@CsvSourceannotation with@ValueSourcewhen the parameterized test has only a single method argument.
- Replace
- org.openrewrite.java.testing.junit5.EnclosedToNested
- JUnit 4
@RunWith(Enclosed.class)to JUnit Jupiter@Nested - Removes the
Enclosedspecification from a class, withNestedadded to its inner classes byAddMissingNested.
- JUnit 4
- org.openrewrite.java.testing.junit5.EnvironmentVariables
- Migrate JUnit 4 environmentVariables rule to JUnit 5 system stubs extension
- Replaces usage of the JUnit 4
@Rule EnvironmentVariableswith the JUnit 5-compatibleSystemStubsExtensionand@SystemStub EnvironmentVariablesfrom the System Stubs library.
- org.openrewrite.java.testing.junit5.ExpectedExceptionToAssertThrows
- JUnit 4
ExpectedExceptionTo JUnit Jupiter'sassertThrows() - Replace usages of JUnit 4's
@Rule ExpectedExceptionwith JUnit 5'sAssertions.assertThrows().
- JUnit 4
- org.openrewrite.java.testing.junit5.GradleUseJunitJupiter
- Gradle
Testuse JUnit Jupiter - By default Gradle's
Testtasks use JUnit 4. GradleTesttasks must be configured withuseJUnitPlatform()to run JUnit Jupiter tests. This recipe adds theuseJUnitPlatform()method call to theTesttask configuration.
- Gradle
- org.openrewrite.java.testing.junit5.HandleExternalResourceRules
- Handle the usage of ExternalResourceRule fields using @ExtendWith(ExternalResourceSupport.class)
- Handles the usage of the ExternalResourceRule fields by adding the @ExtendWith(ExternalResourceSupport.class) annotation to the test class.
- org.openrewrite.java.testing.junit5.JUnitParamsRunnerToParameterized
- Pragmatists
@RunWith(JUnitParamsRunner.class)to JUnit Jupiter@Parameterizedtests - Convert Pragmatists Parameterized test to the JUnit Jupiter ParameterizedTest equivalent.
- Pragmatists
- org.openrewrite.java.testing.junit5.LifecycleNonPrivate
- Make lifecycle methods non private
- Make JUnit 5's
@AfterAll,@AfterEach,@BeforeAlland@BeforeEachnon private.
- org.openrewrite.java.testing.junit5.MigrateJUnitTestCase
- Migrate JUnit 4
TestCaseto JUnit Jupiter - Convert JUnit 4
TestCaseto JUnit Jupiter.
- Migrate JUnit 4
- org.openrewrite.java.testing.junit5.MockitoJUnitToMockitoExtension
- JUnit 4
MockitoJUnitto JUnit JupiterMockitoExtension - Replaces
MockitoJUnitrules withMockitoExtension.
- JUnit 4
- org.openrewrite.java.testing.junit5.ParameterizedRunnerToParameterized
- JUnit 4
@RunWith(Parameterized.class)to JUnit Jupiter parameterized tests - Convert JUnit 4 parameterized runner the JUnit Jupiter parameterized test equivalent.
- JUnit 4
- org.openrewrite.java.testing.junit5.RemoveDuplicateTestTemplates
- Remove duplicates uses of @TestTemplate implementations for a single method
- Remove duplicates uses of @TestTemplate implementations for a single method.
- org.openrewrite.java.testing.junit5.RemoveObsoleteRunners
- Remove JUnit 4
@RunWithannotations that do not require an@ExtendsWithreplacement - Some JUnit 4
@RunWithannotations do not require replacement with an equivalent JUnit Jupiter@ExtendsWithannotation. This can be used to remove those runners that either do not have a JUnit Jupiter equivalent or do not require a replacement as part of JUnit 4 to 5 migration.
- Remove JUnit 4
- org.openrewrite.java.testing.junit5.RemoveTryCatchFailBlocks
- Replace
fail()intry-catchblocks withAssertions.assertDoesNotThrow(() -> { ... }) - Replace
try-catchblocks wherecatchmerely contains afail()forfail(String)statement withAssertions.assertDoesNotThrow(() -> { ... }).
- Replace
- org.openrewrite.java.testing.junit5.RunnerToExtension
- JUnit 4
@RunWithto JUnit Jupiter@ExtendWith - Replace runners with the JUnit Jupiter extension equivalent.
- JUnit 4
- org.openrewrite.java.testing.junit5.TempDirNonFinal
- Make
@TempDirfields non final - Make JUnit 5's
org.junit.jupiter.api.io.TempDirfields non final.
- Make
- org.openrewrite.java.testing.junit5.TemporaryFolderToTempDir
- Use JUnit Jupiter
@TempDir - Translates JUnit 4's
org.junit.rules.TemporaryFolderinto JUnit 5'sorg.junit.jupiter.api.io.TempDir.
- Use JUnit Jupiter
- org.openrewrite.java.testing.junit5.TestRuleToTestInfo
- JUnit TestName @Rule to JUnit Jupiter TestInfo
- Replace usages of JUnit 4's
@Rule TestNamewith JUnit 5's TestInfo.
- org.openrewrite.java.testing.junit5.TimeoutRuleToClassAnnotation
- JUnit 4
@Rule Timeoutto JUnit Jupiter'sTimeout - Replace usages of JUnit 4's
@Rule Timeoutwith JUnit 5Timeoutclass annotation.
- JUnit 4
- org.openrewrite.java.testing.junit5.UpdateBeforeAfterAnnotations
- Migrate JUnit 4 lifecycle annotations to JUnit Jupiter
- Replace JUnit 4's
@Before,@BeforeClass,@After, and@AfterClassannotations with their JUnit Jupiter equivalents.
- org.openrewrite.java.testing.junit5.UpdateMockWebServer
- OkHttp 3.x
MockWebServer@RuleTo 4.xMockWebServer - Replace usages of okhttp3 3.x
@RuleMockWebServer with 4.xMockWebServer.
- OkHttp 3.x
- org.openrewrite.java.testing.junit5.UpdateTestAnnotation
- Migrate JUnit 4
@Testannotations to JUnit 5 - Update usages of JUnit 4's
@org.junit.Testannotation to JUnit 5'sorg.junit.jupiter.api.Testannotation.
- Migrate JUnit 4
- org.openrewrite.java.testing.junit5.UseAssertSame
- Use JUnit5's
assertSameorassertNotSameinstead ofassertTrue(... == ...) - Prefers the usage of
assertSameorassertNotSamemethods instead of using of vanillaassertTrueorassertFalsewith a boolean comparison.
- Use JUnit5's
- org.openrewrite.java.testing.junit5.UseTestMethodOrder
- Migrate from JUnit 4
@FixedMethodOrderto JUnit 5@TestMethodOrder - JUnit optionally allows test method execution order to be specified. This replaces JUnit 4 test execution ordering annotations with JUnit 5 replacements.
- Migrate from JUnit 4
- org.openrewrite.java.testing.junit5.UseWiremockExtension
- Use wiremock extension
- As of 2.31.0, wiremock supports JUnit 5 via an extension.
- org.openrewrite.java.testing.junit6.MigrateMethodOrdererAlphanumeric
- Migrate
MethodOrderer.AlphanumerictoMethodOrderer.MethodName - JUnit 6 removed the
MethodOrderer.Alphanumericclass. This recipe migrates usages toMethodOrderer.MethodNamewhich provides similar functionality.
- Migrate
- org.openrewrite.java.testing.junit6.MinimumJreConditions
- Migrate JUnit JRE conditions
- This recipe will: - Remove tests that are only active on JREs that are below the specified version. - Adjust ranges to use minimum the specified version.
- org.openrewrite.java.testing.junit6.RemoveInterceptDynamicTest
- Remove
InvocationInterceptor.interceptDynamicTest - JUnit 6 removed the
interceptDynamicTest(Invocation, ExtensionContext)method fromInvocationInterceptor. This recipe removes implementations of this deprecated method.
- Remove
- org.openrewrite.java.testing.mockito.AddMockitoExtensionIfAnnotationsUsed
- Adds Mockito extensions to Mockito tests
- Adds
@ExtendWith(MockitoExtension.class)to tests using@Mockor@Captor.
- org.openrewrite.java.testing.mockito.AnyStringToNullable
- Replace Mockito 1.x
anyString()withnullable(String.class) - Since Mockito 2.10
anyString()no longer matches null values. Usenullable(Class)instead.
- Replace Mockito 1.x
- org.openrewrite.java.testing.mockito.AnyToNullable
- Replace Mockito 1.x
anyString()/any()withnullable(Class) - Since Mockito 2.10
anyString()andany()no longer matches null values. Usenullable(Class)instead.
- Replace Mockito 1.x
- org.openrewrite.java.testing.mockito.CleanupMockitoImports
- Cleanup Mockito imports
- Removes unused
org.mockitoimport symbols, unless its possible they are associated with method invocations having null or unknown type information.
- org.openrewrite.java.testing.mockito.CleanupPowerMockImports
- Cleanup PowerMock imports
- Removes unused
org.powermockimport symbols.
- org.openrewrite.java.testing.mockito.CloseUnclosedStaticMocks
- Close unclosed static mocks
- Ensures that all
mockStaticcalls are properly closed. IfmockStaticis in lifecycle methods like@BeforeEachor@BeforeAll, creates a class variable and closes it in@AfterEachor@AfterAll. IfmockStaticis inside a test method, wraps it in a try-with-resources block.
- org.openrewrite.java.testing.mockito.MockUtilsToStatic
- Use static form of Mockito
MockUtil - Best-effort attempt to remove Mockito
MockUtilinstances.
- Use static form of Mockito
- org.openrewrite.java.testing.mockito.MockitoJUnitRunnerSilentToExtension
- JUnit 4 MockitoJUnitRunner.Silent to JUnit Jupiter MockitoExtension with LENIENT settings
- Replace
@RunWith(MockitoJUnitRunner.Silent.class)with@ExtendWith(MockitoExtension.class)and@MockitoSettings(strictness = Strictness.LENIENT).
- org.openrewrite.java.testing.mockito.MockitoJUnitRunnerToExtension
- Replace JUnit 4 MockitoJUnitRunner with junit-jupiter MockitoExtension
- Replace JUnit 4 MockitoJUnitRunner annotations with JUnit 5
@ExtendWith(MockitoExtension.class)using the appropriate strictness levels (LENIENT, WARN, STRICT_STUBS).
- org.openrewrite.java.testing.mockito.MockitoWhenOnStaticToMockStatic
- Replace
Mockito.whenon static (non mock) with try-with-resource with MockedStatic - Replace
Mockito.whenon static (non mock) with try-with-resource with MockedStatic as Mockito4 no longer allows this. For JUnit 4/5 & TestNG: When@Before*is used, aclosecall is added to the corresponding@After*method. This change moves away from implicit bytecode manipulation for static method stubbing, making mocking behavior more explicit and scoped to avoid unintended side effects.
- Replace
- org.openrewrite.java.testing.mockito.PowerMockitoMockStaticToMockito
- Replace
PowerMock.mockStatic()withMockito.mockStatic() - Replaces
PowerMockito.mockStatic()byMockito.mockStatic(). Removes the@PrepareForTestannotation.
- Replace
- org.openrewrite.java.testing.mockito.PowerMockitoWhenNewToMockito
- Replace
PowerMockito.whenNewwith Mockito counterpart - Replaces
PowerMockito.whenNewcalls with respectiveMockito.whenConstructedcalls.
- Replace
- org.openrewrite.java.testing.mockito.RemoveInitMocksIfRunnersSpecified
- Remove
MockitoAnnotations.initMocks(this)if specified JUnit runners - Remove
MockitoAnnotations.initMocks(this)if specified class-level JUnit runners@RunWith(MockitoJUnitRunner.class)or@ExtendWith(MockitoExtension.class).
- Remove
- org.openrewrite.java.testing.mockito.RemoveTimesZeroAndOne
- Remove
Mockito.times(0)andMockito.times(1) - Remove
Mockito.times(0)andMockito.times(1)fromMockito.verify()calls.
- Remove
- org.openrewrite.java.testing.mockito.ReplaceInitMockToOpenMock
- Replace
MockitoAnnotations.initMocks(this)toMockitoAnnotations.openMocks(this) - Replace
MockitoAnnotations.initMocks(this)toMockitoAnnotations.openMocks(this)and generateAutoCloseablemocks.
- Replace
- 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.java.testing.mockito.VerifyZeroToNoMoreInteractions
- Replace
verifyZeroInteractions()withverifyNoMoreInteractions() - Replaces
verifyZeroInteractions()withverifyNoMoreInteractions()in Mockito tests when migration when using a Mockito version < 3.x.
- Replace
- org.openrewrite.java.testing.testcontainers.AddTestcontainersAnnotations
- Adopt
@Containerand add@Testcontainers - Convert Testcontainers
@Rule/@ClassRuleto JUnit 5@Containerand add@Testcontainers.
- Adopt
- org.openrewrite.java.testing.testcontainers.ConvertToRawType
- Remove parameterized type arguments from a Java class
- Convert parameterized types of a specified Java class to their raw types.
- org.openrewrite.java.testing.testcontainers.ExplicitContainerImage
- Add image argument to container constructor
- Set the image to use for a container explicitly if unset, rather than relying on the default image for the container class.
- org.openrewrite.java.testing.testng.TestNgAssertEqualsToAssertThat
- TestNG
assertEqualsto AssertJ - Convert TestNG-style
assertEquals()to AssertJ'sassertThat().isEqualTo().
- TestNG
- org.openrewrite.java.testing.testng.TestNgAssertNotEqualsToAssertThat
- TestNG
assertNotEqualsto AssertJ - Convert TestNG-style
assertNotEquals()to AssertJ'sassertThat().isNotEqualTo().
- TestNG
- org.openrewrite.java.testing.truth.TruthAssertToAssertThat
- Convert Truth
assert_()to AssertJ - Converts Google Truth's
assert_()method to AssertJ's standard assertion pattern.
- Convert Truth
- org.openrewrite.java.testing.truth.TruthAssertWithMessageToAssertJ
- Convert Truth
assertWithMessageto AssertJ - Converts Google Truth's
assertWithMessage().that()pattern to AssertJ'sassertThat().as()pattern.
- Convert Truth
- org.openrewrite.java.testing.truth.TruthCustomSubjectsToAssertJ
- Migrate Truth custom subjects to AssertJ
- Marks Google Truth's
assertAbout()usage for manual review as AssertJ handles custom assertions differently.
- org.openrewrite.java.testing.truth.TruthThrowableAssertions
- Convert Truth Throwable assertions to AssertJ
- Converts Google Truth's Throwable assertion chains like
hasMessageThat().contains()to AssertJ equivalents.
org.openrewrite.recipe:rewrite-third-party
License: Apache License Version 2.0
1408 recipes
- com.oracle.weblogic.rewrite.ChangeJAXBBindAPIDependencyScope
- Change the jakarta.xml.bind-api dependency to scope provided when jakartaee-api 9.x is provided.
- This recipe will change the jakarta.xml.bind-api dependency scope to provided when jakarta.jakartaee-api version 9.x is provided in WebLogic 15.1.1. This prevents the jakarta.xml.bind-api jar from being deployed to WebLogic which can cause class conflicts.
- com.oracle.weblogic.rewrite.ChangeJakartaInjectAPIDependencyScope
- Change the jakarta.inject-api dependency to scope provided when jakartaee-api 9.x is provided.
- This recipe will change the jakarta.inject-api dependency scope to provided when jakarta.jakartaee-api version 9.x is provided in WebLogic 15.1.1. This prevents the jakarta.inject-api jar from being deployed to WebLogic which can cause class conflicts.
- com.oracle.weblogic.rewrite.ChangeJakartaWebServiceRSAPIDependencyScope
- Change the jakarta.ws.rs-api dependency to scope provided when jakartaee-api 9.x is provided.
- This recipe will change the jakarta.ws.rs-api dependency scope to provided when jakarta.jakartaee-api version 9.x is provided in WebLogic 15.1.1. This prevents the jakarta.ws.rs-api jar from being deployed to WebLogic which can cause class conflicts.
- com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1412
- Check and Comment Out Deprecations removed on WebLogic version 14.1.2
- This recipe will check and comment out deprecations on WebLogic version 14.1.2.
- com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1511
- Check and Comment Out Deprecations removed on WebLogic version 15.1.1
- This recipe will check and comment out deprecations on WebLogic version 15.1.1.
- com.oracle.weblogic.rewrite.FacesMigrationToJakartaFaces2x
- JSF 1.x to Jakarta Server Faces 2.3 on WebLogic 14.1.2 or older
- Jakarta EE 8 uses Faces 2.3 a major upgrade to Jakarta packages and XML namespaces. This recipe will migrate JSF 1.x to Jakarta Server Faces 2.3 on WebLogic 14.1.2 or older.
- com.oracle.weblogic.rewrite.JakartaEE9_1
- Migrate to Jakarta EE 9.1
- These recipes help with Migration to Jakarta EE 9.1, flagging and updating deprecated methods.
- com.oracle.weblogic.rewrite.MigrateWebLogicSchemasTo1412
- Migrate WebLogic Schemas to 14.1.2
- This recipe will migrate WebLogic schemas to 14.1.2
- com.oracle.weblogic.rewrite.MigrateWebLogicSchemasTo1511
- Migrate WebLogic Schemas to 15.1.1
- This recipe will migrate WebLogic schemas to 15.1.1
- com.oracle.weblogic.rewrite.OutputRecipeVersion
- Output Recipe Version
- Displays the version of the recipe after it runs.
- com.oracle.weblogic.rewrite.UpdateBuildToWebLogic1412
- Update the WebLogic version to 14.1.2
- This recipe will update the WebLogic version to 14.1.2 for Maven build.
- com.oracle.weblogic.rewrite.UpdateBuildToWebLogic1511
- Update the WebLogic version to 15.1.1
- This recipe will update the WebLogic version to 15.1.1 for Maven build.
- com.oracle.weblogic.rewrite.UpgradeTo1411
- Migrate to WebLogic 14.1.1
- This recipe will apply changes required for migrating to WebLogic 14.1.1
- com.oracle.weblogic.rewrite.UpgradeTo1412
- Migrate to WebLogic 14.1.2
- This recipe will apply changes required for migrating to WebLogic 14.1.2
- com.oracle.weblogic.rewrite.UpgradeTo1511
- Migrate to WebLogic 15.1.1
- This recipe will apply changes required for migrating to WebLogic 15.1.1 and Jakarta EE 9.1
- com.oracle.weblogic.rewrite.UpgradeWeblogicMavenPropertyVersion
- Upgrade
weblogic.versionMaven property - Set the Maven weblogic.version property according to a node-style semver selector or to a specific version number.
- Upgrade
- com.oracle.weblogic.rewrite.WebLogic1412JavaXmlBindMitigation
- Mitigation of Java XML Bind Deprecation in Java 11 vs WebLogic 14.1.2
- This recipe will mitigate the Javax XML Bind deprecation in Java 11 vs WebLogic 14.1.2
- com.oracle.weblogic.rewrite.WebLogicApplicationClientXmlNamespace1412
- Migrate xmlns entries in
application-client.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic Application Client schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicApplicationClientXmlNamespace1511
- Migrate xmlns entries in
application-client.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inapplication-client.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicApplicationXmlNamespace1412
- Migrate xmlns entries in
weblogic-application.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic Application schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicApplicationXmlNamespace1511
- Migrate xmlns entries in
weblogic-application.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-application.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicEjbJar32XmlNamespace1412
- Migrate xmlns entries in
weblogic-ejb-jar.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic EJB 3.2 schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicEjbJar32XmlNamespace1511
- Migrate xmlns entries in
weblogic-ejb-jar.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-ejb-jar.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicJdbcXmlNamespace1412
- Migrate xmlns entries in
*-jdbc.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic JDBC schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicJdbcXmlNamespace1511
- Migrate xmlns entries in
*-jdbc.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries in*-jdbc.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicJmsXmlNamespace1412
- Migrate xmlns entries in
*-jms.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic JMS schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicJmsXmlNamespace1511
- Migrate xmlns entries in
*-jms.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries in*-jms.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicPersistenceConfigurationXmlNamespace1412
- Migrate xmlns entries in
persistence-configuration.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic EJB 3.2 Persistence Configuration schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicPersistenceConfigurationXmlNamespace1511
- Migrate xmlns entries in
persistence-configuration.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inpersistence-configuration.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicPlanXmlNamespace1412
- Migrate xmlns entries in
plan.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic Plan schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicPlanXmlNamespace1511
- Migrate xmlns entries in
plan.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inplan.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicPubSubXmlNamespace1412
- Migrate xmlns entries in
weblogic-pubsub.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic PubSub schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicPubSubXmlNamespace1511
- Migrate xmlns entries in
weblogic-pubsub.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-pubsub.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicRaXmlNamespace1412
- Migrate xmlns entries in
weblogic-ra.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic Resource Adapter schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicRaXmlNamespace1511
- Migrate xmlns entries in
weblogic-ra.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-ra.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicRdbmsJarXmlNamespace1412
- Migrate xmlns entries in
weblogic-rdbms-jar.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic EJB 3.2 RDBMS schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicRdbmsJarXmlNamespace1511
- Migrate xmlns entries in
weblogic-rdbms-jar.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-rdbms-jar.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicResourceDeploymentPlanXmlNamespace1412
- Migrate xmlns entries in
resource-deployment-plan.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic Resource Deployment Plan schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicResourceDeploymentPlanXmlNamespace1511
- Migrate xmlns entries in
resource-deployment-plan.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inresource-deployment-plan.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWebServicesXmlNamespace1412
- Migrate xmlns entries in
weblogic-webservices.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic Web Services schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWebServicesXmlNamespace1511
- Migrate xmlns entries in
weblogic-webservices.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-webservices.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWebservicesPolicyRefXmlNamespace1412
- Migrate xmlns entries in
weblogic-webservices-policy.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic Web Service Policy Reference schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWebservicesPolicyRefXmlNamespace1511
- Migrate xmlns entries in
weblogic-webservices-policy.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-webservices-policy.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWseeClientHandlerChainXmlNamespace1412
- Migrate xmlns entries in
weblogic-wsee-clientHandlerChain.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic WSEE Client Handler Chains schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWseeClientHandlerChainXmlNamespace1511
- Migrate xmlns entries in
weblogic-wsee-clientHandlerChain.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-wsee-clientHandlerChain.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWseeStandaloneClientXmlNamespace1412
- Migrate xmlns entries in
weblogic-wsee-standaloneclient.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic WSEE Standalone Client schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicWseeStandaloneClientXmlNamespace1511
- Migrate xmlns entries in
weblogic-wsee-standaloneclient.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic-wsee-standaloneclient.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicXmlCreateIfNotExists1511
- Create
weblogic.xmlif it does not exist - This recipe will create a
weblogic.xmlfile with the WebLogic 15.1.1 namespace if it does not already exist.
- Create
- com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesJPA
- Add
prefer-application-packagesfor JPA inweblogic.xml - This recipe will add a
prefer-application-packagesentry for Jakarta Persistence inweblogic.xmlif it does not already exist.
- Add
- com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesSlf4j
- Add
prefer-application-packagesfor SLF4J inweblogic.xml - This recipe will add a
prefer-application-packagesentry for SLF4J inweblogic.xmlif it does not already exist.
- Add
- com.oracle.weblogic.rewrite.WebLogicXmlWebAppNamespace1412
- Migrate xmlns entries in
weblogic.xmlfiles to WebLogic 14.1.2 - Migrate xmlns entries in WebLogic schema files to WebLogic 14.1.2
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.WebLogicXmlWebAppNamespace1511
- Migrate xmlns entries in
weblogic.xmlfiles to WebLogic 15.1.1 - This recipe will update the
xmlnsentries inweblogic.xmlfiles to WebLogic 15.1.1
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.examples.AddImplicitTldFileWithTaglib2_1
- Add implicit TLD with taglib 2.1
- Add
implicit.tldfile with taglib 2.1 tosrc/main/webapp/WEB-INF/tags.
- com.oracle.weblogic.rewrite.examples.AddImplicitTldFileWithTaglib3_0
- Add implicit TLD with taglib 3.0
- Add
implicit.tldfile with taglib 3.0 tosrc/main/webapp/WEB-INF/tags.
- com.oracle.weblogic.rewrite.examples.spring.ChangeCacheManagerToSimpleCacheManager
- Change cacheManager to use the SimpleCacheManager
- Change cacheManager to use the SimpleCacheManager.
- com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511
- Add WebLogic 15.1.1 PetClinic extras
- Run migration extras for migrated Spring Framework PetClinic example run on WebLogic 15.1.1.
- com.oracle.weblogic.rewrite.examples.spring.SetupSpringFrameworkPetClinicFor1412
- Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2
- Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2.
- com.oracle.weblogic.rewrite.hibernate.AddHibernateOrmCore61
- Add Hibernate ORM Core if has dependencies
- This recipe will add Hibernate ORM Core if has dependencies.
- com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9
- Migrate to Hibernate for Jakarta EE 9
- Upgrade hibernate libraries to Jakarta EE9 versions.
- com.oracle.weblogic.rewrite.jakarta.AddJakartaEE9ServletDependencyIfUsingServletContext
- Add Jakarta EE 9 Servlet Dependency
- Add Jakarta EE 9 Servlet Dependency if using jakarta.servlet.ServletContext
- com.oracle.weblogic.rewrite.jakarta.ChangeJakartaFacesMethodCalls
- ChangeJakartaFacesMethodCalls
- Handle method call changes for deprecated Faces/EL methods with different arguments from the original.
- com.oracle.weblogic.rewrite.jakarta.Faces2xMigrationToJakartaFaces3x
- JSF 2.x to Jakarta Server Faces 3.x
- Jakarta EE 9 uses Faces 3.0 a major upgrade to Jakarta packages and XML namespaces.
- com.oracle.weblogic.rewrite.jakarta.FacesJNDINamesChanged3
- JNDI name
jsf/ClientSideSecretKeyhas been renamed tofaces/ClientSideSecretKey, and thejsf/FlashSecretKeyJNDI name has been renamed tofaces/FlashSecretKey. - The
jsf/ClientSideSecretKeyJNDI name has been renamed tofaces/ClientSideSecretKey, and thejsf/FlashSecretKeyJNDI name has been renamed tofaces/FlashSecretKey. The JNDI keys that have been renamed are updated to allow use of the keys.
- JNDI name
- com.oracle.weblogic.rewrite.jakarta.FacesManagedBeansRemoved3
- Substitute deprecated Faces Managed Beans
- This recipe substitutes Faces Managed Beans, which were deprecated in JavaServer Faces 2.3 and have been removed from Jakarta Faces 3.0. It also replaces the deprecated jakarta.faces.bean.ManagedBean annotation with the jarkarta.inject.Named annotation.
- com.oracle.weblogic.rewrite.jakarta.JakartaEeNamespaces9_1
- Migrate from JavaX to Jakarta EE 9.1 Namespaces
- These recipes help with Migration From JavaX to Jakarta EE 9.1 Namespaces.
- com.oracle.weblogic.rewrite.jakarta.JakartaFaces3Xhtml
- Faces XHTML migration for Jakarta EE 9
- Find and replace legacy JSF namespaces and javax references with Jakarta Faces values in XHTML files.
- com.oracle.weblogic.rewrite.jakarta.JavaxAnnotationMigrationToJakarta9Annotation
- Migrate deprecated
javax.annotationtojakarta.annotation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- com.oracle.weblogic.rewrite.jakarta.JavaxApplicationClientXmlToJakarta9ApplicationClientXml
- Migrate xmlns entries in
application-client.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxApplicationXmlToJakarta9ApplicationXml
- Migrate xmlns entries in
application.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxBatchJobsXmlsToJakarta9BatchJobsXmls
- Migrate xmlns entries in
**/batch-jobs/*.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxBatchXmlToJakarta9BatchXml
- Migrate xmlns entries in
batch.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxBeansXmlToJakarta9BeansXml
- Migrate xmlns entries in
beans.xmlfiles for Beans 3.0. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxBindingsSchemaXjbsToJakarta9BindingsSchemaXjbs
- Migrate xmlns entries in
*.xjbfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxEjbJarXmlToJakarta9EjbJarXml
- Migrate xmlns entries in
ejb-jar.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxFacesConfigXmlToJakartaFaces3ConfigXml
- Migrate xmlns entries in
faces-config.xmlfiles for Jakarta Server Faces 3 - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxFacesTagLibraryXmlToJakartaFaces3TagLibraryXml
- Migrate xmlns entries in
*taglib*.xmlfiles for Jakarta Server Faces 3 - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxJmsToJakartaJmsOnMdb
- Migrate javax.jms to jakarta.jms on MDB
- Migrate javax.jms to jakarta.jms on MDB
- com.oracle.weblogic.rewrite.jakarta.JavaxPermissionsXmlToJakarta9PermissionsXml
- Migrate xmlns entries in
permissions.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxRaXmlToJakarta9RaXml
- Migrate xmlns entries in
ra.xmlfiles (Connectors). - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxTestWebXmlToJakartaTestWebXml5
- Migrate xmlns entries in
test-web.xmlfiles for Jakarta Server Faces 3 using test interfaces - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation for test interfaces like arquillian.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxTestXmlsToJakartaTestsXmls
- Migrate xmlns entries in
test-*.xmlfiles for Jakarta EE 9.1 using test interfaces - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation for test interfaces like arquillian.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxToJakartaCdiExtensions
- Rename CDI Extension to Jakarta
- Rename
javax.enterprise.inject.spi.Extensiontojakarta.enterprise.inject.spi.Extension.
- com.oracle.weblogic.rewrite.jakarta.JavaxValidationMappingXmlsToJakarta9ValidationMappingXmls
- Migrate xmlns entries in
**/validation/*.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxWebFragmentXmlToJakartaWebFragmentXml5
- Migrate xmlns entries in
web-fragment.xmlfiles for Jakarta Server Faces 3 - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxWebHandlerXmlToJakarta9HandlerXml
- Migrate xmlns entries in
handler.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxWebJspTagLibraryTldsToJakarta9WebJspTagLibraryTlds
- Migrate xmlns entries in
*.tldfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxWebServicesXmlToJakarta9WebServicesXml
- Migrate xmlns entries in
webservices.xmlfiles. - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.JavaxWebXmlToJakartaWebXml5
- Migrate xmlns entries in
web.xmlfiles for Jakarta Server Faces 3 - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- com.oracle.weblogic.rewrite.jakarta.MigrateJavaxMVCToJakartaEE9
- Migrate javax.mvc to 2.0 (Jakarta EE 9)
- Upgrade Jakarta Model-View-Controller libraries to 2.0 (Jakarta EE9) versions.
- com.oracle.weblogic.rewrite.jakarta.MigrateJavaxWebToJakartaWeb9
- Migrate javax.javaee-web-api to jakarta.jakartaee-web-api (Jakarta EE 9)
- Update Java EE Web API dependency to Jakarta EE Web Profile API 9.1
- com.oracle.weblogic.rewrite.jakarta.MigrateTagLibsToJakartaEE9
- Migrate Tag Libraries to 2.0 (Jakarta EE 9)
- Upgrade Jakarta Standard Tag libraries to 2.0 (Jakarta EE9) versions.
- com.oracle.weblogic.rewrite.jakarta.MitigateUnaffectedNonEEJakarta9Packages
- Mitigate Unaffected Non-EE Jakarta 9 Packages
- Mitigate Unaffected Non-EE Jakarta 9 Packages. Reference: https://github.com/jakartaee/platform/blob/main/namespace/unaffected-packages.adoc
- com.oracle.weblogic.rewrite.jakarta.OrgGlassfishJavaxElToJakartaEl
- Migrate deprecated
org.glassfish.javax.elpackages tojakarta.el - Package relocation for rebranded Javax to Jakarta EE.
- Migrate deprecated
- com.oracle.weblogic.rewrite.jakarta.RemovalsServletJakarta9
- Replace deprecated Jakarta Servlet methods and classes
- This recipe replaces the classes and methods deprecated in Jakarta Servlet 5.0
- com.oracle.weblogic.rewrite.jakarta.RemovedJakartaFaces3ExpressionLanguageClasses
- Use
jakarta.elinstead ofjakarta.faces.elandjavax.faces.el - Several classes were removed and replaced in Jakarta Server Faces 3.0. The only Object definition not removed in the
jakarta.faces.elpackage is the CompositeComponentExpressionHolder interface.
- Use
- com.oracle.weblogic.rewrite.jakarta.RemovedJakartaFaces3ResourceResolver
- Replace
ResourceResolverwithResourceHandler - The
ResourceResolverclass was removed in Jakarta Faces 3.0. The functionality provided by that class can be replaced by using thejakarta.faces.application.ResourceHandlerclass.
- Replace
- com.oracle.weblogic.rewrite.jakarta.RemovedStateManagerMethods3
- Use
StateManagementStrategy - Methods that were removed from the
jakarta.faces.application.StateManagerandjavax.faces.application.StateManagerclasses in Jakarta Faces 3.0 are replaced byjakarta.faces.view.StateManagementStrategyorjavax.faces.view.StateManagementStrategybased on JakartaEE9 migration in Faces 3.0
- Use
- com.oracle.weblogic.rewrite.jakarta.UpdateJakartaFacesMethodCalls
- Update deprecated Faces method calls
- Custom recipe to handle method call changes for deprecated Faces/EL methods where the method argument lists have changed. This recipe should be run after all the Jakarta Faces related type changes are completed.
- com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPersistenceTo31
- Update Jakarta Persistence to 3.1
- Update Jakarta Persistence to 3.1.
- com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPersistenceTo32
- Update Jakarta Persistence to 3.2
- Update Jakarta Persistence to 3.2.
- com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPlatform9_1
- Update Jakarta EE Platform Dependencies to 9.1.0
- Update Jakarta EE Platform Dependencies to 9.1.0
- com.oracle.weblogic.rewrite.jakarta.UpgradeCommonOpenSourceLibraries
- Upgrade Common open source libraries
- Upgrade Common open source libraries libraries to Jakarta EE9 versions.
- com.oracle.weblogic.rewrite.jakarta.UpgradeFacesOpenSourceLibraries2
- Upgrade Faces open source libraries
- Upgrade PrimeFaces, OmniFaces, and MyFaces libraries to Jakarta EE9 versions.
- com.oracle.weblogic.rewrite.jakarta.UpgradeFacesOpenSourceLibraries3
- Upgrade Faces open source libraries
- Upgrade PrimeFaces, OmniFaces, and MyFaces libraries to Jakarta EE9 versions.
- com.oracle.weblogic.rewrite.jakarta.UpgradeMavenPluginArtifactItems
- Upgrade group, artifact ID and version of an artifactItem, of a maven plugin execution configuration
- Change the groupId and the artifactId of an artifactItem in the configuration section of a plugin's execution. This recipe does not perform any validation and assumes all values passed are valid.
- com.oracle.weblogic.rewrite.jakarta.UpgradeMavenPluginConfigurationArtifacts
- Change artifacts for a Maven plugin configuration
- Change artifacts for a Maven plugin configuration artifacts.
- com.oracle.weblogic.rewrite.spring.data.UpgradeSpringDataBom
- Upgrade Spring Data BOM to 2024.1.x
- Upgrade Spring Data BOM to 2024.1.x version.
- com.oracle.weblogic.rewrite.spring.data.UpgradeSpringDataJpa
- Upgrade Spring Data JPA to 3.4.6
- Upgrade Spring Data JPA to 3.4.6 version, which is the version used by spring-data-bom v2024.1.x
- com.oracle.weblogic.rewrite.spring.framework.DefaultServletHandler
- Update Default Servlet Handler for Spring Framework if empty
- This recipe will update Spring Framework default servlet handler if empty, as noted in the Spring Framework 6.2 documentation.
- com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicJtaTransactionManager
- Replace Removed WebLogicJtaTransactionManager from Spring Framework 5.3.x to 6.2.x
- Replace removed WebLogicJtaTransactionManager with JtaTransactionManager from Spring Framework 6.2.x.
- com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicLoadTimeWeaver
- Replace Removed WebLogicLoadTimeWeaver from Spring Framework 5.3.x to 6.2.x
- Replace removed WebLogicLoadTimeWeaver with LoadTimeWeaver from Spring Framework 6.2.x.
- com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2
- Migrate to Spring Framework 6.2 for WebLogic 15.1.1
- Migrate applications to the Spring Framework 6.2 release and compatibility with WebLogic 15.1.1.
- io.quarkus.updates.camel.camel40.CamelQuarkusMigrationRecipe
- Migrate
camel3application tocamel4. - Migrate
camel3quarkus application tocamel4quarkus.
- Migrate
- io.quarkus.updates.camel.camel410.CamelQuarkusMigrationRecipe
- Migrates
camel 4.9application tocamel 4.10 - Migrates
camel 4.9quarkus application tocamel 4.10.
- Migrates
- io.quarkus.updates.camel.camel411.CamelQuarkusMigrationRecipe
- Migrates
camel 4.10application tocamel 4.11 - Migrates
camel 4.10quarkus application tocamel 4.11.
- Migrates
- io.quarkus.updates.camel.camel412.CamelQuarkusMigrationRecipe
- Migrates
camel 4.11application tocamel 4.12 - Migrates
camel 4.11quarkus application tocamel 4.12.
- Migrates
- io.quarkus.updates.camel.camel413.CamelQuarkusMigrationRecipe
- Migrates
camel 4.12application tocamel 4.13 - Migrates
camel 4.12Quarkus application tocamel 4.13.
- Migrates
- io.quarkus.updates.camel.camel414.CamelQuarkusMigrationRecipe
- Migrates
camel 4.13application tocamel 4.14 - Migrates
camel 4.13Quarkus application tocamel 4.14.
- Migrates
- io.quarkus.updates.camel.camel415.CamelQuarkusMigrationRecipe
- Migrates
camel 4.14application tocamel 4.15 - Migrates
camel 4.14Quarkus application tocamel 4.15.
- Migrates
- io.quarkus.updates.camel.camel44.CamelQuarkusMigrationRecipe
- Migrates
camel 4.0application tocamel 4.4 - Migrates
camel 4.0quarkus application tocamel 4.4.
- Migrates
- io.quarkus.updates.camel.camel47.CamelQuarkusMigrationRecipe
- Migrates
camel 4.4application tocamel 4.8 - Migrates
camel 4.4quarkus application tocamel 4.8.
- Migrates
- io.quarkus.updates.camel.camel49.CamelQuarkusMigrationRecipe
- Migrates
camel 4.8application tocamel 4.9 - Migrates
camel 4.8quarkus application tocamel 4.9.
- Migrates
- io.quarkus.updates.core.quarkus30.AdditionalChanges
- io.quarkus.updates.core.quarkus30.AdditionalChanges
- io.quarkus.updates.core.quarkus30.AdjustApplicationPropertiesWithJakarta
- Adjust application.properties for jakarta. packages*
- Adjust application.properties for jakarta.* packages
- io.quarkus.updates.core.quarkus30.AdjustApplicationYamlWithJakarta
- Adjust application.yaml for jakarta. packages*
- Adjust application.yaml for jakarta.* packages
- io.quarkus.updates.core.quarkus30.AdjustKotlinAllOpenDirectives
- Adjust all-open directives in Kotlin plugin configuration
- Adjust all-open directives in Kotlin plugin configuration
- io.quarkus.updates.core.quarkus30.ApplicationProperties
- io.quarkus.updates.core.quarkus30.ApplicationProperties
- io.quarkus.updates.core.quarkus30.ApplicationYml
- io.quarkus.updates.core.quarkus30.ApplicationYml
- io.quarkus.updates.core.quarkus30.ChangeJavaxAnnotationToJakarta
- Migrate deprecated
javax.annotationpackages tojakarta.annotation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation. Excludes
javax.annotation.processing.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JacksonJavaxToJakarta
- Migrate Jackson from javax to jakarta namespace
- Java EE has been rebranded to Jakarta EE. This recipe replaces existing Jackson dependencies with their counterparts that are compatible with Jakarta EE.
- io.quarkus.updates.core.quarkus30.JavaxActivationMigrationToJakartaActivation
- Migrate deprecated
javax.activationpackages tojakarta.activation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxAnnotationMigrationToJakartaAnnotation
- Migrate deprecated
javax.annotationpackages tojakarta.annotation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxAnnotationPackageToJakarta
- Migrate deprecated
javax.annotationpackages tojakarta.annotation - Change type of classes in the
javax.annotationpackage to jakarta.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxAnnotationSecurityPackageToJakarta
- Migrate deprecated
javax.annotation.securitypackages tojakarta.annotation.security - Change type of classes in the
javax.annotation.securitypackage to jakarta.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxAnnotationSqlPackageToJakarta
- Migrate deprecated
javax.annotation.sqlpackages tojakarta.annotation.sql - Change type of classes in the
javax.annotation.sqlpackage to jakarta.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxAuthenticationMigrationToJakartaAuthentication
- Migrate deprecated
javax.security.auth.messagepackages tojakarta.security.auth.message - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxAuthorizationMigrationToJakartaAuthorization
- Migrate deprecated
javax.security.jaccpackages tojakarta.security.jacc - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxBatchMigrationToJakartaBatch
- Migrate deprecated
javax.batchpackages tojakarta.batch - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxConfigurationFiles
- io.quarkus.updates.core.quarkus30.JavaxConfigurationFiles
- io.quarkus.updates.core.quarkus30.JavaxDecoratorToJakartaDecorator
- Migrate deprecated
javax.decoratorpackages tojakarta.decorator - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxEjbToJakartaEjb
- Migrate deprecated
javax.ejbpackages tojakarta.ejb - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxElToJakartaEl
- Migrate deprecated
javax.elpackages tojakarta.el - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxEnterpriseToJakartaEnterprise
- Migrate deprecated
javax.enterprisepackages tojakarta.enterprise - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxFacesToJakartaFaces
- Migrate deprecated
javax.facespackages tojakarta.faces - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxInjectMigrationToJakartaInject
- Migrate deprecated
javax.injectpackages tojakarta.inject - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxInterceptorToJakartaInterceptor
- Migrate deprecated
javax.interceptorpackages tojakarta.interceptor - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxJmsToJakartaJms
- Migrate deprecated
javax.jmspackages tojakarta.jms - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxJsonToJakartaJson
- Migrate deprecated
javax.jsonpackages tojakarta.json - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxJwsToJakartaJws
- Migrate deprecated
javax.jwspackages tojakarta.jws - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxMailToJakartaMail
- Migrate deprecated
javax.mailpackages tojakarta.mail - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxPersistenceToJakartaPersistence
- Migrate deprecated
javax.persistencepackages tojakarta.persistence - Java EE has been rebranded to Jakarta EE, necessitating a package relocation
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxPersistenceXmlToJakartaPersistenceXml
- Migrate xmlns entries in
persistence.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- io.quarkus.updates.core.quarkus30.JavaxResourceToJakartaResource
- Migrate deprecated
javax.resourcepackages tojakarta.resource - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxSecurityToJakartaSecurity
- Migrate deprecated
javax.security.enterprisepackages tojakarta.security.enterprise - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxServletToJakartaServlet
- Migrate deprecated
javax.servletpackages tojakarta.servlet - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxToJakartaAdditionalMigration
- io.quarkus.updates.core.quarkus30.JavaxToJakartaAdditionalMigration
- io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestarts
- io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestarts
- io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestartsTests
- io.quarkus.updates.core.quarkus30.JavaxToJakartaCodestartsTests
- io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationAdoc
- io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationAdoc
- io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationMd
- io.quarkus.updates.core.quarkus30.JavaxToJakartaDocumentationMd
- io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlin
- io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlin
- io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlinCodestarts
- io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlinCodestarts
- io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlinCodestartsTests
- io.quarkus.updates.core.quarkus30.JavaxToJakartaKotlinCodestartsTests
- io.quarkus.updates.core.quarkus30.JavaxTransactionMigrationToJakartaTransaction
- Migrate deprecated
javax.transactionpackages tojakarta.transaction - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxValidationMigrationToJakartaValidation
- Migrate deprecated
javax.validationpackages tojakarta.validation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxWebsocketToJakartaWebsocket
- Migrate deprecated
javax.websocketpackages tojakarta.websocket - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxWsToJakartaWs
- Migrate deprecated
javax.wspackages tojakarta.ws - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxXmlBindMigrationToJakartaXmlBind
- Migrate deprecated
javax.xml.bindpackages tojakarta.xml.bind - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxXmlSoapToJakartaXmlSoap
- Migrate deprecated
javax.soappackages tojakarta.soap - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.JavaxXmlWsMigrationToJakartaXmlWs
- Migrate deprecated
javax.xml.wspackages tojakarta.xml.ws - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- io.quarkus.updates.core.quarkus30.Kotlin
- io.quarkus.updates.core.quarkus30.Kotlin
- io.quarkus.updates.core.quarkus30.RenameJavaxServiceFiles
- Rename a file example
- io.quarkus.updates.core.quarkus30.RestAssuredJavaxToJakarta
- Migrate RestAssured from javax to jakarta namespace by upgrading to a version compatible with J2EE9
- Java EE has been rebranded to Jakarta EE. This recipe replaces existing RestAssured dependencies with their counterparts that are compatible with Jakarta EE.
- io.quarkus.updates.core.quarkus30.UpgradeQuarkiverse
- io.quarkus.updates.core.quarkus30.UpgradeQuarkiverse
- io.quarkus.updates.core.quarkus31.RemoveMockitoInline
- io.quarkus.updates.core.quarkus31.RemoveMockitoInline
- io.quarkus.updates.core.quarkus310.AdjustPackageProperty
- Adjust the package properties
- Adjust the package properties
- io.quarkus.updates.core.quarkus310.FlywayDb2
- io.quarkus.updates.core.quarkus310.FlywayDb2
- io.quarkus.updates.core.quarkus310.FlywayDerby
- io.quarkus.updates.core.quarkus310.FlywayDerby
- io.quarkus.updates.core.quarkus310.FlywayPostgreSQL
- io.quarkus.updates.core.quarkus310.FlywayPostgreSQL
- io.quarkus.updates.core.quarkus310.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus310.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus310.UpdateConfigPackagePom
- io.quarkus.updates.core.quarkus310.UpdateConfigPackagePom
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageSimpleProperties
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageSimpleProperties
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeFastJar
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeFastJar
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeJar
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeJar
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeMutableJar
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeMutableJar
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeNative
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeNative
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeNativeSources
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeNativeSources
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeUberJar
- io.quarkus.updates.core.quarkus310.UpdateConfigPackageTypeUberJar
- io.quarkus.updates.core.quarkus311.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus311.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus312.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus312.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus313.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus313.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus313.UpdateTestOIDCAuthServerUrl
- io.quarkus.updates.core.quarkus313.UpdateTestOIDCAuthServerUrl
- io.quarkus.updates.core.quarkus318.RemoveFlywayCleanOnValidationError
- io.quarkus.updates.core.quarkus318.RemoveFlywayCleanOnValidationError
- io.quarkus.updates.core.quarkus319.ConfigurationPropertiesChange
- io.quarkus.updates.core.quarkus319.ConfigurationPropertiesChange
- io.quarkus.updates.core.quarkus319.HibernateORMValidationMode
- io.quarkus.updates.core.quarkus319.HibernateORMValidationMode
- io.quarkus.updates.core.quarkus319.MoveAccessTokenAnnotationToNewPackage
- io.quarkus.updates.core.quarkus319.MoveAccessTokenAnnotationToNewPackage
- io.quarkus.updates.core.quarkus32.ApplicationProperties
- io.quarkus.updates.core.quarkus32.ApplicationProperties
- io.quarkus.updates.core.quarkus32.ApplicationYml
- io.quarkus.updates.core.quarkus32.ApplicationYml
- io.quarkus.updates.core.quarkus32.InjectMock
- io.quarkus.updates.core.quarkus32.InjectMock
- io.quarkus.updates.core.quarkus321.TlsRegistrySplitPackagesFix
- io.quarkus.updates.core.quarkus321.TlsRegistrySplitPackagesFix
- io.quarkus.updates.core.quarkus323.HibernateORMSchemaManagementProperties
- io.quarkus.updates.core.quarkus323.HibernateORMSchemaManagementProperties
- io.quarkus.updates.core.quarkus324.AddHibernateAnnotationProcessorIfNewJpaModelgenDependency
- io.quarkus.updates.core.quarkus324.AddHibernateAnnotationProcessorIfNewJpaModelgenDependency
- io.quarkus.updates.core.quarkus324.AddHibernateAnnotationProcessorIfOldJpaModelgenDependency
- io.quarkus.updates.core.quarkus324.AddHibernateAnnotationProcessorIfOldJpaModelgenDependency
- io.quarkus.updates.core.quarkus324.LogConsoleAsyncEnable
- io.quarkus.updates.core.quarkus324.LogConsoleAsyncEnable
- io.quarkus.updates.core.quarkus324.MigrateFromHibernateOrmSessionMethodsRemovedIn7
- io.quarkus.updates.core.quarkus324.MigrateFromHibernateOrmSessionMethodsRemovedIn7
- io.quarkus.updates.core.quarkus324.MigrateFromHibernateOrmVariousRemovedIn7
- io.quarkus.updates.core.quarkus324.MigrateFromHibernateOrmVariousRemovedIn7
- io.quarkus.updates.core.quarkus324.RemoveJpaModelgenDependencies
- io.quarkus.updates.core.quarkus324.RemoveJpaModelgenDependencies
- io.quarkus.updates.core.quarkus324.ReplaceNewJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus324.ReplaceNewJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus324.ReplaceOldJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus324.ReplaceOldJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus326.EnableEnabledConfigChanges
- io.quarkus.updates.core.quarkus326.EnableEnabledConfigChanges
- io.quarkus.updates.core.quarkus33.ApplicationProperties
- io.quarkus.updates.core.quarkus33.ApplicationProperties
- io.quarkus.updates.core.quarkus33.ApplicationYml
- io.quarkus.updates.core.quarkus33.ApplicationYml
- io.quarkus.updates.core.quarkus33.GraalVMSubstitutionsArtifact
- io.quarkus.updates.core.quarkus33.GraalVMSubstitutionsArtifact
- io.quarkus.updates.core.quarkus331.AddExtensionsTrueToQuarkusMavenPlugin
- Add <extensions>true</extensions> to quarkus-maven-plugin
- Add <extensions>true</extensions> to the quarkus-maven-plugin configuration if not already present.
- io.quarkus.updates.core.quarkus331.CoreUpdate331
- io.quarkus.updates.core.quarkus331.CoreUpdate331
- io.quarkus.updates.core.quarkus35.MutinyUniAndGroupCombinedWith
- io.quarkus.updates.core.quarkus35.MutinyUniAndGroupCombinedWith
- io.quarkus.updates.core.quarkus35.MutinyUniMemoizeAtLeast
- io.quarkus.updates.core.quarkus35.MutinyUniMemoizeAtLeast
- io.quarkus.updates.core.quarkus36.JaegerSmallRyeOpenTracing
- io.quarkus.updates.core.quarkus36.JaegerSmallRyeOpenTracing
- io.quarkus.updates.core.quarkus37.AddJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus37.AddJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus37.AddJpaModelgenAnnotationProcessorIfOldArtifact
- io.quarkus.updates.core.quarkus37.AddJpaModelgenAnnotationProcessorIfOldArtifact
- io.quarkus.updates.core.quarkus37.AddMavenCompilerAnnotationProcessor
- Add an annotation processor to the Maven Compiler plugin configuration
- Add an annotation processor to the Maven Compiler plugin configuration.
- io.quarkus.updates.core.quarkus37.ChangeMavenCompilerAnnotationProcessorGroupIdAndArtifactId
- Change Maven Compiler plugin annotation processor groupId, artifactId and/or the version
- Change the groupId, artifactId and/or the version of a specified Maven Compiler plugin annotation processor.
- io.quarkus.updates.core.quarkus37.DeprecatedJavaxSecurityCert
- Use
java.security.certinstead ofjavax.security.cert - The
javax.security.certpackage has been deprecated for removal.
- Use
- io.quarkus.updates.core.quarkus37.DeprecatedLogRecordThreadID
- Adopt
setLongThreadIDinjava.util.logging.LogRecord - Avoid using the deprecated methods in
java.util.logging.LogRecord
- Adopt
- io.quarkus.updates.core.quarkus37.HibernateSearchOutboxPolling
- io.quarkus.updates.core.quarkus37.HibernateSearchOutboxPolling
- io.quarkus.updates.core.quarkus37.JavaVersion17
- Change Maven and Gradle Java version property values to 17
- Change maven.compiler.source and maven.compiler.target values to 17.
- io.quarkus.updates.core.quarkus37.Jre17AgentMainPreMainPublic
- Set visibility of
premainandagentmainmethods topublic - Check for a behavior change in Java agents.
- Set visibility of
- io.quarkus.updates.core.quarkus37.MavenPlugins
- io.quarkus.updates.core.quarkus37.MavenPlugins
- io.quarkus.updates.core.quarkus37.RemoveJpaModelgenDependencies
- io.quarkus.updates.core.quarkus37.RemoveJpaModelgenDependencies
- io.quarkus.updates.core.quarkus37.RemovedLegacySunJSSEProviderName
- Use
SunJSSEinstead ofcom.sun.net.ssl.internal.ssl.Provider - The
com.sun.net.ssl.internal.ssl.Providerprovider name was removed.
- Use
- io.quarkus.updates.core.quarkus37.ReplaceJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus37.ReplaceJpaModelgenAnnotationProcessor
- io.quarkus.updates.core.quarkus37.ResteasyClientRenaming
- io.quarkus.updates.core.quarkus37.ResteasyClientRenaming
- io.quarkus.updates.core.quarkus37.SetupJavaUpgradeJavaVersion
- Upgrade
actions/setup-javajava-version - Update the Java version used by
actions/setup-javaif it is below the expected version number.
- Upgrade
- io.quarkus.updates.core.quarkus37.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus37.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion
- Sync Maven Compiler plugin annotation processor version with the one provided by the BOM
- Sync Maven Compiler plugin annotation processor version with the one provided by the BOM.
- io.quarkus.updates.core.quarkus37.UpgradeJavaVersion
- Upgrade Java version
- Upgrade build plugin configuration to use the specified Java version. This recipe changes
java.toolchain.languageVersioninbuild.gradle(.kts)of gradle projects, or maven-compiler-plugin target version and related settings. Will not downgrade if the version is newer than the specified version.
- io.quarkus.updates.core.quarkus37.UpgradeToJava17
- Migrate to Java 17
- This recipe will apply changes commonly needed when migrating to Java 17. 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 17 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 17.
- io.quarkus.updates.core.quarkus38.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus38.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus383.GraalSDK
- io.quarkus.updates.core.quarkus383.GraalSDK
- io.quarkus.updates.core.quarkus39.GraalSDK
- io.quarkus.updates.core.quarkus39.GraalSDK
- io.quarkus.updates.core.quarkus39.Relocations
- io.quarkus.updates.core.quarkus39.Relocations
- io.quarkus.updates.core.quarkus39.RemoveMavenCompilerAnnotationProcessor
- Remove an annotation processor from the Maven Compiler plugin configuration
- Remove an annotation processor from the Maven Compiler plugin configuration.
- io.quarkus.updates.core.quarkus39.RemovePanacheAnnotationProcessor
- io.quarkus.updates.core.quarkus39.RemovePanacheAnnotationProcessor
- io.quarkus.updates.core.quarkus39.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus39.SyncHibernateJpaModelgenVersionWithBOM
- io.quarkus.updates.core.quarkus39.UpdateConfigRoots
- io.quarkus.updates.core.quarkus39.UpdateConfigRoots
- io.quarkus.updates.minio.minio38.UpdateAll
- io.quarkus.updates.minio.minio38.UpdateAll
- io.quarkus.updates.minio.minio38.UpdateProperties
- io.quarkus.updates.minio.minio38.UpdateProperties
- io.quarkus.updates.quarkiverse.minio.minio38.AdjustURLPropertyValue
- Adust quarkus.minio.url property key
- Adjust quarkus.minio.url property key to quarkus.minio.host.
- org.apache.camel.upgrade.Camel410LTSMigrationRecipe
- Migrate to 4.10.6
- Migrates Apache Camel application to 4.10.6.
- org.apache.camel.upgrade.CamelMigrationRecipe
- Migrate to 4.14.0
- Migrates Apache Camel application to 4.14.0.
- org.apache.camel.upgrade.JavaVersion17
- Change Maven Java version property values to 17
- Change maven.compiler.source and maven.compiler.target values to 17.
- org.apache.camel.upgrade.SetupJavaUpgradeJavaVersion
- Upgrade
actions/setup-javajava-version - Update the Java version used by
actions/setup-javaif it is below the expected version number.
- Upgrade
- org.apache.camel.upgrade.UpdatePropertiesAndYamlKeys
- Update properties and yaml configurations file
- Update properties and yaml configurations file.
- org.apache.camel.upgrade.UpgradeJavaVersion
- Upgrade Java version
- Upgrade build plugin configuration to use the specified Java version. This recipe changes
java.toolchain.languageVersioninbuild.gradle(.kts)of gradle projects, or maven-compiler-plugin target version and related settings. Will not downgrade if the version is newer than the specified version.
- org.apache.camel.upgrade.UpgradeToJava17
- Migrate to Java 17
- This recipe will apply changes commonly needed when migrating to Java 17. 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 17 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 17.
- org.apache.camel.upgrade.camel40.CamelMigrationRecipe
- Migrate
camel3application tocamel4. - Migrate
camel3application tocamel4.
- Migrate
- org.apache.camel.upgrade.camel40.ChangeManagedChoiceMBeanMethodName
- Change of method names brought by Camel JMX API changes
- MBeans now use a consistent method name of
extendedInformation.
- org.apache.camel.upgrade.camel40.ChangeManagedFailoverLoadBalancerMBeanMethodName
- Change of method names brought by Camel JMX API changes
- MBeans now use a consistent method name of
extendedInformation.
- org.apache.camel.upgrade.camel40.ChangeTypes
- Migrate moved types between Camel 3.x and Camel 4.x
- Change type of classes related to change of API.
- org.apache.camel.upgrade.camel40.UsePluginHelperForContextGetters
- Replace context.getExtension(ExtendedCamelContext.class).get with PluginHelper.get(context)**
- org.apache.camel.upgrade.camel40.java.CamelAPIsRecipe
- Camel API changes
- Apache Camel API migration from version 3.20 or higher to 4.0. Removal of deprecated APIs.
- org.apache.camel.upgrade.camel40.java.CamelBeanRecipe
- Camel bean recipe
- Camel bean recipe.
- org.apache.camel.upgrade.camel40.java.CamelEIPRecipe
- Replaces removed method camel EIP
- The InOnly and InOut EIPs have been removed. Instead, use 'SetExchangePattern' or 'To' where you can specify the exchange pattern to use.
- org.apache.camel.upgrade.camel40.java.CamelHttpRecipe
- Camel Http Extension changes
- Camel Http Extension changes.
- org.apache.camel.upgrade.camel40.properties.rejectedPolicy
- Camel API changes in application.properties
- Apache Camel API migration from version 3.20 or higher to 4.0. Removal of deprecated APIs, which could be part of the application.properties.
- org.apache.camel.upgrade.camel40.xml.CircuitBreakerXmlDslRecipe
- Camel XMl DSL Circuit Breaker changes
- Apache Camel XML DSL Circuit Breaker migration from version 3.20 or higher to 4.0.
- org.apache.camel.upgrade.camel40.xml.XmlDslRecipe
- Camel XMl DSL changes
- Apache Camel XML DSL migration from version 3.20 or higher to 4.0.
- org.apache.camel.upgrade.camel40.yaml.CamelYamlRouteConfigurationSequenceRecipe
- Camel Yaml changes regarding route-configuration children
- Camel YAML changes. route-configuration children sequence is replaced with mappingEntry (with special migration of "on-exception").
- org.apache.camel.upgrade.camel40.yaml.CamelYamlStepsInFromRecipe
- Camel Yaml steps not allowed as route child
- The YAML DSL backwards compatible mode in Camel 3.14 or older, which allowed 'steps' to be defined as a child of 'route' has been removed.
- org.apache.camel.upgrade.camel41.CamelCoreRecipe
- Camel Core changes
- Apache Camel Core migration from version 4.0 to 4.1.
- org.apache.camel.upgrade.camel41.TracingTag
- Tag Enum has been deprecated
- The Tag Enum containing constants for tagging spans has been deprecated. Instead, use constants from the TagConstants.
- org.apache.camel.upgrade.camel41.XmlDslRecipe
- Camel XMl DSL changes
- Apache Camel XML DSL migration from version 4.0 to 4.1.
- org.apache.camel.upgrade.camel41.YamlDslRecipe
- Changes for creation of inlined beans.
- If inlined bean is created, parameters
typeandbeanTypehas bean changed.
- org.apache.camel.upgrade.camel410.CamelMigrationRecipe
- Migrates
camel 4.9application tocamel 4.10 - Migrates
camel 4.9application tocamel 4.10.
- Migrates
- org.apache.camel.upgrade.camel410.XmlDsl410Recipe
- Camel XMl DSL changes
- Apache Camel XML DSL migration from version 4.9 o 4.10.
- org.apache.camel.upgrade.camel410.camelAzureFiles
- Renamed constants in camel-azure-files
- Renamed constants in camel-azure-files.
- org.apache.camel.upgrade.camel410.camelSmb
- Renamed constants in camel-smb
- Renamed constants in camel-smb.
- org.apache.camel.upgrade.camel410_4.CamelMigrationRecipe
- Migrates
camel 4.10.3application tocamel 4.10.4 - Migrates
camel 4.10.3application tocamel 4.10.4.
- Migrates
- org.apache.camel.upgrade.camel411.CamelMigrationRecipe
- Migrates
camel 4.10application tocamel 4.11 - Migrates
camel 4.10application tocamel 4.11.
- Migrates
- org.apache.camel.upgrade.camel411.platformHttpFilterStrategy
- Use PlatformHttpHeaderFilterStrategy instead of HttpHeaderFilterStrategy
- PlatformHttpHeaderFilterStrategy is removed, use HttpHeaderFilterStrategy instead.
- org.apache.camel.upgrade.camel411.removedDependencies
- Removed deprecated components
- Removed deprecated components (camel-etcd3).
- org.apache.camel.upgrade.camel411.removedLightweight
- Removed deprecated property camel.main.lightweight
- Removed deprecated configuration properties (camel.main.lightweight).
- org.apache.camel.upgrade.camel412.CamelMigrationRecipe
- Migrates
camel 4.11application tocamel 4.12 - Migrates
camel 4.11application tocamel 4.12.
- Migrates
- org.apache.camel.upgrade.camel412.Java412Recipes
- Camel Java DSL change for camel 4.12
- Apache Camel Java DSL migration from version 4.11 to 4.12.
- org.apache.camel.upgrade.camel412.scanClassesMoved
- The package scan classes has moved from camel-base-engine to camel-support - java
- The package scan classes has moved from camel-base-engine to camel-support JAR and moved to a new package - java.
- org.apache.camel.upgrade.camel412.scanClassesMovedMaven
- The package scan classes has moved from camel-base-engine to camel-support - maven
- The package scan classes has moved from camel-base-engine to camel-support JAR and moved to a new package - maven.
- org.apache.camel.upgrade.camel412.xmlDslBearer
- XML DSL bearer from rest/securityDefinitions is renamed to bearerToken
- Rest definition in XML DSL with security constraints, then bearer in YAML and XML DSL has been renamed to bearerToken to be aligned with Java DSL.
- org.apache.camel.upgrade.camel412.yamlDslBearer
- Yaml DSL bearer from rest/securityDefinitions is renamed to bearerToken
- Rest definition in Yaml DSL with security constraints, then bearer in YAML and XML DSL has been renamed to bearerToken to be aligned with Java DSL.
- org.apache.camel.upgrade.camel413.CamelMigrationRecipe
- Migrates
camel 4.12application tocamel 4.13 - Migrates
camel 4.12application tocamel 4.13.
- Migrates
- org.apache.camel.upgrade.camel413.YamlDsl413Recipe
- Camel YML DSL changes
- Apache Camel YML DSL migration from version 4.12 o 4.13.
- org.apache.camel.upgrade.camel413.authenticationHttpClientConfigurer
- Renamed BasicAuthenticationHttpClientConfigurer to DefaultAuthenticationHttpClientConfigurer
- BasicAuthenticationHttpClientConfigurer is renamed to DefaultAuthenticationHttpClientConfigurer.
- org.apache.camel.upgrade.camel413.furyDependency
- Change Maven dependency example
- org.apache.camel.upgrade.camel413.furyDsl
- Change dataformat fury to fury in xml/java dsl.
- org.apache.camel.upgrade.camel413.furyJava
- Renamed BasicAuthenticationHttpClientConfigurer to DefaultAuthenticationHttpClientConfigurer
- BasicAuthenticationHttpClientConfigurer is renamed to DefaultAuthenticationHttpClientConfigurer.
- org.apache.camel.upgrade.camel414.CamelMigrationRecipe
- Migrates
camel 4.13application tocamel 4.14 - Migrates
camel 4.13application tocamel 4.14.
- Migrates
- org.apache.camel.upgrade.camel414.httpBusinessVsManagementServicesSeparationProperties
- Update properties and yaml configurations file because of Http management vs business separation
- The HTTP server for standalone camel-main applications has separated management services and business services. This means that part of configurations in application.properties should be changed from camel.server.xxx to camel.management.xxx.
- org.apache.camel.upgrade.camel415.CamelMigrationRecipe
- Migrates
camel 4.14application tocamel 4.15 - Migrates
camel 4.14application tocamel 4.15.
- Migrates
- org.apache.camel.upgrade.camel415.aiNestedHeadersClasses
- Changed types of camel AI nested headers classes
- Changed types of camel AI nested headers classes.
- org.apache.camel.upgrade.camel415.dataFormats
- Refactored dataFormats
- Refactored dataFormats.
- org.apache.camel.upgrade.camel415.nettyAndNettyHttp
- Changed parameter in camel-netty and camel-netty-http
- Changed parameter in camel-netty and camel-netty-http + enhanced value.
- org.apache.camel.upgrade.camel415.xmlDataFormats
- Refactored dataFormats (XML DSL)
- Refactored dataFormats (XML DSL).
- org.apache.camel.upgrade.camel415.yamDataFormats
- Refactored dataFormats (YAML DSL)
- Refactored dataFormats (YAML DSL).
- org.apache.camel.upgrade.camel416.Camel416MiloLambdaRecipe
- Milo: The monitored item data value listener API has changed
- Milo: The monitored item data value listener API has changed.
- org.apache.camel.upgrade.camel416.CamelMigrationRecipe
- Migrates
camel 4.15application tocamel 4.16 - Migrates
camel 4.15application tocamel 4.16.
- Migrates
- org.apache.camel.upgrade.camel416.camelMiloCertificate
- Different java type for ServerCertificateValidator in camel-milo
- Different java type for ServerCertificateValidator in camel-milo.
- org.apache.camel.upgrade.camel42.CamelMainDebugger
- The option camel.main.debugger has been renamed
- The option camel.main.debugger has been renamed to camel.debug.enabled.
- org.apache.camel.upgrade.camel42.CamelSagaRecipe
- Camel Core changes
- Apache Camel Core migration from version 4.0 to 4.1.
- org.apache.camel.upgrade.camel43.CamelResequenceEIPXmlRecipe
- Camel Resequence DSL changes
- Batch and stream attributes were renamed in Resequence EIP XML DSL.
- org.apache.camel.upgrade.camel43.CamelThrottleEIPRecipe
- Camel Core changes
- Apache Camel Core migration from version 4.0 to 4.1.
- org.apache.camel.upgrade.camel43.KafkaMetadata
- The header name for the List metadata has changed
- The header name for the List metadata has changed also the dsl method for metadata changed.
- org.apache.camel.upgrade.camel43.StateRepository
- MemoryStateRepository and FileStateRepository were moved to another package and library
- Moved classes MemoryStateRepository and FileStateRepositor from camel-base-engine to camel-support.
- org.apache.camel.upgrade.camel44.CamelCoreRecipe
- Camel Core changes
- Apache Camel Core migration from version 4.3 to 4.4.
- org.apache.camel.upgrade.camel44.CamelMigrationRecipe
- Migrates
camel 4.0application tocamel 4.4 - Migrates
camel 4.0application tocamel 4.4.
- Migrates
- org.apache.camel.upgrade.camel44.DefaultJsonSchemaLoader
- Replace deprecated DefaultJsonSchemaLoader with DefaultJsonUriSchemaLoader
- Replaces deprecated class with its successor.
- org.apache.camel.upgrade.camel44.RouteControllerProperties
- Replace 'camel.main.routeController' with `camel.routecontroller'
- org.apache.camel.upgrade.camel45.CamelMigrationRecipe
- Migrates
camel 4.4application tocamel 4.5 - Migrates
camel 4.4application tocamel 4.5.
- Migrates
- org.apache.camel.upgrade.camel45.TraceProperties
- Replace 'camel.main.backlogTracing' with `camel.trace.enabled'
- org.apache.camel.upgrade.camel45.UseExtendedCamelContextGetters
- Replace
context.${method}(*)withcontext.getCamelContextExtension().${method}(*)
- Replace
- org.apache.camel.upgrade.camel45.renamedClasses
- Renamed classes for elasticsearch,opensearch and spring regis
- Renamed classes for elasticsearch,opensearch and spring regis.
- org.apache.camel.upgrade.camel46.CamelMigrationRecipe
- Migrates
camel 4.5application tocamel 4.6 - Migrates
camel 4.5application tocamel 4.6.
- Migrates
- org.apache.camel.upgrade.camel46.XmlDsl46Recipe
- Camel XMl DSL changes
- Apache Camel XML DSL migration from version 3.20 or higher to 4.0.
- org.apache.camel.upgrade.camel46.YamlDsl46Recipe
- Bean property to properties.
- Each bean property is changed to bean properties.
- org.apache.camel.upgrade.camel46.renamedClasses
- Renamed classes for elasticsearch,opensearch and spring regis
- Renamed classes for elasticsearch,opensearch and spring regis.
- org.apache.camel.upgrade.camel46.renamedDependencies
- Renamed dependencies
- Renamed dependencies.
- org.apache.camel.upgrade.camel46.yamStreamCaching
- Renamed streamCaching to streamCache on the route
- Renamed streamCaching to streamCache on the route.
- org.apache.camel.upgrade.camel47.CamelMigrationRecipe
- Migrates
camel 4.6application tocamel 4.7 - Migrates
camel 4.6application tocamel 4.7.
- Migrates
- org.apache.camel.upgrade.camel47.Java47Recipes
- Change of headers with embedded HTTP server (consumer)
- Change of headers with embedded HTTP server (consumer). The headers CamelHttpServletRequest and CamelHttpServletResponse has been removed..
- org.apache.camel.upgrade.camel47.XmlDsl47Recipe
- Camel XMl DSL changes
- Apache Camel XML DSL migration from version 4.6 o 4.7.
- org.apache.camel.upgrade.camel47.YamlDsl47Recipe
- Camel YML DSL changes
- Apache Camel YML DSL migration from version 4.6 o 4.7.
- org.apache.camel.upgrade.camel47.removedDependencies
- Moved the camel-cloudevents api into camel-api and removed the camel-cloudevents
- Moved the camel-cloudevents api into camel-api and removed the camel-cloudevents.
- org.apache.camel.upgrade.camel47.renamedClasses
- Renamed classes for API
- Renamed classes for API.
- org.apache.camel.upgrade.camel49.AwsSecretRecipe
- The syntax for retrieving a single field of a secret has been changed
- The syntax for retrieving a single field of a secret has been changed..
- org.apache.camel.upgrade.camel49.AzureSecretRecipe
- The syntax for retrieving a single field of a secret has been changed
- The syntax for retrieving a single field of a secret has been changed..
- org.apache.camel.upgrade.camel49.CamelMigrationRecipe
- Migrates
camel 4.8application tocamel 4.9 - Migrates
camel 4.8application tocamel 4.9.
- Migrates
- org.apache.camel.upgrade.camel49.DebeziumChangeTypes
- Each camel-debezium module has its own subpackage corresponding to the database type
- each camel-debezium module has its own subpackage corresponding to the database type. So for example, all the classes of the module camel-debezium-postgres have been moved to a dedicated package which is org.apache.camel.component.debezium.postgres instead of having everything under the root package org.apache.camel.component.debezium.
- org.apache.camel.upgrade.camel49.GcpSecretRecipe
- The syntax for retrieving a single field of a secret has been changed
- The syntax for retrieving a single field of a secret has been changed..
- org.apache.camel.upgrade.camel49.HashicorpSecretRecipe
- The syntax for retrieving a single field of a secret has been changed
- The syntax for retrieving a single field of a secret has been changed..
- org.apache.camel.upgrade.camel49.removedDependencies
- Removed deprecated components
- Removed deprecated components (camel-groovy-dsl, camel-js-dsl, camel-jsh-dsl, camel-kotlin-api, camel-kotlin-dsl).
- org.apache.camel.upgrade.camel49.renamedAPIs
- Renamed classes for API
- Renamed classes for API.
- org.apache.camel.upgrade.customRecipes.ChangePropertyKeyWithCaseChange
- Change prefix of property with Camel case
- Change prefix of property with Camel case
- org.apache.camel.upgrade.customRecipes.LiteralRegexpConverterRecipe
- Replaces a literal matching an expression
- Replaces literal, groups from regexp can be used as $0, $1, ...
- org.apache.camel.upgrade.customRecipes.MoveGetterToExtendedCamelContext
- Move getter from context to ExtendedCamelContext.
- Move getter from context to ExtendedCamelContext
- org.apache.camel.upgrade.customRecipes.MoveGetterToPluginHelper
- Move getter from context to PluginHelper.
- Move getter from context to PluginHelper
- org.apache.camel.upgrade.customRecipes.PropertiesAndYamlKeyUpdate
- Update Apache Camel configurations keys
- Update Apache Camel configurations keys
- org.apache.camel.upgrade.customRecipes.ReplacePropertyInComponentXml
- Camel XMl DSL changes
- Apache Camel XML DSL migration from version 4.9 o 4.10.
- org.apache.camel.upgrade.customRecipes.ReplacePropertyInComponentYaml
- Renames property of the component
- ARenames property of the component.
- org.apache.camel.upgrade.customRecipes.ReplacePropertyInDataFormatXml
- Camel XMl DSL changes
- Apache Camel XML DSL migration from version 4.9 o 4.10.
- org.apache.camel.upgrade.customRecipes.ReplacePropertyInDataFormatYaml
- Renames property of the component
- ARenames property of the component.
- org.openrewrite.java.camel.migrate.removedExtensions
- Remove non existing camel-quarkus extensions
- Removal of maven dependencies for extension, which are no longer part of Camel 3.x.
- software.amazon.awssdk.v2migration.AddCommentToMethod
- Add a comment to a method
- Add a comment to a method.
- software.amazon.awssdk.v2migration.ByteBufferToSdkBytes
- Convert ByteBuffer to SdkBytes
- Convert ByteBuffer to SdkBytes by calling SdkBytes#fromByteBuffer
- software.amazon.awssdk.v2migration.ChangeSdkType
- Change AWS SDK for Java v1 types to v2 equivalents
- Change AWS SDK for Java v1 types to v2 equivalents.
- software.amazon.awssdk.v2migration.DateToInstant
- Convert Date to Instant
- Convert Date to Instant by calling Date#toInstant
- software.amazon.awssdk.v2migration.EnumCasingToV2
- V1 Enum Casing to V2
- Transforms V1 enum constants from pascal case to screaming snake case for v2.
- software.amazon.awssdk.v2migration.HttpSettingsToHttpClient
- Move HTTP settings from the ClientOverrideConfiguration to ApacheHttpClient for sync and NettyNioAsyncHttpClient for async
- Move HTTP settings from the ClientOverrideConfiguration to ApacheHttpClient for sync SDK client and NettyNioAsyncHttpClient for async SDK client.
- software.amazon.awssdk.v2migration.NewClassToBuilder
- Transform 'new' expressions to builders
- Transforms 'new' expression for generated model, client objects and client config related objects to the equivalent builder()..build() expression in V2.
- software.amazon.awssdk.v2migration.NewClassToBuilderPattern
- Change new objects creation to Builder pattern
- Transform the creation of a class using 'new' to builder pattern.
- software.amazon.awssdk.v2migration.NewClassToStaticFactory
- Transform 'new' expressions to static factory methods
- Transforms 'new' expression for client config related objects to the equivalent .create() expression in V2.
- software.amazon.awssdk.v2migration.NumberToDuration
- Convert the method parameter from numeric type to duration
- Convert the method parameter from numeric types to duration.
- software.amazon.awssdk.v2migration.S3AddImportsAndComments
- Add imports and comments to unsupported S3 transforms.
- Add imports and comments to unsupported S3 transforms.
- software.amazon.awssdk.v2migration.S3EventNotificationMethodToV2
- S3 Event Notification method to v2
- S3 Event Notification method to v2
- software.amazon.awssdk.v2migration.S3NonStreamingRequestToV2
- V1 S3 non-streaming requests to V2
- Transform usage of V1 S3 non-streaming requests to V2.
- software.amazon.awssdk.v2migration.S3NonStreamingRequestToV2Complex
- V1 S3 non-streaming requests to V2
- Transform usage of V1 S3 non-streaming requests to V2.
- software.amazon.awssdk.v2migration.S3PojoToV2
- S3 POJOs to V2
- S3 POJOs to V2
- software.amazon.awssdk.v2migration.S3PutObjectRequestToV2
- V1 S3 PutObjectRequest, AmazonS3.putObject(PutObjectRequest), and TransferManager.upload(PutObjectRequest) to V2
- Transform V1 S3 PutObjectRequest to V2, as well as methods that take it as an argument.
- software.amazon.awssdk.v2migration.S3StreamingRequestToV2
- V1 S3 streaming requests to V2
- Transform usage of V1 S3 streaming requests such as PutObject to V2.
- software.amazon.awssdk.v2migration.S3StreamingResponseToV2
- V1 S3Object to V2
- Transform usage of V1 S3Object to V2.
- software.amazon.awssdk.v2migration.S3TmAddComments
- Add imports and comments to unsupported S3 transfer manager transforms.
- Add imports and comments to unsupported S3 transfer manager transforms.
- software.amazon.awssdk.v2migration.S3UriToV2
- Convert v1 AmazonS3URI to v2 S3Uri
- Convert v1 AmazonS3URI to v2 S3Uri
- software.amazon.awssdk.v2migration.SdkBytesToByteBuffer
- Convert SdkBytes to ByteBuffer
- Convert SdkBytes to ByteBuffer by calling SdkBytes#asByteBuffer()
- software.amazon.awssdk.v2migration.SdkExceptionToV2
- SDK Exceptions Methods to V2
- SDK Exceptions Methods to V2
- software.amazon.awssdk.v2migration.SettersToBuilderV2
- Convert V1 setters to V2 toBuilder setters
- Convert V1 setters to V2 toBuilder setters
- software.amazon.awssdk.v2migration.TransferManagerMethodsToV2
- Transfer Manager Methods to V2
- Transfer Manager Methods to V2
- software.amazon.awssdk.v2migration.V1BuilderVariationsToV2Builder
- V1 client builder variations to builder()
- Transforms V1 builder variations to builder()
- software.amazon.awssdk.v2migration.V1GetterToV2
- V1 Getter to V2
- Transforms V1 getter to fluent getter in V2.
- software.amazon.awssdk.v2migration.V1SetterToV2
- V1 Setter to V2
- Transforms V1 setter to fluent setter in V2.
- software.amazon.awssdk.v2migration.WrapSdkClientBuilderRegionStr
- Wrap the region string provided on the SDK client builder with Region.of
- Wrap the region string provided on the SDK client builder with Region.of.
- tech.picnic.errorprone.refasterrules.AssertJBigDecimalRulesRecipes
- Refaster rules related to AssertJ assertions over
BigDecimals - Note that, contrary to collections of Refaster rules for other
org.assertj.core.api.NumberAssertsubtypes, these rules do not rewrite to/fromBigDecimalAssert#isEqualTo(Object)andBigDecimalAssert#isNotEqualTo(Object). This is becauseBigDecimal#equals(Object)considers not only the numeric value of compared instances, but also their scale. As a result various seemingly straightforward transformations would actually subtly change the assertion's semantics. Source.
- Refaster rules related to AssertJ assertions over
- tech.picnic.errorprone.refasterrules.AssertJBigDecimalRulesRecipes$AbstractBigDecimalAssertIsEqualByComparingToRecipe
- Refaster template
AssertJBigDecimalRules.AbstractBigDecimalAssertIsEqualByComparingTo - Recipe created for the following Refaster template:
java static final class AbstractBigDecimalAssertIsEqualByComparingTo { @BeforeTemplate AbstractBigDecimalAssert<?> before(AbstractBigDecimalAssert<?> bigDecimalAssert, BigDecimal n) { return Refaster.anyOf(bigDecimalAssert.isCloseTo(n, offset(BigDecimal.ZERO)), bigDecimalAssert.isCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractBigDecimalAssert<?> after(AbstractBigDecimalAssert<?> bigDecimalAssert, BigDecimal n) { return bigDecimalAssert.isEqualByComparingTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBigDecimalRulesRecipes$AbstractBigDecimalAssertIsNotEqualByComparingToRecipe
- Refaster template
AssertJBigDecimalRules.AbstractBigDecimalAssertIsNotEqualByComparingTo - Recipe created for the following Refaster template:
java static final class AbstractBigDecimalAssertIsNotEqualByComparingTo { @BeforeTemplate AbstractBigDecimalAssert<?> before(AbstractBigDecimalAssert<?> bigDecimalAssert, BigDecimal n) { return Refaster.anyOf(bigDecimalAssert.isNotCloseTo(n, offset(BigDecimal.ZERO)), bigDecimalAssert.isNotCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractBigDecimalAssert<?> after(AbstractBigDecimalAssert<?> bigDecimalAssert, BigDecimal n) { return bigDecimalAssert.isNotEqualByComparingTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBigIntegerRulesRecipes
AssertJBigIntegerRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJBigIntegerRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsEqualToRecipe
- Refaster template
AssertJBigIntegerRules.AbstractBigIntegerAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractBigIntegerAssertIsEqualTo { @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> bigIntegerAssert, BigInteger n) { return Refaster.anyOf(bigIntegerAssert.isCloseTo(n, offset(BigInteger.ZERO)), bigIntegerAssert.isCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractBigIntegerAssert<?> after(AbstractBigIntegerAssert<?> bigIntegerAssert, BigInteger n) { return bigIntegerAssert.isEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsNotEqualToRecipe
- Refaster template
AssertJBigIntegerRules.AbstractBigIntegerAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractBigIntegerAssertIsNotEqualTo { @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> bigIntegerAssert, BigInteger n) { return Refaster.anyOf(bigIntegerAssert.isNotCloseTo(n, offset(BigInteger.ZERO)), bigIntegerAssert.isNotCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractBigIntegerAssert<?> after(AbstractBigIntegerAssert<?> bigIntegerAssert, BigInteger n) { return bigIntegerAssert.isNotEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsNotZeroRecipe
- Refaster template
AssertJBigIntegerRules.AbstractBigIntegerAssertIsNotZero - Recipe created for the following Refaster template:
java static final class AbstractBigIntegerAssertIsNotZero { @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> bigIntegerAssert) { return Refaster.anyOf(bigIntegerAssert.isNotZero(), bigIntegerAssert.isNotEqualTo(0L), bigIntegerAssert.isNotEqualTo(BigInteger.ZERO)); } @AfterTemplate AbstractBigIntegerAssert<?> after(AbstractBigIntegerAssert<?> bigIntegerAssert) { return bigIntegerAssert.isNotEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsOneRecipe
- Refaster template
AssertJBigIntegerRules.AbstractBigIntegerAssertIsOne - Recipe created for the following Refaster template:
java static final class AbstractBigIntegerAssertIsOne { @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> bigIntegerAssert) { return Refaster.anyOf(bigIntegerAssert.isOne(), bigIntegerAssert.isEqualTo(1L), bigIntegerAssert.isEqualTo(BigInteger.ONE)); } @AfterTemplate AbstractBigIntegerAssert<?> after(AbstractBigIntegerAssert<?> bigIntegerAssert) { return bigIntegerAssert.isEqualTo(1); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBigIntegerRulesRecipes$AbstractBigIntegerAssertIsZeroRecipe
- Refaster template
AssertJBigIntegerRules.AbstractBigIntegerAssertIsZero - Recipe created for the following Refaster template:
java static final class AbstractBigIntegerAssertIsZero { @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> bigIntegerAssert) { return Refaster.anyOf(bigIntegerAssert.isZero(), bigIntegerAssert.isEqualTo(0L), bigIntegerAssert.isEqualTo(BigInteger.ZERO)); } @AfterTemplate AbstractBigIntegerAssert<?> after(AbstractBigIntegerAssert<?> bigIntegerAssert) { return bigIntegerAssert.isEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBooleanRulesRecipes
AssertJBooleanRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJBooleanRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJBooleanRulesRecipes$AbstractBooleanAssertIsEqualToRecipe
- Refaster template
AssertJBooleanRules.AbstractBooleanAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractBooleanAssertIsEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(AbstractBooleanAssert<?> boolAssert, boolean other) { return boolAssert.isNotEqualTo(!other); } @AfterTemplate AbstractBooleanAssert<?> after(AbstractBooleanAssert<?> boolAssert, boolean other) { return boolAssert.isEqualTo(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBooleanRulesRecipes$AbstractBooleanAssertIsFalseRecipe
- Refaster template
AssertJBooleanRules.AbstractBooleanAssertIsFalse - Recipe created for the following Refaster template:
java static final class AbstractBooleanAssertIsFalse { @BeforeTemplate AbstractBooleanAssert<?> before(AbstractBooleanAssert<?> boolAssert) { return Refaster.anyOf(boolAssert.isEqualTo(false), boolAssert.isNotEqualTo(true)); } @AfterTemplate AbstractBooleanAssert<?> after(AbstractBooleanAssert<?> boolAssert) { return boolAssert.isFalse(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBooleanRulesRecipes$AbstractBooleanAssertIsNotEqualToRecipe
- Refaster template
AssertJBooleanRules.AbstractBooleanAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractBooleanAssertIsNotEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(AbstractBooleanAssert<?> boolAssert, boolean other) { return boolAssert.isEqualTo(!other); } @AfterTemplate AbstractBooleanAssert<?> after(AbstractBooleanAssert<?> boolAssert, boolean other) { return boolAssert.isNotEqualTo(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBooleanRulesRecipes$AbstractBooleanAssertIsTrueRecipe
- Refaster template
AssertJBooleanRules.AbstractBooleanAssertIsTrue - Recipe created for the following Refaster template:
java static final class AbstractBooleanAssertIsTrue { @BeforeTemplate AbstractBooleanAssert<?> before(AbstractBooleanAssert<?> boolAssert) { return Refaster.anyOf(boolAssert.isEqualTo(true), boolAssert.isNotEqualTo(false)); } @AfterTemplate AbstractBooleanAssert<?> after(AbstractBooleanAssert<?> boolAssert) { return boolAssert.isTrue(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBooleanRulesRecipes$AssertThatBooleanIsFalseRecipe
- Refaster template
AssertJBooleanRules.AssertThatBooleanIsFalse - Recipe created for the following Refaster template:
java static final class AssertThatBooleanIsFalse { @BeforeTemplate AbstractBooleanAssert<?> before(boolean b) { return assertThat(!b).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractBooleanAssert<?> after(boolean b) { return assertThat(b).isFalse(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJBooleanRulesRecipes$AssertThatBooleanIsTrueRecipe
- Refaster template
AssertJBooleanRules.AssertThatBooleanIsTrue - Recipe created for the following Refaster template:
java static final class AssertThatBooleanIsTrue { @BeforeTemplate AbstractBooleanAssert<?> before(boolean b) { return assertThat(!b).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractBooleanAssert<?> after(boolean b) { return assertThat(b).isTrue(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJByteRulesRecipes
AssertJByteRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJByteRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJByteRulesRecipes$AbstractByteAssertIsEqualToRecipe
- Refaster template
AssertJByteRules.AbstractByteAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractByteAssertIsEqualTo { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> byteAssert, byte n) { return Refaster.anyOf(byteAssert.isCloseTo(n, offset((byte)0)), byteAssert.isCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert, byte n) { return byteAssert.isEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJByteRulesRecipes$AbstractByteAssertIsNotEqualToRecipe
- Refaster template
AssertJByteRules.AbstractByteAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractByteAssertIsNotEqualTo { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> byteAssert, byte n) { return Refaster.anyOf(byteAssert.isNotCloseTo(n, offset((byte)0)), byteAssert.isNotCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert, byte n) { return byteAssert.isNotEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJByteRulesRecipes$AbstractByteAssertIsNotZeroRecipe
- Refaster template
AssertJByteRules.AbstractByteAssertIsNotZero - Recipe created for the following Refaster template:
java static final class AbstractByteAssertIsNotZero { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> byteAssert) { return byteAssert.isNotZero(); } @AfterTemplate AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert) { return byteAssert.isNotEqualTo((byte)0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJByteRulesRecipes$AbstractByteAssertIsOneRecipe
- Refaster template
AssertJByteRules.AbstractByteAssertIsOne - Recipe created for the following Refaster template:
java static final class AbstractByteAssertIsOne { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> byteAssert) { return byteAssert.isOne(); } @AfterTemplate AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert) { return byteAssert.isEqualTo((byte)1); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJByteRulesRecipes$AbstractByteAssertIsZeroRecipe
- Refaster template
AssertJByteRules.AbstractByteAssertIsZero - Recipe created for the following Refaster template:
java static final class AbstractByteAssertIsZero { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> byteAssert) { return byteAssert.isZero(); } @AfterTemplate AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert) { return byteAssert.isEqualTo((byte)0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJCharSequenceRulesRecipes
AssertJCharSequenceRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJCharSequenceRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJCharSequenceRulesRecipes$AssertThatCharSequenceHasSizeRecipe
- Refaster template
AssertJCharSequenceRules.AssertThatCharSequenceHasSize - Recipe created for the following Refaster template:
java static final class AssertThatCharSequenceHasSize { @BeforeTemplate AbstractAssert<?, ?> before(CharSequence charSequence, int length) { return assertThat(charSequence.length()).isEqualTo(length); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractAssert<?, ?> after(CharSequence charSequence, int length) { return assertThat(charSequence).hasSize(length); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJCharSequenceRulesRecipes$AssertThatCharSequenceIsEmptyRecipe
- Refaster template
AssertJCharSequenceRules.AssertThatCharSequenceIsEmpty - Recipe created for the following Refaster template:
java static final class AssertThatCharSequenceIsEmpty { @BeforeTemplate void before(CharSequence charSequence) { Refaster.anyOf(assertThat(charSequence.isEmpty()).isTrue(), assertThat(charSequence.length()).isEqualTo(0L), assertThat(charSequence.length()).isNotPositive()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(CharSequence charSequence) { assertThat(charSequence).isEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJCharSequenceRulesRecipes$AssertThatCharSequenceIsNotEmptyRecipe
- Refaster template
AssertJCharSequenceRules.AssertThatCharSequenceIsNotEmpty - Recipe created for the following Refaster template:
java static final class AssertThatCharSequenceIsNotEmpty { @BeforeTemplate AbstractAssert<?, ?> before(CharSequence charSequence) { return Refaster.anyOf(assertThat(charSequence.isEmpty()).isFalse(), assertThat(charSequence.length()).isNotEqualTo(0), assertThat(charSequence.length()).isPositive()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractAssert<?, ?> after(CharSequence charSequence) { return assertThat(charSequence).isNotEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJComparableRulesRecipes
AssertJComparableRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJComparableRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJComparableRulesRecipes$AssertThatIsEqualByComparingToRecipe
- Refaster template
AssertJComparableRules.AssertThatIsEqualByComparingTo - Recipe created for the following Refaster template:
java static final class AssertThatIsEqualByComparingTo<T extends Comparable<? super T>> { @BeforeTemplate AbstractIntegerAssert<?> before(T actual, T expected) { return assertThat(actual.compareTo(expected)).isEqualTo(0); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractComparableAssert<?, ?> after(T actual, T expected) { return assertThat(actual).isEqualByComparingTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJComparableRulesRecipes$AssertThatIsGreaterThanOrEqualToRecipe
- Refaster template
AssertJComparableRules.AssertThatIsGreaterThanOrEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsGreaterThanOrEqualTo<T extends Comparable<? super T>> { @BeforeTemplate AbstractIntegerAssert<?> before(T actual, T expected) { return assertThat(actual.compareTo(expected)).isNotNegative(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractComparableAssert<?, ?> after(T actual, T expected) { return assertThat(actual).isGreaterThanOrEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJComparableRulesRecipes$AssertThatIsGreaterThanRecipe
- Refaster template
AssertJComparableRules.AssertThatIsGreaterThan - Recipe created for the following Refaster template:
java static final class AssertThatIsGreaterThan<T extends Comparable<? super T>> { @BeforeTemplate AbstractIntegerAssert<?> before(T actual, T expected) { return assertThat(actual.compareTo(expected)).isPositive(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractComparableAssert<?, ?> after(T actual, T expected) { return assertThat(actual).isGreaterThan(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJComparableRulesRecipes$AssertThatIsLessThanOrEqualToRecipe
- Refaster template
AssertJComparableRules.AssertThatIsLessThanOrEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsLessThanOrEqualTo<T extends Comparable<? super T>> { @BeforeTemplate AbstractIntegerAssert<?> before(T actual, T expected) { return assertThat(actual.compareTo(expected)).isNotPositive(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractComparableAssert<?, ?> after(T actual, T expected) { return assertThat(actual).isLessThanOrEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJComparableRulesRecipes$AssertThatIsLessThanRecipe
- Refaster template
AssertJComparableRules.AssertThatIsLessThan - Recipe created for the following Refaster template:
java static final class AssertThatIsLessThan<T extends Comparable<? super T>> { @BeforeTemplate AbstractIntegerAssert<?> before(T actual, T expected) { return assertThat(actual.compareTo(expected)).isNegative(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractComparableAssert<?, ?> after(T actual, T expected) { return assertThat(actual).isLessThan(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJComparableRulesRecipes$AssertThatIsNotEqualByComparingToRecipe
- Refaster template
AssertJComparableRules.AssertThatIsNotEqualByComparingTo - Recipe created for the following Refaster template:
java static final class AssertThatIsNotEqualByComparingTo<T extends Comparable<? super T>> { @BeforeTemplate AbstractIntegerAssert<?> before(T actual, T expected) { return assertThat(actual.compareTo(expected)).isNotEqualTo(0); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractComparableAssert<?, ?> after(T actual, T expected) { return assertThat(actual).isNotEqualByComparingTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDoubleRulesRecipes
AssertJDoubleRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJDoubleRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsCloseToWithOffsetRecipe
- Refaster template
AssertJDoubleRules.AbstractDoubleAssertIsCloseToWithOffset - Recipe created for the following Refaster template:
java static final class AbstractDoubleAssertIsCloseToWithOffset { @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> doubleAssert, double n, Offset<Double> offset) { return doubleAssert.isEqualTo(n, offset); } @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> doubleAssert, Double n, Offset<Double> offset) { return doubleAssert.isEqualTo(n, offset); } @AfterTemplate AbstractDoubleAssert<?> after(AbstractDoubleAssert<?> doubleAssert, double n, Offset<Double> offset) { return doubleAssert.isCloseTo(n, offset); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsEqualToRecipe
- Refaster template
AssertJDoubleRules.AbstractDoubleAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractDoubleAssertIsEqualTo { @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> doubleAssert, double n) { return Refaster.anyOf(doubleAssert.isCloseTo(n, offset(0.0)), doubleAssert.isCloseTo(n, withPercentage(0.0))); } @AfterTemplate AbstractDoubleAssert<?> after(AbstractDoubleAssert<?> doubleAssert, double n) { return doubleAssert.isEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsNotEqualToRecipe
- Refaster template
AssertJDoubleRules.AbstractDoubleAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractDoubleAssertIsNotEqualTo { @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> doubleAssert, double n) { return Refaster.anyOf(doubleAssert.isNotCloseTo(n, offset(0.0)), doubleAssert.isNotCloseTo(n, withPercentage(0.0))); } @AfterTemplate AbstractDoubleAssert<?> after(AbstractDoubleAssert<?> doubleAssert, double n) { return doubleAssert.isNotEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsNotZeroRecipe
- Refaster template
AssertJDoubleRules.AbstractDoubleAssertIsNotZero - Recipe created for the following Refaster template:
java static final class AbstractDoubleAssertIsNotZero { @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> doubleAssert) { return doubleAssert.isNotZero(); } @AfterTemplate AbstractDoubleAssert<?> after(AbstractDoubleAssert<?> doubleAssert) { return doubleAssert.isNotEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsOneRecipe
- Refaster template
AssertJDoubleRules.AbstractDoubleAssertIsOne - Recipe created for the following Refaster template:
java static final class AbstractDoubleAssertIsOne { @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> doubleAssert) { return doubleAssert.isOne(); } @AfterTemplate AbstractDoubleAssert<?> after(AbstractDoubleAssert<?> doubleAssert) { return doubleAssert.isEqualTo(1); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDoubleRulesRecipes$AbstractDoubleAssertIsZeroRecipe
- Refaster template
AssertJDoubleRules.AbstractDoubleAssertIsZero - Recipe created for the following Refaster template:
java static final class AbstractDoubleAssertIsZero { @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> doubleAssert) { return doubleAssert.isZero(); } @AfterTemplate AbstractDoubleAssert<?> after(AbstractDoubleAssert<?> doubleAssert) { return doubleAssert.isEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes
- Refaster rules related to AssertJ assertions over
Durations - These rules simplify and improve the readability of tests by using
Duration-specific AssertJ assertion methods instead of generic assertions. Source.
- Refaster rules related to AssertJ assertions over
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatHasDaysRecipe
- Refaster template
AssertJDurationRules.AssertThatHasDays - Recipe created for the following Refaster template:
java static final class AssertThatHasDays { @BeforeTemplate AbstractLongAssert<?> before(Duration duration, long days) { return assertThat(duration.toDays()).isEqualTo(days); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration, long days) { return assertThat(duration).hasDays(days); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatHasHoursRecipe
- Refaster template
AssertJDurationRules.AssertThatHasHours - Recipe created for the following Refaster template:
java static final class AssertThatHasHours { @BeforeTemplate AbstractLongAssert<?> before(Duration duration, long hours) { return assertThat(duration.toHours()).isEqualTo(hours); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration, long hours) { return assertThat(duration).hasHours(hours); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatHasMillisRecipe
- Refaster template
AssertJDurationRules.AssertThatHasMillis - Recipe created for the following Refaster template:
java static final class AssertThatHasMillis { @BeforeTemplate AbstractLongAssert<?> before(Duration duration, long millis) { return assertThat(duration.toMillis()).isEqualTo(millis); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration, long millis) { return assertThat(duration).hasMillis(millis); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatHasMinutesRecipe
- Refaster template
AssertJDurationRules.AssertThatHasMinutes - Recipe created for the following Refaster template:
java static final class AssertThatHasMinutes { @BeforeTemplate AbstractLongAssert<?> before(Duration duration, long minutes) { return assertThat(duration.toMinutes()).isEqualTo(minutes); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration, long minutes) { return assertThat(duration).hasMinutes(minutes); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatHasNanosRecipe
- Refaster template
AssertJDurationRules.AssertThatHasNanos - Recipe created for the following Refaster template:
java static final class AssertThatHasNanos { @BeforeTemplate AbstractLongAssert<?> before(Duration duration, long nanos) { return assertThat(duration.toNanos()).isEqualTo(nanos); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration, long nanos) { return assertThat(duration).hasNanos(nanos); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatHasSecondsRecipe
- Refaster template
AssertJDurationRules.AssertThatHasSeconds - Recipe created for the following Refaster template:
java static final class AssertThatHasSeconds { @BeforeTemplate AbstractLongAssert<?> before(Duration duration, long seconds) { return assertThat(duration.toSeconds()).isEqualTo(seconds); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration, long seconds) { return assertThat(duration).hasSeconds(seconds); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatIsNegativeRecipe
- Refaster template
AssertJDurationRules.AssertThatIsNegative - Recipe created for the following Refaster template:
java static final class AssertThatIsNegative { @BeforeTemplate AbstractBooleanAssert<?> before(Duration duration) { return assertThat(duration.isNegative()).isTrue(); } @BeforeTemplate AbstractDurationAssert<?> before2(Duration duration) { return assertThat(duration).isLessThan(Duration.ZERO); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration) { return assertThat(duration).isNegative(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatIsPositiveRecipe
- Refaster template
AssertJDurationRules.AssertThatIsPositive - Recipe created for the following Refaster template:
java static final class AssertThatIsPositive { @BeforeTemplate AbstractBooleanAssert<?> before(Duration duration) { return assertThat(duration.isPositive()).isTrue(); } @BeforeTemplate AbstractDurationAssert<?> before2(Duration duration) { return assertThat(duration).isGreaterThan(Duration.ZERO); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration) { return assertThat(duration).isPositive(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJDurationRulesRecipes$AssertThatIsZeroRecipe
- Refaster template
AssertJDurationRules.AssertThatIsZero - Recipe created for the following Refaster template:
java static final class AssertThatIsZero { @BeforeTemplate AbstractBooleanAssert<?> before(Duration duration) { return assertThat(duration.isZero()).isTrue(); } @BeforeTemplate AbstractDurationAssert<?> before2(Duration duration) { return assertThat(duration).isEqualTo(Duration.ZERO); } @AfterTemplate AbstractDurationAssert<?> after(Duration duration) { return assertThat(duration).isZero(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes
AssertJEnumerableRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJEnumerableRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertHasSameSizeAsRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertHasSameSizeAs - Recipe created for the following Refaster template:
java static final class EnumerableAssertHasSameSizeAs<S, E> { @BeforeTemplate EnumerableAssert<?, S> before(EnumerableAssert<?, S> enumAssert, Iterable<E> iterable) { return enumAssert.hasSize(Iterables.size(iterable)); } @BeforeTemplate EnumerableAssert<?, S> before(EnumerableAssert<?, S> enumAssert, Collection<E> iterable) { return enumAssert.hasSize(iterable.size()); } @BeforeTemplate EnumerableAssert<?, S> before(EnumerableAssert<?, S> enumAssert, E[] iterable) { return enumAssert.hasSize(iterable.length); } @BeforeTemplate EnumerableAssert<?, S> before(EnumerableAssert<?, S> enumAssert, CharSequence iterable) { return enumAssert.hasSize(iterable.length()); } @AfterTemplate EnumerableAssert<?, S> after(EnumerableAssert<?, S> enumAssert, Iterable<E> iterable) { return enumAssert.hasSameSizeAs(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertHasSizeBetweenRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertHasSizeBetween - Recipe created for the following Refaster template:
java static final class EnumerableAssertHasSizeBetween<E> { @BeforeTemplate AbstractIterableAssert<?, ?, E, ?> before(AbstractIterableAssert<?, ?, E, ?> enumAssert, int lower, int upper) { return enumAssert.size().isBetween(lower, upper).returnToIterable(); } @BeforeTemplate AbstractIterableSizeAssert<?, ?, E, ?> before2(AbstractIterableAssert<?, ?, E, ?> enumAssert, int lower, int upper) { return enumAssert.size().isBetween(lower, upper); } @AfterTemplate EnumerableAssert<?, E> after(EnumerableAssert<?, E> enumAssert, int lower, int upper) { return enumAssert.hasSizeBetween(lower, upper); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertHasSizeGreaterThanOrEqualToRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertHasSizeGreaterThanOrEqualTo - Recipe created for the following Refaster template:
java static final class EnumerableAssertHasSizeGreaterThanOrEqualTo<E> { @BeforeTemplate AbstractIterableAssert<?, ?, E, ?> before(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isGreaterThanOrEqualTo(size).returnToIterable(); } @BeforeTemplate AbstractIterableSizeAssert<?, ?, E, ?> before2(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isGreaterThanOrEqualTo(size); } @AfterTemplate EnumerableAssert<?, E> after(EnumerableAssert<?, E> enumAssert, int size) { return enumAssert.hasSizeGreaterThanOrEqualTo(size); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertHasSizeGreaterThanRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertHasSizeGreaterThan - Recipe created for the following Refaster template:
java static final class EnumerableAssertHasSizeGreaterThan<E> { @BeforeTemplate AbstractIterableAssert<?, ?, E, ?> before(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isGreaterThan(size).returnToIterable(); } @BeforeTemplate AbstractIterableSizeAssert<?, ?, E, ?> before2(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isGreaterThan(size); } @AfterTemplate EnumerableAssert<?, E> after(EnumerableAssert<?, E> enumAssert, int size) { return enumAssert.hasSizeGreaterThan(size); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertHasSizeLessThanOrEqualToRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertHasSizeLessThanOrEqualTo - Recipe created for the following Refaster template:
java static final class EnumerableAssertHasSizeLessThanOrEqualTo<E> { @BeforeTemplate AbstractIterableAssert<?, ?, E, ?> before(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isLessThanOrEqualTo(size).returnToIterable(); } @BeforeTemplate AbstractIterableSizeAssert<?, ?, E, ?> before2(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isLessThanOrEqualTo(size); } @AfterTemplate EnumerableAssert<?, E> after(EnumerableAssert<?, E> enumAssert, int size) { return enumAssert.hasSizeLessThanOrEqualTo(size); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertHasSizeLessThanRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertHasSizeLessThan - Recipe created for the following Refaster template:
java static final class EnumerableAssertHasSizeLessThan<E> { @BeforeTemplate AbstractIterableAssert<?, ?, E, ?> before(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isLessThan(size).returnToIterable(); } @BeforeTemplate AbstractIterableSizeAssert<?, ?, E, ?> before2(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isLessThan(size); } @AfterTemplate EnumerableAssert<?, E> after(EnumerableAssert<?, E> enumAssert, int size) { return enumAssert.hasSizeLessThan(size); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertHasSizeRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertHasSize - Recipe created for the following Refaster template:
java static final class EnumerableAssertHasSize<E> { @BeforeTemplate AbstractIterableAssert<?, ?, E, ?> before(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isEqualTo(size).returnToIterable(); } @BeforeTemplate AbstractIterableSizeAssert<?, ?, E, ?> before2(AbstractIterableAssert<?, ?, E, ?> enumAssert, int size) { return enumAssert.size().isEqualTo(size); } @AfterTemplate EnumerableAssert<?, E> after(EnumerableAssert<?, E> enumAssert, int size) { return enumAssert.hasSize(size); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJEnumerableRulesRecipes$EnumerableAssertIsNotEmptyRecipe
- Refaster template
AssertJEnumerableRules.EnumerableAssertIsNotEmpty - Recipe created for the following Refaster template:
java static final class EnumerableAssertIsNotEmpty<E> { @BeforeTemplate EnumerableAssert<?, E> before(EnumerableAssert<?, E> enumAssert) { return Refaster.anyOf(enumAssert.hasSizeGreaterThan(0), enumAssert.hasSizeGreaterThanOrEqualTo(1)); } @BeforeTemplate AbstractIterableAssert<?, ?, E, ?> before(AbstractIterableAssert<?, ?, E, ?> enumAssert) { return Refaster.anyOf(enumAssert.size().isNotEqualTo(0).returnToIterable(), enumAssert.size().isPositive().returnToIterable()); } @BeforeTemplate AbstractIntegerAssert<?> before2(AbstractIterableAssert<?, ?, E, ?> enumAssert) { return Refaster.anyOf(enumAssert.size().isNotEqualTo(0), enumAssert.size().isPositive()); } @AfterTemplate EnumerableAssert<?, E> after(EnumerableAssert<?, E> enumAssert) { return enumAssert.isNotEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes
- Refaster rules related to AssertJ assertions over
Files - These rules simplify and improve the readability of tests by using
File-specific AssertJ assertion methods instead of generic assertions. Source.
- Refaster rules related to AssertJ assertions over
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatDoesNotExistRecipe
- Refaster template
AssertJFileRules.AssertThatDoesNotExist - Recipe created for the following Refaster template:
java static final class AssertThatDoesNotExist { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.exists()).isFalse(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).doesNotExist(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatExistsRecipe
- Refaster template
AssertJFileRules.AssertThatExists - Recipe created for the following Refaster template:
java static final class AssertThatExists { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.exists()).isTrue(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).exists(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatHasFileNameRecipe
- Refaster template
AssertJFileRules.AssertThatHasFileName - Recipe created for the following Refaster template:
java static final class AssertThatHasFileName { @BeforeTemplate AbstractStringAssert<?> before(File actual, String fileName) { return assertThat(actual.getName()).isEqualTo(fileName); } @AfterTemplate AbstractFileAssert<?> after(File actual, String fileName) { return assertThat(actual).hasFileName(fileName); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatHasNoParentRecipe
- Refaster template
AssertJFileRules.AssertThatHasNoParent - Recipe created for the following Refaster template:
java static final class AssertThatHasNoParent { @BeforeTemplate void before(File actual) { assertThat(actual.getParent()).isNull(); } @AfterTemplate void after(File actual) { assertThat(actual).hasNoParent(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatHasParentFileRecipe
- Refaster template
AssertJFileRules.AssertThatHasParentFile - Recipe created for the following Refaster template:
java static final class AssertThatHasParentFile { @BeforeTemplate AbstractFileAssert<?> before(File actual, File expected) { return assertThat(actual.getParentFile()).isEqualTo(expected); } @AfterTemplate AbstractFileAssert<?> after(File actual, File expected) { return assertThat(actual).hasParent(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatHasParentStringRecipe
- Refaster template
AssertJFileRules.AssertThatHasParentString - Recipe created for the following Refaster template:
java static final class AssertThatHasParentString { @BeforeTemplate AbstractFileAssert<?> before(File actual, String expected) { return assertThat(actual.getParentFile()).hasFileName(expected); } @AfterTemplate AbstractFileAssert<?> after(File actual, String expected) { return assertThat(actual).hasParent(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatIsAbsoluteRecipe
- Refaster template
AssertJFileRules.AssertThatIsAbsolute - Recipe created for the following Refaster template:
java static final class AssertThatIsAbsolute { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.isAbsolute()).isTrue(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).isAbsolute(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatIsDirectoryRecipe
- Refaster template
AssertJFileRules.AssertThatIsDirectory - Recipe created for the following Refaster template:
java static final class AssertThatIsDirectory { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.isDirectory()).isTrue(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).isDirectory(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatIsExecutableRecipe
- Refaster template
AssertJFileRules.AssertThatIsExecutable - Recipe created for the following Refaster template:
java static final class AssertThatIsExecutable { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.canExecute()).isTrue(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).isExecutable(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatIsFileRecipe
- Refaster template
AssertJFileRules.AssertThatIsFile - Recipe created for the following Refaster template:
java static final class AssertThatIsFile { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.isFile()).isTrue(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).isFile(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatIsReadableRecipe
- Refaster template
AssertJFileRules.AssertThatIsReadable - Recipe created for the following Refaster template:
java static final class AssertThatIsReadable { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.canRead()).isTrue(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).isReadable(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatIsRelativeRecipe
- Refaster template
AssertJFileRules.AssertThatIsRelative - Recipe created for the following Refaster template:
java static final class AssertThatIsRelative { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.isAbsolute()).isFalse(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).isRelative(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFileRulesRecipes$AssertThatIsWritableRecipe
- Refaster template
AssertJFileRules.AssertThatIsWritable - Recipe created for the following Refaster template:
java static final class AssertThatIsWritable { @BeforeTemplate AbstractBooleanAssert<?> before(File actual) { return assertThat(actual.canWrite()).isTrue(); } @AfterTemplate AbstractFileAssert<?> after(File actual) { return assertThat(actual).isWritable(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFloatRulesRecipes
AssertJFloatRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJFloatRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJFloatRulesRecipes$AbstractFloatAssertIsCloseToWithOffsetRecipe
- Refaster template
AssertJFloatRules.AbstractFloatAssertIsCloseToWithOffset - Recipe created for the following Refaster template:
java static final class AbstractFloatAssertIsCloseToWithOffset { @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert, float n, Offset<Float> offset) { return floatAssert.isEqualTo(n, offset); } @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert, Float n, Offset<Float> offset) { return floatAssert.isEqualTo(n, offset); } @AfterTemplate AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert, float n, Offset<Float> offset) { return floatAssert.isCloseTo(n, offset); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFloatRulesRecipes$AbstractFloatAssertIsEqualToRecipe
- Refaster template
AssertJFloatRules.AbstractFloatAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractFloatAssertIsEqualTo { @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert, float n) { return Refaster.anyOf(floatAssert.isCloseTo(n, offset(0.0F)), floatAssert.isCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert, float n) { return floatAssert.isEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFloatRulesRecipes$AbstractFloatAssertIsNotEqualToRecipe
- Refaster template
AssertJFloatRules.AbstractFloatAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractFloatAssertIsNotEqualTo { @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert, float n) { return Refaster.anyOf(floatAssert.isNotCloseTo(n, offset(0.0F)), floatAssert.isNotCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert, float n) { return floatAssert.isNotEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFloatRulesRecipes$AbstractFloatAssertIsNotZeroRecipe
- Refaster template
AssertJFloatRules.AbstractFloatAssertIsNotZero - Recipe created for the following Refaster template:
java static final class AbstractFloatAssertIsNotZero { @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert) { return floatAssert.isNotZero(); } @AfterTemplate AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert) { return floatAssert.isNotEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFloatRulesRecipes$AbstractFloatAssertIsOneRecipe
- Refaster template
AssertJFloatRules.AbstractFloatAssertIsOne - Recipe created for the following Refaster template:
java static final class AbstractFloatAssertIsOne { @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert) { return floatAssert.isOne(); } @AfterTemplate AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert) { return floatAssert.isEqualTo(1); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJFloatRulesRecipes$AbstractFloatAssertIsZeroRecipe
- Refaster template
AssertJFloatRules.AbstractFloatAssertIsZero - Recipe created for the following Refaster template:
java static final class AbstractFloatAssertIsZero { @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert) { return floatAssert.isZero(); } @AfterTemplate AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert) { return floatAssert.isEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJInstantRulesRecipes
- Refaster rules related to AssertJ assertions over
Instants - These rules simplify and improve the readability of tests by using
Instant-specific AssertJ assertion methods instead of generic assertions. Source.
- Refaster rules related to AssertJ assertions over
- tech.picnic.errorprone.refasterrules.AssertJInstantRulesRecipes$AssertThatIsAfterOrEqualToRecipe
- Refaster template
AssertJInstantRules.AssertThatIsAfterOrEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsAfterOrEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(Instant actual, Instant other) { return assertThat(actual.isBefore(other)).isFalse(); } @AfterTemplate AbstractInstantAssert<?> after(Instant actual, Instant other) { return assertThat(actual).isAfterOrEqualTo(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJInstantRulesRecipes$AssertThatIsAfterRecipe
- Refaster template
AssertJInstantRules.AssertThatIsAfter - Recipe created for the following Refaster template:
java static final class AssertThatIsAfter { @BeforeTemplate AbstractBooleanAssert<?> before(Instant actual, Instant other) { return assertThat(actual.isAfter(other)).isTrue(); } @AfterTemplate AbstractInstantAssert<?> after(Instant actual, Instant other) { return assertThat(actual).isAfter(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJInstantRulesRecipes$AssertThatIsBeforeOrEqualToRecipe
- Refaster template
AssertJInstantRules.AssertThatIsBeforeOrEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsBeforeOrEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(Instant actual, Instant other) { return assertThat(actual.isAfter(other)).isFalse(); } @AfterTemplate AbstractInstantAssert<?> after(Instant actual, Instant other) { return assertThat(actual).isBeforeOrEqualTo(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJInstantRulesRecipes$AssertThatIsBeforeRecipe
- Refaster template
AssertJInstantRules.AssertThatIsBefore - Recipe created for the following Refaster template:
java static final class AssertThatIsBefore { @BeforeTemplate AbstractBooleanAssert<?> before(Instant actual, Instant other) { return assertThat(actual.isBefore(other)).isTrue(); } @AfterTemplate AbstractInstantAssert<?> after(Instant actual, Instant other) { return assertThat(actual).isBefore(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJInstantRulesRecipes$AssertThatIsBetweenRecipe
- Refaster template
AssertJInstantRules.AssertThatIsBetween - Recipe created for the following Refaster template:
java static final class AssertThatIsBetween { @BeforeTemplate AbstractInstantAssert<?> before(Instant actual, Instant start, Instant end) { return Refaster.anyOf(assertThat(actual).isAfterOrEqualTo(start).isBeforeOrEqualTo(end), assertThat(actual).isBeforeOrEqualTo(end).isAfterOrEqualTo(start)); } @AfterTemplate AbstractInstantAssert<?> after(Instant actual, Instant start, Instant end) { return assertThat(actual).isBetween(start, end); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJInstantRulesRecipes$AssertThatIsStrictlyBetweenRecipe
- Refaster template
AssertJInstantRules.AssertThatIsStrictlyBetween - Recipe created for the following Refaster template:
java static final class AssertThatIsStrictlyBetween { @BeforeTemplate AbstractInstantAssert<?> before(Instant actual, Instant start, Instant end) { return Refaster.anyOf(assertThat(actual).isAfter(start).isBefore(end), assertThat(actual).isBefore(end).isAfter(start)); } @AfterTemplate AbstractInstantAssert<?> after(Instant actual, Instant start, Instant end) { return assertThat(actual).isStrictlyBetween(start, end); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIntegerRulesRecipes
AssertJIntegerRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJIntegerRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsEqualToRecipe
- Refaster template
AssertJIntegerRules.AbstractIntegerAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractIntegerAssertIsEqualTo { @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> intAssert, int n) { return Refaster.anyOf(intAssert.isCloseTo(n, offset(0)), intAssert.isCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractIntegerAssert<?> after(AbstractIntegerAssert<?> intAssert, int n) { return intAssert.isEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsNotEqualToRecipe
- Refaster template
AssertJIntegerRules.AbstractIntegerAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractIntegerAssertIsNotEqualTo { @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> intAssert, int n) { return Refaster.anyOf(intAssert.isNotCloseTo(n, offset(0)), intAssert.isNotCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractIntegerAssert<?> after(AbstractIntegerAssert<?> intAssert, int n) { return intAssert.isNotEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsNotZeroRecipe
- Refaster template
AssertJIntegerRules.AbstractIntegerAssertIsNotZero - Recipe created for the following Refaster template:
java static final class AbstractIntegerAssertIsNotZero { @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> intAssert) { return intAssert.isNotZero(); } @AfterTemplate AbstractIntegerAssert<?> after(AbstractIntegerAssert<?> intAssert) { return intAssert.isNotEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsOneRecipe
- Refaster template
AssertJIntegerRules.AbstractIntegerAssertIsOne - Recipe created for the following Refaster template:
java static final class AbstractIntegerAssertIsOne { @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> intAssert) { return intAssert.isOne(); } @AfterTemplate AbstractIntegerAssert<?> after(AbstractIntegerAssert<?> intAssert) { return intAssert.isEqualTo(1); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIntegerRulesRecipes$AbstractIntegerAssertIsZeroRecipe
- Refaster template
AssertJIntegerRules.AbstractIntegerAssertIsZero - Recipe created for the following Refaster template:
java static final class AbstractIntegerAssertIsZero { @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> intAssert) { return intAssert.isZero(); } @AfterTemplate AbstractIntegerAssert<?> after(AbstractIntegerAssert<?> intAssert) { return intAssert.isEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes
AssertJIterableRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJIterableRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes$AssertThatIterableHasOneElementEqualToRecipe
- Refaster template
AssertJIterableRules.AssertThatIterableHasOneElementEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIterableHasOneElementEqualTo<S, E extends S> { @BeforeTemplate ObjectAssert<S> before(Iterable<S> iterable, E element) { return assertThat(Iterables.getOnlyElement(iterable)).isEqualTo(element); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) IterableAssert<S> after(Iterable<S> iterable, E element) { return assertThat(iterable).containsExactly(element); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes$AssertThatIterableIsEmptyRecipe
- Refaster template
AssertJIterableRules.AssertThatIterableIsEmpty - Recipe created for the following Refaster template:
java static final class AssertThatIterableIsEmpty<E> { @BeforeTemplate void before(Iterable<E> iterable) { assertThat(iterable.iterator()).isExhausted(); } @BeforeTemplate void before(Collection<E> iterable) { assertThat(iterable.isEmpty()).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Iterable<E> iterable) { assertThat(iterable).isEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes$AssertThatIterableIsNotEmptyRecipe
- Refaster template
AssertJIterableRules.AssertThatIterableIsNotEmpty - Recipe created for the following Refaster template:
java static final class AssertThatIterableIsNotEmpty<E> { @BeforeTemplate AbstractAssert<?, ?> before(Iterable<E> iterable) { return assertThat(iterable.iterator()).hasNext(); } @BeforeTemplate AbstractAssert<?, ?> before(Collection<E> iterable) { return assertThat(iterable.isEmpty()).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) IterableAssert<E> after(Iterable<E> iterable) { return assertThat(iterable).isNotEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIterableRulesRecipes$AssertThatIterableSizeRecipe
- Refaster template
AssertJIterableRules.AssertThatIterableSize - Recipe created for the following Refaster template:
java static final class AssertThatIterableSize<E> { @BeforeTemplate AbstractIntegerAssert<?> before(Iterable<E> iterable) { return assertThat(Iterables.size(iterable)); } @BeforeTemplate AbstractIntegerAssert<?> before(Collection<E> iterable) { return assertThat(iterable.size()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractIntegerAssert<?> after(Iterable<E> iterable) { return assertThat(iterable).size(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIteratorRulesRecipes
AssertJIteratorRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJIteratorRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJIteratorRulesRecipes$AssertThatHasNextRecipe
- Refaster template
AssertJIteratorRules.AssertThatHasNext - Recipe created for the following Refaster template:
java static final class AssertThatHasNext<T> { @BeforeTemplate AbstractBooleanAssert<?> before(Iterator<T> iterator) { return assertThat(iterator.hasNext()).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) IteratorAssert<T> after(Iterator<T> iterator) { return assertThat(iterator).hasNext(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJIteratorRulesRecipes$AssertThatIsExhaustedRecipe
- Refaster template
AssertJIteratorRules.AssertThatIsExhausted - Recipe created for the following Refaster template:
java static final class AssertThatIsExhausted<T> { @BeforeTemplate AbstractBooleanAssert<?> before(Iterator<T> iterator) { return assertThat(iterator.hasNext()).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) IteratorAssert<T> after(Iterator<T> iterator) { return assertThat(iterator).isExhausted(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJLongRulesRecipes
AssertJLongRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJLongRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJLongRulesRecipes$AbstractLongAssertIsEqualToRecipe
- Refaster template
AssertJLongRules.AbstractLongAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractLongAssertIsEqualTo { @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> longAssert, long n) { return Refaster.anyOf(longAssert.isCloseTo(n, offset(0L)), longAssert.isCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractLongAssert<?> after(AbstractLongAssert<?> longAssert, long n) { return longAssert.isEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJLongRulesRecipes$AbstractLongAssertIsNotEqualToRecipe
- Refaster template
AssertJLongRules.AbstractLongAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractLongAssertIsNotEqualTo { @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> longAssert, long n) { return Refaster.anyOf(longAssert.isNotCloseTo(n, offset(0L)), longAssert.isNotCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractLongAssert<?> after(AbstractLongAssert<?> longAssert, long n) { return longAssert.isNotEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJLongRulesRecipes$AbstractLongAssertIsNotZeroRecipe
- Refaster template
AssertJLongRules.AbstractLongAssertIsNotZero - Recipe created for the following Refaster template:
java static final class AbstractLongAssertIsNotZero { @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> longAssert) { return longAssert.isNotZero(); } @AfterTemplate AbstractLongAssert<?> after(AbstractLongAssert<?> longAssert) { return longAssert.isNotEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJLongRulesRecipes$AbstractLongAssertIsOneRecipe
- Refaster template
AssertJLongRules.AbstractLongAssertIsOne - Recipe created for the following Refaster template:
java static final class AbstractLongAssertIsOne { @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> longAssert) { return longAssert.isOne(); } @AfterTemplate AbstractLongAssert<?> after(AbstractLongAssert<?> longAssert) { return longAssert.isEqualTo(1); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJLongRulesRecipes$AbstractLongAssertIsZeroRecipe
- Refaster template
AssertJLongRules.AbstractLongAssertIsZero - Recipe created for the following Refaster template:
java static final class AbstractLongAssertIsZero { @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> longAssert) { return longAssert.isZero(); } @AfterTemplate AbstractLongAssert<?> after(AbstractLongAssert<?> longAssert) { return longAssert.isEqualTo(0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes
AssertJMapRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJMapRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AbstractMapAssertContainsExactlyEntriesOfRecipe
- Refaster template
AssertJMapRules.AbstractMapAssertContainsExactlyEntriesOf - Recipe created for the following Refaster template:
java static final class AbstractMapAssertContainsExactlyEntriesOf<K, V> { @BeforeTemplate AbstractMapAssert<?, ?, K, V> before(AbstractMapAssert<?, ?, K, V> mapAssert, K key, V value) { return mapAssert.containsExactlyInAnyOrderEntriesOf(ImmutableMap.of(key, value)); } @AfterTemplate AbstractMapAssert<?, ?, K, V> after(AbstractMapAssert<?, ?, K, V> mapAssert, K key, V value) { return mapAssert.containsExactlyEntriesOf(ImmutableMap.of(key, value)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AbstractMapAssertContainsExactlyInAnyOrderEntriesOfRecipe
- Refaster template
AssertJMapRules.AbstractMapAssertContainsExactlyInAnyOrderEntriesOf - Recipe created for the following Refaster template:
java static final class AbstractMapAssertContainsExactlyInAnyOrderEntriesOf<K, V> { @BeforeTemplate AbstractMapAssert<?, ?, K, V> before(AbstractMapAssert<?, ?, K, V> mapAssert, Map<? extends K, ? extends V> map) { return mapAssert.isEqualTo(map); } @AfterTemplate AbstractMapAssert<?, ?, K, V> after(AbstractMapAssert<?, ?, K, V> mapAssert, Map<? extends K, ? extends V> map) { return mapAssert.containsExactlyInAnyOrderEntriesOf(map); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AbstractMapAssertHasSameSizeAsRecipe
- Refaster template
AssertJMapRules.AbstractMapAssertHasSameSizeAs - Recipe created for the following Refaster template:
java static final class AbstractMapAssertHasSameSizeAs<K, V> { @BeforeTemplate AbstractMapAssert<?, ?, K, V> before(AbstractMapAssert<?, ?, K, V> mapAssert, Map<?, ?> map) { return mapAssert.hasSize(map.size()); } @AfterTemplate AbstractMapAssert<?, ?, K, V> after(AbstractMapAssert<?, ?, K, V> mapAssert, Map<?, ?> map) { return mapAssert.hasSameSizeAs(map); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AssertThatMapContainsKeyRecipe
- Refaster template
AssertJMapRules.AssertThatMapContainsKey - Recipe created for the following Refaster template:
java static final class AssertThatMapContainsKey<K, V> { @BeforeTemplate AbstractAssert<?, ?> before(Map<K, V> map, K key) { return Refaster.anyOf(assertThat(map.containsKey(key)).isTrue(), assertThat(map.keySet()).contains(key)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) MapAssert<K, V> after(Map<K, V> map, K key) { return assertThat(map).containsKey(key); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AssertThatMapContainsOnlyKeyRecipe
- Refaster template
AssertJMapRules.AssertThatMapContainsOnlyKey - Recipe created for the following Refaster template:
java static final class AssertThatMapContainsOnlyKey<K, V> { @BeforeTemplate AbstractCollectionAssert<?, Collection<? extends K>, K, ?> before(Map<K, V> map, K key) { return assertThat(map.keySet()).containsExactly(key); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) MapAssert<K, V> after(Map<K, V> map, K key) { return assertThat(map).containsOnlyKeys(key); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AssertThatMapContainsOnlyKeysRecipe
- Refaster template
AssertJMapRules.AssertThatMapContainsOnlyKeys - Recipe created for the following Refaster template:
java static final class AssertThatMapContainsOnlyKeys<K, V> { @BeforeTemplate AbstractCollectionAssert<?, Collection<? extends K>, K, ?> before(Map<K, V> map, Iterable<? extends K> keys) { return assertThat(map.keySet()).hasSameElementsAs(keys); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) MapAssert<K, V> after(Map<K, V> map, Iterable<? extends K> keys) { return assertThat(map).containsOnlyKeys(keys); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AssertThatMapContainsValueRecipe
- Refaster template
AssertJMapRules.AssertThatMapContainsValue - Recipe created for the following Refaster template:
java static final class AssertThatMapContainsValue<K, V> { @BeforeTemplate AbstractAssert<? extends AbstractAssert<?, ?>, ? extends Object> before(Map<K, V> map, V value) { return Refaster.anyOf(assertThat(map.containsValue(value)).isTrue(), assertThat(map.values()).contains(value)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) MapAssert<K, V> after(Map<K, V> map, V value) { return assertThat(map).containsValue(value); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AssertThatMapDoesNotContainKeyRecipe
- Refaster template
AssertJMapRules.AssertThatMapDoesNotContainKey - Recipe created for the following Refaster template:
java static final class AssertThatMapDoesNotContainKey<K, V> { @BeforeTemplate AbstractAssert<?, ?> before(Map<K, V> map, K key) { return Refaster.anyOf(assertThat(map.containsKey(key)).isFalse(), assertThat(map.keySet()).doesNotContain(key)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) MapAssert<K, V> after(Map<K, V> map, K key) { return assertThat(map).doesNotContainKey(key); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AssertThatMapDoesNotContainValueRecipe
- Refaster template
AssertJMapRules.AssertThatMapDoesNotContainValue - Recipe created for the following Refaster template:
java static final class AssertThatMapDoesNotContainValue<K, V> { @BeforeTemplate AbstractAssert<?, ?> before(Map<K, V> map, V value) { return Refaster.anyOf(assertThat(map.containsValue(value)).isFalse(), assertThat(map.values()).doesNotContain(value)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) MapAssert<K, V> after(Map<K, V> map, V value) { return assertThat(map).doesNotContainValue(value); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJMapRulesRecipes$AssertThatMapIsEmptyRecipe
- Refaster template
AssertJMapRules.AssertThatMapIsEmpty - Recipe created for the following Refaster template:
java static final class AssertThatMapIsEmpty<K, V> { @BeforeTemplate void before(Map<K, V> map) { Refaster.anyOf(assertThat(map).hasSize(0), assertThat(map.isEmpty()).isTrue(), assertThat(map.size()).isEqualTo(0L), assertThat(map.size()).isNotPositive()); } @BeforeTemplate void before2(Map<K, V> map) { assertThat(Refaster.anyOf(map.keySet(), map.values(), map.entrySet())).isEmpty(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Map<K, V> map) { assertThat(map).isEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJNumberRulesRecipes
AssertJNumberRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJNumberRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJNumberRulesRecipes$NumberAssertIsNegativeRecipe
- Refaster template
AssertJNumberRules.NumberAssertIsNegative - Recipe created for the following Refaster template:
java static final class NumberAssertIsNegative { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThan((byte)0), numberAssert.isLessThanOrEqualTo((byte)-1)); } @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThan((short)0), numberAssert.isLessThanOrEqualTo((short)-1)); } @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThan(0), numberAssert.isLessThanOrEqualTo(-1)); } @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThan(0), numberAssert.isLessThanOrEqualTo(-1)); } @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> numberAssert) { return numberAssert.isLessThan(0); } @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> numberAssert) { return numberAssert.isLessThan(0); } @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThan(BigInteger.ZERO), numberAssert.isLessThanOrEqualTo(BigInteger.valueOf(-1))); } @BeforeTemplate AbstractBigDecimalAssert<?> before(AbstractBigDecimalAssert<?> numberAssert) { return numberAssert.isLessThan(BigDecimal.ZERO); } @AfterTemplate NumberAssert<?, ?> after(NumberAssert<?, ?> numberAssert) { return numberAssert.isNegative(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJNumberRulesRecipes$NumberAssertIsNotNegativeRecipe
- Refaster template
AssertJNumberRules.NumberAssertIsNotNegative - Recipe created for the following Refaster template:
java static final class NumberAssertIsNotNegative { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThanOrEqualTo((byte)0), numberAssert.isGreaterThan((byte)-1)); } @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThanOrEqualTo((short)0), numberAssert.isGreaterThan((short)-1)); } @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThanOrEqualTo(0), numberAssert.isGreaterThan(-1)); } @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThanOrEqualTo(0), numberAssert.isGreaterThan(-1)); } @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> numberAssert) { return numberAssert.isGreaterThanOrEqualTo(0); } @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> numberAssert) { return numberAssert.isGreaterThanOrEqualTo(0); } @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThanOrEqualTo(BigInteger.ZERO), numberAssert.isGreaterThan(BigInteger.valueOf(-1))); } @BeforeTemplate AbstractBigDecimalAssert<?> before(AbstractBigDecimalAssert<?> numberAssert) { return numberAssert.isGreaterThanOrEqualTo(BigDecimal.ZERO); } @AfterTemplate NumberAssert<?, ?> after(NumberAssert<?, ?> numberAssert) { return numberAssert.isNotNegative(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJNumberRulesRecipes$NumberAssertIsNotPositiveRecipe
- Refaster template
AssertJNumberRules.NumberAssertIsNotPositive - Recipe created for the following Refaster template:
java static final class NumberAssertIsNotPositive { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThanOrEqualTo((byte)0), numberAssert.isLessThan((byte)1)); } @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThanOrEqualTo((short)0), numberAssert.isLessThan((short)1)); } @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThanOrEqualTo(0), numberAssert.isLessThan(1)); } @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThanOrEqualTo(0), numberAssert.isLessThan(1)); } @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> numberAssert) { return numberAssert.isLessThanOrEqualTo(0); } @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> numberAssert) { return numberAssert.isLessThanOrEqualTo(0); } @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isLessThanOrEqualTo(BigInteger.ZERO), numberAssert.isLessThan(BigInteger.valueOf(1))); } @BeforeTemplate AbstractBigDecimalAssert<?> before(AbstractBigDecimalAssert<?> numberAssert) { return numberAssert.isLessThanOrEqualTo(BigDecimal.ZERO); } @AfterTemplate NumberAssert<?, ?> after(NumberAssert<?, ?> numberAssert) { return numberAssert.isNotPositive(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJNumberRulesRecipes$NumberAssertIsPositiveRecipe
- Refaster template
AssertJNumberRules.NumberAssertIsPositive - Recipe created for the following Refaster template:
java static final class NumberAssertIsPositive { @BeforeTemplate AbstractByteAssert<?> before(AbstractByteAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThan((byte)0), numberAssert.isGreaterThanOrEqualTo((byte)1)); } @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThan((short)0), numberAssert.isGreaterThanOrEqualTo((short)1)); } @BeforeTemplate AbstractIntegerAssert<?> before(AbstractIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThan(0), numberAssert.isGreaterThanOrEqualTo(1)); } @BeforeTemplate AbstractLongAssert<?> before(AbstractLongAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThan(0), numberAssert.isGreaterThanOrEqualTo(1)); } @BeforeTemplate AbstractFloatAssert<?> before(AbstractFloatAssert<?> numberAssert) { return numberAssert.isGreaterThan(0); } @BeforeTemplate AbstractDoubleAssert<?> before(AbstractDoubleAssert<?> numberAssert) { return numberAssert.isGreaterThan(0); } @BeforeTemplate AbstractBigIntegerAssert<?> before(AbstractBigIntegerAssert<?> numberAssert) { return Refaster.anyOf(numberAssert.isGreaterThan(BigInteger.ZERO), numberAssert.isGreaterThanOrEqualTo(BigInteger.valueOf(1))); } @BeforeTemplate AbstractBigDecimalAssert<?> before(AbstractBigDecimalAssert<?> numberAssert) { return numberAssert.isGreaterThan(BigDecimal.ZERO); } @AfterTemplate NumberAssert<?, ?> after(NumberAssert<?, ?> numberAssert) { return numberAssert.isPositive(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes
AssertJObjectRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJObjectRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatHasSameHashCodeAsRecipe
- Refaster template
AssertJObjectRules.AssertThatHasSameHashCodeAs - Recipe created for the following Refaster template:
java static final class AssertThatHasSameHashCodeAs<T> { @BeforeTemplate AbstractIntegerAssert<?> before(T object1, T object2) { return assertThat(object1.hashCode()).isEqualTo(object2.hashCode()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<T> after(T object1, T object2) { return assertThat(object1).hasSameHashCodeAs(object2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatHasToStringRecipe
- Refaster template
AssertJObjectRules.AssertThatHasToString - Recipe created for the following Refaster template:
java static final class AssertThatHasToString<T> { @BeforeTemplate AbstractStringAssert<?> before(T object, String str) { return assertThat(object.toString()).isEqualTo(str); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<T> after(T object, String str) { return assertThat(object).hasToString(str); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatIsInstanceOf2Recipe
- Refaster template
AssertJObjectRules.AssertThatIsInstanceOf2 - Recipe created for the following Refaster template:
java static final class AssertThatIsInstanceOf2<S, T> { @BeforeTemplate AbstractBooleanAssert<?> before(T object, Class<S> clazz) { return assertThat(clazz.isInstance(object)).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<T> after(T object, Class<S> clazz) { return assertThat(object).isInstanceOf(clazz); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatIsIsEqualToRecipe
- Refaster template
AssertJObjectRules.AssertThatIsIsEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsIsEqualTo<S, T> { @BeforeTemplate AbstractBooleanAssert<?> before(S object1, T object2) { return assertThat(object1.equals(object2)).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<S> after(S object1, T object2) { return assertThat(object1).isEqualTo(object2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatIsIsNotEqualToRecipe
- Refaster template
AssertJObjectRules.AssertThatIsIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsIsNotEqualTo<S, T> { @BeforeTemplate AbstractBooleanAssert<?> before(S object1, T object2) { return assertThat(object1.equals(object2)).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<S> after(S object1, T object2) { return assertThat(object1).isNotEqualTo(object2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatIsNotNullRecipe
- Refaster template
AssertJObjectRules.AssertThatIsNotNull - Recipe created for the following Refaster template:
java static final class AssertThatIsNotNull<T> { @BeforeTemplate @SuppressWarnings(value = "AssertThatIsNotSameAs") AbstractBooleanAssert<? extends AbstractBooleanAssert<?>> before(T object) { return Refaster.anyOf(assertThat(object == null).isFalse(), assertThat(object != null).isTrue()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<T> after(T object) { return assertThat(object).isNotNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatIsNotSameAsRecipe
- Refaster template
AssertJObjectRules.AssertThatIsNotSameAs - Recipe created for the following Refaster template:
java static final class AssertThatIsNotSameAs<T> { @BeforeTemplate AbstractBooleanAssert<?> before(T object1, T object2) { return Refaster.anyOf(assertThat(object1 == object2).isFalse(), assertThat(object1 != object2).isTrue()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<T> after(T object1, T object2) { return assertThat(object1).isNotSameAs(object2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatIsNullRecipe
- Refaster template
AssertJObjectRules.AssertThatIsNull - Recipe created for the following Refaster template:
java static final class AssertThatIsNull<T> { @BeforeTemplate @SuppressWarnings(value = "AssertThatIsSameAs") void before(T object) { assertThat(object == null).isTrue(); } @BeforeTemplate @SuppressWarnings(value = "AssertThatIsSameAs") void before2(T object) { assertThat(object != null).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(T object) { assertThat(object).isNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJObjectRulesRecipes$AssertThatIsSameAsRecipe
- Refaster template
AssertJObjectRules.AssertThatIsSameAs - Recipe created for the following Refaster template:
java static final class AssertThatIsSameAs<T> { @BeforeTemplate AbstractBooleanAssert<?> before(T object1, T object2) { return Refaster.anyOf(assertThat(object1 == object2).isTrue(), assertThat(object1 != object2).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectAssert<T> after(T object1, T object2) { return assertThat(object1).isSameAs(object2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes
AssertJOptionalRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJOptionalRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AbstractOptionalAssertContainsSameRecipe
- Refaster template
AssertJOptionalRules.AbstractOptionalAssertContainsSame - Recipe created for the following Refaster template:
java static final class AbstractOptionalAssertContainsSame<T> { @BeforeTemplate AbstractAssert<?, ?> before(AbstractOptionalAssert<?, T> optionalAssert, T value) { return Refaster.anyOf(optionalAssert.get().isSameAs(value), optionalAssert.isPresent().isSameAs(value)); } @AfterTemplate AbstractOptionalAssert<?, T> after(AbstractOptionalAssert<?, T> optionalAssert, T value) { return optionalAssert.containsSame(value); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AbstractOptionalAssertHasValueRecipe
- Refaster template
AssertJOptionalRules.AbstractOptionalAssertHasValue - Recipe created for the following Refaster template:
java static final class AbstractOptionalAssertHasValue<T> { @BeforeTemplate AbstractAssert<?, ?> before(AbstractOptionalAssert<?, T> optionalAssert, T value) { return Refaster.anyOf(optionalAssert.get().isEqualTo(value), optionalAssert.isEqualTo(Optional.of(value)), optionalAssert.contains(value), optionalAssert.isPresent().hasValue(value)); } @AfterTemplate AbstractOptionalAssert<?, T> after(AbstractOptionalAssert<?, T> optionalAssert, T value) { return optionalAssert.hasValue(value); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AbstractOptionalAssertIsEmptyRecipe
- Refaster template
AssertJOptionalRules.AbstractOptionalAssertIsEmpty - Recipe created for the following Refaster template:
java static final class AbstractOptionalAssertIsEmpty<T> { @BeforeTemplate AbstractAssert<?, ?> before(AbstractOptionalAssert<?, T> optionalAssert) { return Refaster.anyOf(optionalAssert.isNotPresent(), optionalAssert.isEqualTo(Optional.empty())); } @AfterTemplate AbstractOptionalAssert<?, T> after(AbstractOptionalAssert<?, T> optionalAssert) { return optionalAssert.isEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AbstractOptionalAssertIsPresentRecipe
- Refaster template
AssertJOptionalRules.AbstractOptionalAssertIsPresent - Recipe created for the following Refaster template:
java static final class AbstractOptionalAssertIsPresent<T> { @BeforeTemplate AbstractAssert<?, ?> before(AbstractOptionalAssert<?, T> optionalAssert) { return Refaster.anyOf(optionalAssert.isNotEmpty(), optionalAssert.isNotEqualTo(Optional.empty())); } @AfterTemplate AbstractOptionalAssert<?, T> after(AbstractOptionalAssert<?, T> optionalAssert) { return optionalAssert.isPresent(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AssertThatOptionalHasValueMatchingRecipe
- Refaster template
AssertJOptionalRules.AssertThatOptionalHasValueMatching - Recipe created for the following Refaster template:
java static final class AssertThatOptionalHasValueMatching<T> { @BeforeTemplate AbstractOptionalAssert<?, T> before(Optional<T> optional, Predicate<? super T> predicate) { return assertThat(optional.filter(predicate)).isPresent(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, T> after(Optional<T> optional, Predicate<? super T> predicate) { return assertThat(optional).get().matches(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AssertThatOptionalIsEmptyRecipe
- Refaster template
AssertJOptionalRules.AssertThatOptionalIsEmpty - Recipe created for the following Refaster template:
java static final class AssertThatOptionalIsEmpty<T> { @BeforeTemplate AbstractAssert<?, ?> before(Optional<T> optional) { return Refaster.anyOf(assertThat(optional.isEmpty()).isTrue(), assertThat(optional.isPresent()).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) OptionalAssert<T> after(Optional<T> optional) { return assertThat(optional).isEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AssertThatOptionalIsPresentRecipe
- Refaster template
AssertJOptionalRules.AssertThatOptionalIsPresent - Recipe created for the following Refaster template:
java static final class AssertThatOptionalIsPresent<T> { @BeforeTemplate AbstractAssert<?, ?> before(Optional<T> optional) { return Refaster.anyOf(assertThat(optional.isPresent()).isTrue(), assertThat(optional.isEmpty()).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) OptionalAssert<T> after(Optional<T> optional) { return assertThat(optional).isPresent(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJOptionalRulesRecipes$AssertThatOptionalRecipe
- Refaster template
AssertJOptionalRules.AssertThatOptional - Recipe created for the following Refaster template:
java static final class AssertThatOptional<T> { @BeforeTemplate ObjectAssert<T> before(Optional<T> optional) { return assertThat(optional.orElseThrow()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, T> after(Optional<T> optional) { return assertThat(optional).get(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes
- Refaster rules related to AssertJ assertions over
Paths - These rules simplify and improve the readability of tests by using
Path-specific AssertJ assertion methods instead of generic assertions. Source.
- Refaster rules related to AssertJ assertions over
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatDoesNotExistRecipe
- Refaster template
AssertJPathRules.AssertThatDoesNotExist - Recipe created for the following Refaster template:
java static final class AssertThatDoesNotExist { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.exists(actual)).isFalse(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).doesNotExist(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatEndsWithRawRecipe
- Refaster template
AssertJPathRules.AssertThatEndsWithRaw - Recipe created for the following Refaster template:
java static final class AssertThatEndsWithRaw { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual, Path other) { return assertThat(actual.endsWith(other)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual, Path other) { return assertThat(actual).endsWithRaw(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatExistsRecipe
- Refaster template
AssertJPathRules.AssertThatExists - Recipe created for the following Refaster template:
java static final class AssertThatExists { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.exists(actual)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).exists(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatHasFileNameRecipe
- Refaster template
AssertJPathRules.AssertThatHasFileName - Recipe created for the following Refaster template:
java static final class AssertThatHasFileName { @BeforeTemplate AbstractPathAssert<?> before(Path actual, String fileName) { return assertThat(actual.getFileName()).hasToString(fileName); } @AfterTemplate AbstractPathAssert<?> after(Path actual, String fileName) { return assertThat(actual).hasFileName(fileName); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatHasNoParentRecipe
- Refaster template
AssertJPathRules.AssertThatHasNoParent - Recipe created for the following Refaster template:
java static final class AssertThatHasNoParent { @BeforeTemplate void before(Path actual) { assertThat(actual.getParent()).isNull(); } @AfterTemplate void after(Path actual) { assertThat(actual).hasNoParent(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatHasParentRawRecipe
- Refaster template
AssertJPathRules.AssertThatHasParentRaw - Recipe created for the following Refaster template:
java static final class AssertThatHasParentRaw { @BeforeTemplate AbstractPathAssert<?> before(Path actual, Path expected) { return assertThat(actual.getParent()).isEqualTo(expected); } @AfterTemplate AbstractPathAssert<?> after(Path actual, Path expected) { return assertThat(actual).hasParentRaw(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsAbsoluteRecipe
- Refaster template
AssertJPathRules.AssertThatIsAbsolute - Recipe created for the following Refaster template:
java static final class AssertThatIsAbsolute { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(actual.isAbsolute()).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isAbsolute(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsDirectoryRecipe
- Refaster template
AssertJPathRules.AssertThatIsDirectory - Recipe created for the following Refaster template:
java static final class AssertThatIsDirectory { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.isDirectory(actual)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isDirectory(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsExecutableRecipe
- Refaster template
AssertJPathRules.AssertThatIsExecutable - Recipe created for the following Refaster template:
java static final class AssertThatIsExecutable { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.isExecutable(actual)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isExecutable(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsReadableRecipe
- Refaster template
AssertJPathRules.AssertThatIsReadable - Recipe created for the following Refaster template:
java static final class AssertThatIsReadable { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.isReadable(actual)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isReadable(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsRegularFileRecipe
- Refaster template
AssertJPathRules.AssertThatIsRegularFile - Recipe created for the following Refaster template:
java static final class AssertThatIsRegularFile { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.isRegularFile(actual)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isRegularFile(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsRelativeRecipe
- Refaster template
AssertJPathRules.AssertThatIsRelative - Recipe created for the following Refaster template:
java static final class AssertThatIsRelative { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(actual.isAbsolute()).isFalse(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isRelative(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsSymbolicLinkRecipe
- Refaster template
AssertJPathRules.AssertThatIsSymbolicLink - Recipe created for the following Refaster template:
java static final class AssertThatIsSymbolicLink { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.isSymbolicLink(actual)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isSymbolicLink(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatIsWritableRecipe
- Refaster template
AssertJPathRules.AssertThatIsWritable - Recipe created for the following Refaster template:
java static final class AssertThatIsWritable { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual) { return assertThat(Files.isWritable(actual)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual) { return assertThat(actual).isWritable(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPathRulesRecipes$AssertThatStartsWithRawRecipe
- Refaster template
AssertJPathRules.AssertThatStartsWithRaw - Recipe created for the following Refaster template:
java static final class AssertThatStartsWithRaw { @BeforeTemplate AbstractBooleanAssert<?> before(Path actual, Path other) { return assertThat(actual.startsWith(other)).isTrue(); } @AfterTemplate AbstractPathAssert<?> after(Path actual, Path other) { return assertThat(actual).startsWithRaw(other); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPrimitiveRulesRecipes
AssertJPrimitiveRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJPrimitiveRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJPrimitiveRulesRecipes$AssertThatIsEqualToRecipe
- Refaster template
AssertJPrimitiveRules.AssertThatIsEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(boolean actual, boolean expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @BeforeTemplate AbstractByteAssert<?> before(byte actual, byte expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @BeforeTemplate AbstractCharacterAssert<?> before(char actual, char expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @BeforeTemplate AbstractShortAssert<?> before(short actual, short expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @BeforeTemplate AbstractIntegerAssert<?> before(int actual, int expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @BeforeTemplate AbstractLongAssert<?> before(long actual, long expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @BeforeTemplate AbstractFloatAssert<?> before(float actual, float expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @BeforeTemplate AbstractDoubleAssert<?> before(double actual, double expected) { return Refaster.anyOf(assertThat(actual).isSameAs(expected), assertThat(actual).isSameAs(expected)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractBooleanAssert<?> after(boolean actual, boolean expected) { return assertThat(actual).isEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPrimitiveRulesRecipes$AssertThatIsGreaterThanOrEqualToRecipe
- Refaster template
AssertJPrimitiveRules.AssertThatIsGreaterThanOrEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsGreaterThanOrEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(double actual, double expected) { return Refaster.anyOf(assertThat(actual >= expected).isTrue(), assertThat(actual < expected).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractDoubleAssert<?> after(double actual, double expected) { return assertThat(actual).isGreaterThanOrEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPrimitiveRulesRecipes$AssertThatIsGreaterThanRecipe
- Refaster template
AssertJPrimitiveRules.AssertThatIsGreaterThan - Recipe created for the following Refaster template:
java static final class AssertThatIsGreaterThan { @BeforeTemplate AbstractBooleanAssert<?> before(double actual, double expected) { return Refaster.anyOf(assertThat(actual > expected).isTrue(), assertThat(actual <= expected).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractDoubleAssert<?> after(double actual, double expected) { return assertThat(actual).isGreaterThan(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPrimitiveRulesRecipes$AssertThatIsLessThanOrEqualToRecipe
- Refaster template
AssertJPrimitiveRules.AssertThatIsLessThanOrEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsLessThanOrEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(double actual, double expected) { return Refaster.anyOf(assertThat(actual <= expected).isTrue(), assertThat(actual > expected).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractDoubleAssert<?> after(double actual, double expected) { return assertThat(actual).isLessThanOrEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPrimitiveRulesRecipes$AssertThatIsLessThanRecipe
- Refaster template
AssertJPrimitiveRules.AssertThatIsLessThan - Recipe created for the following Refaster template:
java static final class AssertThatIsLessThan { @BeforeTemplate AbstractBooleanAssert<?> before(double actual, double expected) { return Refaster.anyOf(assertThat(actual < expected).isTrue(), assertThat(actual >= expected).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractDoubleAssert<?> after(double actual, double expected) { return assertThat(actual).isLessThan(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJPrimitiveRulesRecipes$AssertThatIsNotEqualToRecipe
- Refaster template
AssertJPrimitiveRules.AssertThatIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AssertThatIsNotEqualTo { @BeforeTemplate AbstractBooleanAssert<?> before(boolean actual, boolean expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @BeforeTemplate AbstractByteAssert<?> before(byte actual, byte expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @BeforeTemplate AbstractCharacterAssert<?> before(char actual, char expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @BeforeTemplate AbstractShortAssert<?> before(short actual, short expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @BeforeTemplate AbstractIntegerAssert<?> before(int actual, int expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @BeforeTemplate AbstractLongAssert<?> before(long actual, long expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @BeforeTemplate AbstractFloatAssert<?> before(float actual, float expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @BeforeTemplate AbstractDoubleAssert<? extends AbstractDoubleAssert<?>> before(double actual, double expected) { return Refaster.anyOf(assertThat(actual).isNotSameAs(expected), assertThat(actual).isNotSameAs(expected)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractBooleanAssert<?> after(boolean actual, boolean expected) { return assertThat(actual).isNotEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes
AssertJRulesRefaster recipes- Refaster rules related to AssertJ expressions and statements. Source.
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatListsAreEqualRecipe
- Refaster template
AssertJRules.AssertThatListsAreEqual - Recipe created for the following Refaster template:
java static final class AssertThatListsAreEqual<S, T extends S> { @BeforeTemplate ListAssert<S> before(List<S> list1, Iterable<T> list2) { return assertThat(list1).isEqualTo(list2); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(List<S> list1, Iterable<T> list2) { return assertThat(list1).containsExactlyElementsOf(list2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatMapContainsEntryRecipe
- Refaster template
AssertJRules.AssertThatMapContainsEntry - Recipe created for the following Refaster template:
java static final class AssertThatMapContainsEntry<K, V> { @BeforeTemplate ObjectAssert<V> before(Map<K, V> map, K key, V value) { return assertThat(map.get(key)).isEqualTo(value); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) MapAssert<K, V> after(Map<K, V> map, K key, V value) { return assertThat(map).containsEntry(key, value); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatMultisetsAreEqualRecipe
- Refaster template
AssertJRules.AssertThatMultisetsAreEqual - Recipe created for the following Refaster template:
java static final class AssertThatMultisetsAreEqual<S, T extends S> { @BeforeTemplate AbstractCollectionAssert<?, ?, S, ?> before(Multiset<S> multiset1, Iterable<T> multiset2) { return assertThat(multiset1).isEqualTo(multiset2); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractCollectionAssert<?, ?, S, ?> after(Multiset<S> multiset1, Iterable<T> multiset2) { return assertThat(multiset1).containsExactlyInAnyOrderElementsOf(multiset2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatOptionalDoubleRecipe
- Refaster template
AssertJRules.AssertThatOptionalDouble - Recipe created for the following Refaster template:
java static final class AssertThatOptionalDouble { @BeforeTemplate AbstractDoubleAssert<?> before(OptionalDouble optional, double expected) { return assertThat(optional.getAsDouble()).isEqualTo(expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) OptionalDoubleAssert after(OptionalDouble optional, double expected) { return assertThat(optional).hasValue(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatOptionalIntRecipe
- Refaster template
AssertJRules.AssertThatOptionalInt - Recipe created for the following Refaster template:
java static final class AssertThatOptionalInt { @BeforeTemplate AbstractIntegerAssert<?> before(OptionalInt optional, int expected) { return assertThat(optional.getAsInt()).isEqualTo(expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) OptionalIntAssert after(OptionalInt optional, int expected) { return assertThat(optional).hasValue(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatOptionalLongRecipe
- Refaster template
AssertJRules.AssertThatOptionalLong - Recipe created for the following Refaster template:
java static final class AssertThatOptionalLong { @BeforeTemplate AbstractLongAssert<?> before(OptionalLong optional, long expected) { return assertThat(optional.getAsLong()).isEqualTo(expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) OptionalLongAssert after(OptionalLong optional, long expected) { return assertThat(optional).hasValue(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatPredicateAcceptsRecipe
- Refaster template
AssertJRules.AssertThatPredicateAccepts - Recipe created for the following Refaster template:
java static final class AssertThatPredicateAccepts<T> { @BeforeTemplate void before(Predicate<T> predicate, T object) { assertThat(predicate.test(object)).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Predicate<T> predicate, T object) { assertThat(predicate).accepts(object); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatPredicateRejectsRecipe
- Refaster template
AssertJRules.AssertThatPredicateRejects - Recipe created for the following Refaster template:
java static final class AssertThatPredicateRejects<T> { @BeforeTemplate void before(Predicate<T> predicate, T object) { assertThat(predicate.test(object)).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Predicate<T> predicate, T object) { assertThat(predicate).rejects(object); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatSetContainsExactlyOneElementRecipe
- Refaster template
AssertJRules.AssertThatSetContainsExactlyOneElement - Recipe created for the following Refaster template:
java static final class AssertThatSetContainsExactlyOneElement<S, T extends S> { @BeforeTemplate ObjectEnumerableAssert<?, S> before(Set<S> set, T element) { return assertThat(set).containsOnly(element); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ObjectEnumerableAssert<?, S> after(Set<S> set, T element) { return assertThat(set).containsExactly(element); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatSetsAreEqualRecipe
- Refaster template
AssertJRules.AssertThatSetsAreEqual - Recipe created for the following Refaster template:
java static final class AssertThatSetsAreEqual<S, T extends S> { @BeforeTemplate AbstractCollectionAssert<?, ?, S, ?> before(Set<S> set1, Iterable<T> set2) { return Refaster.anyOf(assertThat(set1).isEqualTo(set2), assertThat(set1).containsExactlyInAnyOrderElementsOf(set2)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractCollectionAssert<?, ?, S, ?> after(Set<S> set1, Iterable<T> set2) { return assertThat(set1).hasSameElementsAs(set2); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsAllRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsAll - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsAll<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).containsAll(iterable); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsAll(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).containsAll(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsAnyElementsOfRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsAnyElementsOf - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsAnyElementsOf<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).containsAnyElementsOf(iterable); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsAnyElementsOf(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).containsAnyElementsOf(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsAnyOfRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsAnyOf - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsAnyOf<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, U[] array, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).containsAnyOf(array); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, U[] array, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsAnyOf(array); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, U[] array) { return assertThat(stream).containsAnyOf(array); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsExactlyElementsOfRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsExactlyElementsOf - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsExactlyElementsOf<S, T extends S, U extends T> { @BeforeTemplate ListAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsExactlyElementsOf(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).containsExactlyElementsOf(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsExactlyInAnyOrderElementsOfRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsExactlyInAnyOrderElementsOf - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsExactlyInAnyOrderElementsOf<S, T extends S, U extends T> { @BeforeTemplate ListAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsExactlyInAnyOrderElementsOf(iterable); } @BeforeTemplate AbstractCollectionAssert<?, ?, T, ?> before2(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends Multiset<T>> collector) { return assertThat(stream.collect(collector)).containsExactlyInAnyOrderElementsOf(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).containsExactlyInAnyOrderElementsOf(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsExactlyInAnyOrderRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsExactlyInAnyOrder - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsExactlyInAnyOrder<S, T extends S, U extends T> { @BeforeTemplate ListAssert<T> before(Stream<S> stream, U[] array, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsExactlyInAnyOrder(array); } @BeforeTemplate AbstractCollectionAssert<?, ?, T, ?> before2(Stream<S> stream, U[] array, Collector<S, ?, ? extends Multiset<T>> collector) { return assertThat(stream.collect(collector)).containsExactlyInAnyOrder(array); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, U[] array) { return assertThat(stream).containsExactlyInAnyOrder(array); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsExactlyRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsExactly<S, T extends S, U extends T> { @BeforeTemplate ListAssert<T> before(Stream<S> stream, U[] array, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsExactly(array); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, U[] array) { return assertThat(stream).containsExactly(array); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsOnlyRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsOnly - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsOnly<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, U[] array, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).containsOnly(array); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, U[] array, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsOnly(array); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, U[] array) { return assertThat(stream).containsOnly(array); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsRecipe
- Refaster template
AssertJRules.AssertThatStreamContains - Recipe created for the following Refaster template:
java static final class AssertThatStreamContains<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, U[] array, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).contains(array); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, U[] array, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).contains(array); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, U[] array) { return assertThat(stream).contains(array); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsSequenceRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsSequence - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsSequence<S, T extends S, U extends T> { @BeforeTemplate ListAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsSequence(iterable); } @BeforeTemplate ListAssert<T> before(Stream<S> stream, U[] iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsSequence(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).containsSequence(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamContainsSubsequenceRecipe
- Refaster template
AssertJRules.AssertThatStreamContainsSubsequence - Recipe created for the following Refaster template:
java static final class AssertThatStreamContainsSubsequence<S, T extends S, U extends T> { @BeforeTemplate ListAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsSubsequence(iterable); } @BeforeTemplate ListAssert<T> before(Stream<S> stream, U[] iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).containsSubsequence(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).containsSubsequence(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamDoesNotContainAnyElementsOfRecipe
- Refaster template
AssertJRules.AssertThatStreamDoesNotContainAnyElementsOf - Recipe created for the following Refaster template:
java static final class AssertThatStreamDoesNotContainAnyElementsOf<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).doesNotContainAnyElementsOf(iterable); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).doesNotContainAnyElementsOf(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).doesNotContainAnyElementsOf(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamDoesNotContainRecipe
- Refaster template
AssertJRules.AssertThatStreamDoesNotContain - Recipe created for the following Refaster template:
java static final class AssertThatStreamDoesNotContain<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, U[] array, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).doesNotContain(array); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, U[] array, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).doesNotContain(array); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, U[] array) { return assertThat(stream).doesNotContain(array); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamDoesNotContainSequenceRecipe
- Refaster template
AssertJRules.AssertThatStreamDoesNotContainSequence - Recipe created for the following Refaster template:
java static final class AssertThatStreamDoesNotContainSequence<S, T extends S, U extends T> { @BeforeTemplate ListAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).doesNotContainSequence(iterable); } @BeforeTemplate ListAssert<T> before(Stream<S> stream, U[] iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).doesNotContainSequence(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).doesNotContainSequence(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamHasSameElementsAsRecipe
- Refaster template
AssertJRules.AssertThatStreamHasSameElementsAs - Recipe created for the following Refaster template:
java static final class AssertThatStreamHasSameElementsAs<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).hasSameElementsAs(iterable); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).hasSameElementsAs(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, Iterable<U> iterable) { return assertThat(stream).hasSameElementsAs(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamHasSizeRecipe
- Refaster template
AssertJRules.AssertThatStreamHasSize - Recipe created for the following Refaster template:
java static final class AssertThatStreamHasSize<T> { @BeforeTemplate void before(Stream<T> stream, int size) { assertThat(stream.count()).isEqualTo(size); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Stream<T> stream, int size) { assertThat(stream).hasSize(size); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamIsEmptyRecipe
- Refaster template
AssertJRules.AssertThatStreamIsEmpty - Recipe created for the following Refaster template:
java static final class AssertThatStreamIsEmpty<S, T extends S> { @BeforeTemplate void before(Stream<S> stream, Collector<S, ?, ? extends Iterable<T>> collector) { assertThat(stream.collect(collector)).isEmpty(); } @BeforeTemplate void before2(Stream<S> stream, Collector<S, ?, ? extends List<T>> collector) { assertThat(stream.collect(collector)).isEmpty(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Stream<S> stream) { assertThat(stream).isEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamIsNotEmptyRecipe
- Refaster template
AssertJRules.AssertThatStreamIsNotEmpty - Recipe created for the following Refaster template:
java static final class AssertThatStreamIsNotEmpty<S, T extends S> { @BeforeTemplate void before(Stream<S> stream, Collector<S, ?, ? extends Iterable<T>> collector) { assertThat(stream.collect(collector)).isNotEmpty(); } @BeforeTemplate void before2(Stream<S> stream, Collector<S, ?, ? extends List<T>> collector) { assertThat(stream.collect(collector)).isNotEmpty(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Stream<S> stream) { assertThat(stream).isNotEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$AssertThatStreamIsSubsetOfRecipe
- Refaster template
AssertJRules.AssertThatStreamIsSubsetOf - Recipe created for the following Refaster template:
java static final class AssertThatStreamIsSubsetOf<S, T extends S, U extends T> { @BeforeTemplate IterableAssert<T> before(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).isSubsetOf(iterable); } @BeforeTemplate IterableAssert<T> before(Stream<S> stream, U[] iterable, Collector<S, ?, ? extends Iterable<T>> collector) { return assertThat(stream.collect(collector)).isSubsetOf(iterable); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, Iterable<U> iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).isSubsetOf(iterable); } @BeforeTemplate ListAssert<T> before2(Stream<S> stream, U[] iterable, Collector<S, ?, ? extends List<T>> collector) { return assertThat(stream.collect(collector)).isSubsetOf(iterable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<S> after(Stream<S> stream, U[] iterable) { return assertThat(stream).isSubsetOf(iterable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$ObjectEnumerableContainsOneElementRecipe
- Refaster template
AssertJRules.ObjectEnumerableContainsOneElement - Recipe created for the following Refaster template:
java static final class ObjectEnumerableContainsOneElement<S, T extends S> { @BeforeTemplate @SuppressWarnings(value = "unchecked") ObjectEnumerableAssert<?, S> before(ObjectEnumerableAssert<?, S> iterAssert, T element) { return Refaster.anyOf(iterAssert.containsAnyOf(element), iterAssert.containsSequence(element), iterAssert.containsSubsequence(element)); } @AfterTemplate @SuppressWarnings(value = "unchecked") ObjectEnumerableAssert<?, S> after(ObjectEnumerableAssert<?, S> iterAssert, T element) { return iterAssert.contains(element); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJRulesRecipes$ObjectEnumerableDoesNotContainOneElementRecipe
- Refaster template
AssertJRules.ObjectEnumerableDoesNotContainOneElement - Recipe created for the following Refaster template:
java static final class ObjectEnumerableDoesNotContainOneElement<S, T extends S> { @BeforeTemplate @SuppressWarnings(value = "unchecked") ObjectEnumerableAssert<?, S> before(ObjectEnumerableAssert<?, S> iterAssert, T element) { return iterAssert.doesNotContainSequence(element); } @AfterTemplate @SuppressWarnings(value = "unchecked") ObjectEnumerableAssert<?, S> after(ObjectEnumerableAssert<?, S> iterAssert, T element) { return iterAssert.doesNotContain(element); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJShortRulesRecipes
AssertJShortRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJShortRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJShortRulesRecipes$AbstractShortAssertIsEqualToRecipe
- Refaster template
AssertJShortRules.AbstractShortAssertIsEqualTo - Recipe created for the following Refaster template:
java static final class AbstractShortAssertIsEqualTo { @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> shortAssert, short n) { return Refaster.anyOf(shortAssert.isCloseTo(n, offset((short)0)), shortAssert.isCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractShortAssert<?> after(AbstractShortAssert<?> shortAssert, short n) { return shortAssert.isEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJShortRulesRecipes$AbstractShortAssertIsNotEqualToRecipe
- Refaster template
AssertJShortRules.AbstractShortAssertIsNotEqualTo - Recipe created for the following Refaster template:
java static final class AbstractShortAssertIsNotEqualTo { @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> shortAssert, short n) { return Refaster.anyOf(shortAssert.isNotCloseTo(n, offset((short)0)), shortAssert.isNotCloseTo(n, withPercentage(0))); } @AfterTemplate AbstractShortAssert<?> after(AbstractShortAssert<?> shortAssert, short n) { return shortAssert.isNotEqualTo(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJShortRulesRecipes$AbstractShortAssertIsNotZeroRecipe
- Refaster template
AssertJShortRules.AbstractShortAssertIsNotZero - Recipe created for the following Refaster template:
java static final class AbstractShortAssertIsNotZero { @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> shortAssert) { return shortAssert.isNotZero(); } @AfterTemplate AbstractShortAssert<?> after(AbstractShortAssert<?> shortAssert) { return shortAssert.isNotEqualTo((short)0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJShortRulesRecipes$AbstractShortAssertIsOneRecipe
- Refaster template
AssertJShortRules.AbstractShortAssertIsOne - Recipe created for the following Refaster template:
java static final class AbstractShortAssertIsOne { @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> shortAssert) { return shortAssert.isOne(); } @AfterTemplate AbstractShortAssert<?> after(AbstractShortAssert<?> shortAssert) { return shortAssert.isEqualTo((short)1); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJShortRulesRecipes$AbstractShortAssertIsZeroRecipe
- Refaster template
AssertJShortRules.AbstractShortAssertIsZero - Recipe created for the following Refaster template:
java static final class AbstractShortAssertIsZero { @BeforeTemplate AbstractShortAssert<?> before(AbstractShortAssert<?> shortAssert) { return shortAssert.isZero(); } @AfterTemplate AbstractShortAssert<?> after(AbstractShortAssert<?> shortAssert) { return shortAssert.isEqualTo((short)0); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStreamRulesRecipes
AssertJStreamRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJStreamRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJStreamRulesRecipes$AssertThatAnyMatchRecipe
- Refaster template
AssertJStreamRules.AssertThatAnyMatch - Recipe created for the following Refaster template:
java static final class AssertThatAnyMatch<T> { @BeforeTemplate ListAssert<T> before(Stream<T> stream, Predicate<? super T> predicate) { return assertThat(stream).filteredOn(predicate).isNotEmpty(); } @BeforeTemplate AbstractBooleanAssert<?> before2(Stream<T> stream, Predicate<? super T> predicate) { return Refaster.anyOf(assertThat(stream.anyMatch(predicate)).isTrue(), assertThat(stream.noneMatch(predicate)).isFalse()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<T> after(Stream<T> stream, Predicate<? super T> predicate) { return assertThat(stream).anyMatch(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStreamRulesRecipes$AssertThatCollectionRecipe
- Refaster template
AssertJStreamRules.AssertThatCollection - Recipe created for the following Refaster template:
java static final class AssertThatCollection<T> { @BeforeTemplate ListAssert<T> before(Collection<T> collection) { return assertThat(collection.stream()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractCollectionAssert<?, ?, T, ?> after(Collection<T> collection) { return assertThat(collection); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStreamRulesRecipes$AssertThatFilteredOnRecipe
- Refaster template
AssertJStreamRules.AssertThatFilteredOn - Recipe created for the following Refaster template:
java static final class AssertThatFilteredOn<T> { @BeforeTemplate ListAssert<T> before(Stream<T> stream, Predicate<? super T> predicate) { return assertThat(stream.filter(predicate)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) ListAssert<T> after(Stream<T> stream, Predicate<? super T> predicate) { return assertThat(stream).filteredOn(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStreamRulesRecipes$AssertThatNoneMatchRecipe
- Refaster template
AssertJStreamRules.AssertThatNoneMatch - Recipe created for the following Refaster template:
java static final class AssertThatNoneMatch<T> { @BeforeTemplate void before(Stream<T> stream, Predicate<? super T> predicate) { assertThat(stream).filteredOn(predicate).isEmpty(); } @BeforeTemplate void before2(Stream<T> stream, Predicate<? super T> predicate) { Refaster.anyOf(assertThat(stream.anyMatch(predicate)).isFalse(), assertThat(stream.noneMatch(predicate)).isTrue()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Stream<T> stream, Predicate<? super T> predicate) { assertThat(stream).noneMatch(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes
AssertJStringRulesRefaster recipes- Refaster template recipes for
tech.picnic.errorprone.refasterrules.AssertJStringRules. Source.
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AbstractStringAssertStringIsEmptyRecipe
- Refaster template
AssertJStringRules.AbstractStringAssertStringIsEmpty - Recipe created for the following Refaster template:
java static final class AbstractStringAssertStringIsEmpty { @BeforeTemplate void before(AbstractStringAssert<?> stringAssert) { stringAssert.isEqualTo(""); } @AfterTemplate void after(AbstractStringAssert<?> stringAssert) { stringAssert.isEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AbstractStringAssertStringIsNotEmptyRecipe
- Refaster template
AssertJStringRules.AbstractStringAssertStringIsNotEmpty - Recipe created for the following Refaster template:
java static final class AbstractStringAssertStringIsNotEmpty { @BeforeTemplate AbstractStringAssert<?> before(AbstractStringAssert<?> stringAssert) { return stringAssert.isNotEqualTo(""); } @AfterTemplate AbstractStringAssert<?> after(AbstractStringAssert<?> stringAssert) { return stringAssert.isNotEmpty(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatDoesNotMatchRecipe
- Refaster template
AssertJStringRules.AssertThatDoesNotMatch - Recipe created for the following Refaster template:
java static final class AssertThatDoesNotMatch { @BeforeTemplate AbstractAssert<?, ?> before(String string, String regex) { return assertThat(string.matches(regex)).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractAssert<?, ?> after(String string, String regex) { return assertThat(string).doesNotMatch(regex); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatMatchesRecipe
- Refaster template
AssertJStringRules.AssertThatMatches - Recipe created for the following Refaster template:
java static final class AssertThatMatches { @BeforeTemplate AbstractAssert<?, ?> before(String string, String regex) { return assertThat(string.matches(regex)).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractAssert<?, ?> after(String string, String regex) { return assertThat(string).matches(regex); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatPathContentRecipe
- Refaster template
AssertJStringRules.AssertThatPathContent - Recipe created for the following Refaster template:
java static final class AssertThatPathContent { @BeforeTemplate AbstractStringAssert<?> before(Path path, Charset charset) throws IOException { return assertThat(Files.readString(path, charset)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(Path path, Charset charset) { return assertThat(path).content(charset); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatPathContentUtf8Recipe
- Refaster template
AssertJStringRules.AssertThatPathContentUtf8 - Recipe created for the following Refaster template:
java static final class AssertThatPathContentUtf8 { @BeforeTemplate AbstractStringAssert<?> before(Path path) throws IOException { return assertThat(Files.readString(path)); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(Path path) { return assertThat(path).content(UTF_8); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatStringContainsRecipe
- Refaster template
AssertJStringRules.AssertThatStringContains - Recipe created for the following Refaster template:
java static final class AssertThatStringContains { @BeforeTemplate AbstractBooleanAssert<?> before(String string, CharSequence substring) { return assertThat(string.contains(substring)).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(String string, CharSequence substring) { return assertThat(string).contains(substring); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatStringDoesNotContainRecipe
- Refaster template
AssertJStringRules.AssertThatStringDoesNotContain - Recipe created for the following Refaster template:
java static final class AssertThatStringDoesNotContain { @BeforeTemplate AbstractBooleanAssert<?> before(String string, CharSequence substring) { return assertThat(string.contains(substring)).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(String string, CharSequence substring) { return assertThat(string).doesNotContain(substring); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatStringDoesNotEndWithRecipe
- Refaster template
AssertJStringRules.AssertThatStringDoesNotEndWith - Recipe created for the following Refaster template:
java static final class AssertThatStringDoesNotEndWith { @BeforeTemplate AbstractBooleanAssert<?> before(String string, String prefix) { return assertThat(string.endsWith(prefix)).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(String string, String prefix) { return assertThat(string).doesNotEndWith(prefix); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatStringDoesNotStartWithRecipe
- Refaster template
AssertJStringRules.AssertThatStringDoesNotStartWith - Recipe created for the following Refaster template:
java static final class AssertThatStringDoesNotStartWith { @BeforeTemplate AbstractBooleanAssert<?> before(String string, String prefix) { return assertThat(string.startsWith(prefix)).isFalse(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(String string, String prefix) { return assertThat(string).doesNotStartWith(prefix); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatStringEndsWithRecipe
- Refaster template
AssertJStringRules.AssertThatStringEndsWith - Recipe created for the following Refaster template:
java static final class AssertThatStringEndsWith { @BeforeTemplate AbstractBooleanAssert<?> before(String string, String prefix) { return assertThat(string.endsWith(prefix)).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(String string, String prefix) { return assertThat(string).endsWith(prefix); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJStringRulesRecipes$AssertThatStringStartsWithRecipe
- Refaster template
AssertJStringRules.AssertThatStringStartsWith - Recipe created for the following Refaster template:
java static final class AssertThatStringStartsWith { @BeforeTemplate AbstractBooleanAssert<?> before(String string, String prefix) { return assertThat(string.startsWith(prefix)).isTrue(); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractStringAssert<?> after(String string, String prefix) { return assertThat(string).startsWith(prefix); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes
- Refaster rules related to AssertJ assertions over expressions that may throw a
Throwablesubtype - For reasons of consistency we prefer
org.assertj.core.api.Assertions#assertThatThrownByover static methods for specific exception types. Note that only the most common assertion expressions are rewritten here; covering all cases would require the implementation of an Error Prone check instead. Source.
- Refaster rules related to AssertJ assertions over expressions that may throw a
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AbstractThrowableAssertCauseIsSameAsRecipe
- Refaster template
AssertJThrowingCallableRules.AbstractThrowableAssertCauseIsSameAs - Recipe created for the following Refaster template:
java static final class AbstractThrowableAssertCauseIsSameAs { @BeforeTemplate @SuppressWarnings(value = "deprecation") AbstractThrowableAssert<?, ? extends Throwable> before(AbstractThrowableAssert<?, ? extends Throwable> throwableAssert, Throwable expected) { return throwableAssert.hasCauseReference(expected); } @AfterTemplate AbstractThrowableAssert<?, ? extends Throwable> after(AbstractThrowableAssert<?, ? extends Throwable> throwableAssert, Throwable expected) { return throwableAssert.cause().isSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByAsInstanceOfThrowableRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByAsInstanceOfThrowable - Recipe created for the following Refaster template:
java static final class AssertThatThrownByAsInstanceOfThrowable<T extends Throwable> { @BeforeTemplate ThrowableAssertAlternative<T> before(ThrowingCallable throwingCallable, Class<T> exceptionType) { return assertThatExceptionOfType(exceptionType).isThrownBy(throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractThrowableAssert<?, T> after(ThrowingCallable throwingCallable, Class<T> exceptionType) { return assertThatThrownBy(throwingCallable).asInstanceOf(throwable(exceptionType)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByHasMessageContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByHasMessageContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByHasMessageContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByAsInstanceOfThrowable") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatExceptionOfType(exceptionType).isThrownBy(throwingCallable).withMessageContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(exceptionType).hasMessageContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByHasMessageNotContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByHasMessageNotContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByHasMessageNotContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByAsInstanceOfThrowable") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatExceptionOfType(exceptionType).isThrownBy(throwingCallable).withMessageNotContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(exceptionType).hasMessageNotContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByAsInstanceOfThrowable") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatExceptionOfType(exceptionType).isThrownBy(throwingCallable).withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(exceptionType).hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByHasMessageStartingWithRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByHasMessageStartingWith - Recipe created for the following Refaster template:
java static final class AssertThatThrownByHasMessageStartingWith { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByAsInstanceOfThrowable") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatExceptionOfType(exceptionType).isThrownBy(throwingCallable).withMessageStartingWith(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(exceptionType).hasMessageStartingWith(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIOExceptionHasMessageContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIOExceptionHasMessageContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIOExceptionHasMessageContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIOException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIOException().isThrownBy(throwingCallable).withMessageContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IOException.class).hasMessageContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIOExceptionHasMessageNotContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIOExceptionHasMessageNotContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIOExceptionHasMessageNotContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIOException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIOException().isThrownBy(throwingCallable).withMessageNotContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IOException.class).hasMessageNotContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIOExceptionHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIOExceptionHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIOExceptionHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIOException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIOException().isThrownBy(throwingCallable).withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IOException.class).hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIOExceptionHasMessageStartingWithRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIOExceptionHasMessageStartingWith - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIOExceptionHasMessageStartingWith { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIOException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIOException().isThrownBy(throwingCallable).withMessageStartingWith(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IOException.class).hasMessageStartingWith(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIOExceptionRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIOException - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIOException { @BeforeTemplate AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable) { return assertThatIOException().isThrownBy(throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable) { return assertThatThrownBy(throwingCallable).isInstanceOf(IOException.class); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIOExceptionRootCauseHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIOExceptionRootCauseHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIOExceptionRootCauseHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIOException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIOException().isThrownBy(throwingCallable).havingRootCause().withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IOException.class).rootCause().hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalArgumentExceptionHasMessageContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalArgumentExceptionHasMessageContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalArgumentExceptionHasMessageContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalArgumentException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalArgumentException().isThrownBy(throwingCallable).withMessageContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalArgumentException.class).hasMessageContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalArgumentExceptionHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalArgumentExceptionHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalArgumentExceptionHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalArgumentException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalArgumentException().isThrownBy(throwingCallable).withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalArgumentException.class).hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalArgumentExceptionHasMessageStartingWithRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalArgumentExceptionHasMessageStartingWith - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalArgumentExceptionHasMessageStartingWith { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalArgumentException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalArgumentException().isThrownBy(throwingCallable).withMessageStartingWith(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalArgumentException.class).hasMessageStartingWith(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalArgumentExceptionRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalArgumentException - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalArgumentException { @BeforeTemplate AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable) { return assertThatIllegalArgumentException().isThrownBy(throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalArgumentException.class); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalArgumentExceptionRootCauseHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalArgumentExceptionRootCauseHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalArgumentExceptionRootCauseHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalArgumentException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalArgumentException().isThrownBy(throwingCallable).havingRootCause().withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalArgumentException.class).rootCause().hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalStateExceptionHasMessageContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalStateExceptionHasMessageContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalStateExceptionHasMessageContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalStateException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalStateException().isThrownBy(throwingCallable).withMessageContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalStateException.class).hasMessageContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalStateExceptionHasMessageNotContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalStateExceptionHasMessageNotContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalStateExceptionHasMessageNotContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalStateException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalStateException().isThrownBy(throwingCallable).withMessageNotContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalStateException.class).hasMessageNotContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalStateExceptionHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalStateExceptionHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalStateExceptionHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalStateException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalStateException().isThrownBy(throwingCallable).withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalStateException.class).hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalStateExceptionHasMessageStartingWithRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalStateExceptionHasMessageStartingWith - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalStateExceptionHasMessageStartingWith { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalStateException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalStateException().isThrownBy(throwingCallable).withMessageStartingWith(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalStateException.class).hasMessageStartingWith(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalStateExceptionRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalStateException - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalStateException { @BeforeTemplate AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable) { return assertThatIllegalStateException().isThrownBy(throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalStateException.class); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIllegalStateExceptionRootCauseHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIllegalStateExceptionRootCauseHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIllegalStateExceptionRootCauseHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByIllegalStateException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatIllegalStateException().isThrownBy(throwingCallable).havingRootCause().withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(IllegalStateException.class).rootCause().hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByIsInstanceOfRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByIsInstanceOf - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIsInstanceOf<T extends Throwable> { @BeforeTemplate void before(ThrowingCallable throwingCallable, Class<T> exceptionType) { Refaster.anyOf(assertThatThrownBy(throwingCallable).asInstanceOf(throwable(exceptionType)), assertThatThrownBy(throwingCallable).asInstanceOf(type(exceptionType))); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, Class<T> exceptionType) { assertThatThrownBy(throwingCallable).isInstanceOf(exceptionType); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByNullPointerExceptionHasMessageContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByNullPointerExceptionHasMessageContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByNullPointerExceptionHasMessageContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByNullPointerException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatNullPointerException().isThrownBy(throwingCallable).withMessageContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(NullPointerException.class).hasMessageContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByNullPointerExceptionHasMessageNotContainingRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByNullPointerExceptionHasMessageNotContaining - Recipe created for the following Refaster template:
java static final class AssertThatThrownByNullPointerExceptionHasMessageNotContaining { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByNullPointerException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatNullPointerException().isThrownBy(throwingCallable).withMessageNotContaining(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(NullPointerException.class).hasMessageNotContaining(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByNullPointerExceptionHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByNullPointerExceptionHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByNullPointerExceptionHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByNullPointerException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatNullPointerException().isThrownBy(throwingCallable).withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(NullPointerException.class).hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByNullPointerExceptionHasMessageStartingWithRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByNullPointerExceptionHasMessageStartingWith - Recipe created for the following Refaster template:
java static final class AssertThatThrownByNullPointerExceptionHasMessageStartingWith { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByNullPointerException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatNullPointerException().isThrownBy(throwingCallable).withMessageStartingWith(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(NullPointerException.class).hasMessageStartingWith(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByNullPointerExceptionRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByNullPointerException - Recipe created for the following Refaster template:
java static final class AssertThatThrownByNullPointerException { @BeforeTemplate AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable) { return assertThatNullPointerException().isThrownBy(throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable) { return assertThatThrownBy(throwingCallable).isInstanceOf(NullPointerException.class); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByNullPointerExceptionRootCauseHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByNullPointerExceptionRootCauseHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByNullPointerExceptionRootCauseHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByNullPointerException") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, String message) { return assertThatNullPointerException().isThrownBy(throwingCallable).havingRootCause().withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(NullPointerException.class).rootCause().hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssertJThrowingCallableRulesRecipes$AssertThatThrownByRootCauseHasMessageRecipe
- Refaster template
AssertJThrowingCallableRules.AssertThatThrownByRootCauseHasMessage - Recipe created for the following Refaster template:
java static final class AssertThatThrownByRootCauseHasMessage { @BeforeTemplate @SuppressWarnings(value = "AssertThatThrownByAsInstanceOfThrowable") AbstractObjectAssert<?, ?> before(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatExceptionOfType(exceptionType).isThrownBy(throwingCallable).havingRootCause().withMessage(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) AbstractObjectAssert<?, ?> after(ThrowingCallable throwingCallable, Class<? extends Throwable> exceptionType, String message) { return assertThatThrownBy(throwingCallable).isInstanceOf(exceptionType).rootCause().hasMessage(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes
AssortedRulesRefaster recipes- Assorted Refaster rules that do not (yet) belong in one of the other classes with more topical Refaster rules. Source.
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$CheckIndexRecipe
- Refaster template
AssortedRules.CheckIndex - Prefer
Objects#checkIndex(int, int)over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$DisjointCollectionsRecipe
- Refaster template
AssortedRules.DisjointCollections - Don't unnecessarily copy collections before passing them to
Collections#disjoint(Collection, Collection).
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$DisjointSetsRecipe
- Refaster template
AssortedRules.DisjointSets - Prefer
Collections#disjoint(Collection, Collection)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$IterableIsEmptyRecipe
- Refaster template
AssortedRules.IterableIsEmpty - Prefer
Iterables#isEmpty(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$IteratorGetNextOrDefaultRecipe
- Refaster template
AssortedRules.IteratorGetNextOrDefault - Prefer
Iterators#getNext(Iterator, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$LogicalImplicationRecipe
- Refaster template
AssortedRules.LogicalImplication - Don't unnecessarily repeat boolean expressions.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$SplitToStreamRecipe
- Refaster template
AssortedRules.SplitToStream - Prefer
Splitter#splitToStream(CharSequence)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.AssortedRulesRecipes$UnboundedSingleElementStreamRecipe
- Refaster template
AssortedRules.UnboundedSingleElementStream - Prefer
Stream#generate(java.util.function.Supplier)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes
BigDecimalRulesRefaster recipes- Refaster rules related to expressions dealing with
BigDecimals. Source.
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalOneRecipe
- Refaster template
BigDecimalRules.BigDecimalOne - Prefer using the constant
BigDecimal#ONEwhen possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalSignumIsNegativeRecipe
- Refaster template
BigDecimalRules.BigDecimalSignumIsNegative - Prefer a
BigDecimal#signum()comparison to -1 over more contrived or less clear alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalSignumIsPositiveRecipe
- Refaster template
BigDecimalRules.BigDecimalSignumIsPositive - Prefer a
BigDecimal#signum()comparison to 1 over more contrived or less clear alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalSignumIsZeroRecipe
- Refaster template
BigDecimalRules.BigDecimalSignumIsZero - Prefer using
BigDecimal#signum()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalTenRecipe
- Refaster template
BigDecimalRules.BigDecimalTen - Prefer using the constant
BigDecimal#TENwhen possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalTwoRecipe
- Refaster template
BigDecimalRules.BigDecimalTwo - Prefer using the constant
BigDecimal#TWOwhen possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalValueOfRecipe
- Refaster template
BigDecimalRules.BigDecimalValueOf - Prefer
BigDecimal#valueOf(double)over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes$BigDecimalZeroRecipe
- Refaster template
BigDecimalRules.BigDecimalZero - Prefer using the constant
BigDecimal#ZEROwhen possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.BugCheckerRulesRecipes
BugCheckerRulesRefaster recipes- Refaster rules related to
com.google.errorprone.bugpatterns.BugCheckerclasses. Source.
- tech.picnic.errorprone.refasterrules.BugCheckerRulesRecipes$ASTHelpersGetStartPositionRecipe
- Refaster template
BugCheckerRules.ASTHelpersGetStartPosition - Prefer
ASTHelpers#getStartPosition(Tree)over alternatives that require casting.
- Refaster template
- tech.picnic.errorprone.refasterrules.BugCheckerRulesRecipes$BugCheckerRefactoringTestHelperAddInputLinesExpectUnchangedRecipe
- Refaster template
BugCheckerRules.BugCheckerRefactoringTestHelperAddInputLinesExpectUnchanged - Prefer
BugCheckerRefactoringTestHelper.ExpectOutput#expectUnchanged()over repeating the input.
- Refaster template
- tech.picnic.errorprone.refasterrules.BugCheckerRulesRecipes$BugCheckerRefactoringTestHelperIdentityRecipe
- Refaster template
BugCheckerRules.BugCheckerRefactoringTestHelperIdentity - Avoid calling
BugCheckerRefactoringTestHelper#setFixChooser(FixChooser)orBugCheckerRefactoringTestHelper#setImportOrder(String)with their respective default values.
- Refaster template
- tech.picnic.errorprone.refasterrules.BugCheckerRulesRecipes$NameContentEqualsRecipe
- Refaster template
BugCheckerRules.NameContentEquals - Prefer
Name#contentEquals(CharSequence)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes
CharSequenceRulesRefaster recipes- Refaster rules related to expressions dealing with
CharSequences. Source.
- tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes$CharSequenceIsEmptyRecipe
- Refaster template
CharSequenceRules.CharSequenceIsEmpty - Prefer
CharSequence#isEmpty()over alternatives that consult the char sequence's length.
- Refaster template
- tech.picnic.errorprone.refasterrules.ClassRulesRecipes
ClassRulesRefaster recipes- Refaster rules related to expressions dealing with classes. Source.
- tech.picnic.errorprone.refasterrules.ClassRulesRecipes$ClassIsInstanceRecipe
- Refaster template
ClassRules.ClassIsInstance - Prefer
Class#isInstance(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ClassRulesRecipes$ClassReferenceCastRecipe
- Refaster template
ClassRules.ClassReferenceCast - Prefer
Class#cast(Object)method references over lambda expressions that require naming a variable.
- Refaster template
- tech.picnic.errorprone.refasterrules.ClassRulesRecipes$ClassReferenceIsInstancePredicateRecipe
- Refaster template
ClassRules.ClassReferenceIsInstancePredicate - Prefer
Class#isInstance(Object)method references over lambda expressions that require naming a variable.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes
CollectionRulesRefaster recipes- Refaster rules related to expressions dealing with (arbitrary) collections. Source.
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionAddAllToCollectionExpressionRecipe
- Refaster template
CollectionRules.CollectionAddAllToCollectionExpression - Don't call
Iterables#addAll(Collection, Iterable)when the elements to be added are already part of aCollection.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionContainsRecipe
- Refaster template
CollectionRules.CollectionContains - Prefer
Collection#contains(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionForEachRecipe
- Refaster template
CollectionRules.CollectionForEach - Prefer
Collection#forEach(Consumer)over more contrived alternatives.
- Refaster template
- 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.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionIteratorNextRecipe
- Refaster template
CollectionRules.CollectionIteratorNext - Prefer
collection.iterator().next()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionIteratorRecipe
- Refaster template
CollectionRules.CollectionIterator - Prefer
Collection#iterator()over more contrived or less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionRemoveAllFromCollectionExpressionRecipe
- Refaster template
CollectionRules.CollectionRemoveAllFromCollectionExpression - Don't call
Iterables#removeAll(Iterable, Collection)when the elements to be removed are already part of aCollection.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionSizeRecipe
- Refaster template
CollectionRules.CollectionSize - Prefer
Collection#size()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$CollectionToArrayRecipe
- Refaster template
CollectionRules.CollectionToArray - Prefer calling
Collection#toArray()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ImmutableCollectionAsListRecipe
- Refaster template
CollectionRules.ImmutableCollectionAsList - Prefer
ImmutableCollection#asList()over the more verbose alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ImmutableCollectionContainsRecipe
- Refaster template
CollectionRules.ImmutableCollectionContains - Don't call
ImmutableCollection#asList()ifCollection#contains(Object)is called on the result; call it directly.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ImmutableCollectionParallelStreamRecipe
- Refaster template
CollectionRules.ImmutableCollectionParallelStream - Don't call
ImmutableCollection#asList()ifImmutableCollection#parallelStream()is called on the result; call it directly.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ImmutableCollectionStreamRecipe
- Refaster template
CollectionRules.ImmutableCollectionStream - Don't call
ImmutableCollection#asList()if the result is going to be streamed; stream directly.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ImmutableCollectionToArrayWithArrayRecipe
- Refaster template
CollectionRules.ImmutableCollectionToArrayWithArray - Don't call
ImmutableCollection#asList()if `ImmutableCollection#toArray(Object[])`` is called on the result; call it directly.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ImmutableCollectionToArrayWithGeneratorRecipe
- Refaster template
CollectionRules.ImmutableCollectionToArrayWithGenerator - Don't call
ImmutableCollection#asList()ifImmutableCollection#toArray(IntFunction)} is called on the result; call it directly.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ImmutableCollectionToStringRecipe
- Refaster template
CollectionRules.ImmutableCollectionToString - Don't call
ImmutableCollection#asList()ifImmutableCollection#toString()is called on the result; call it directly.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ListAddFirstRecipe
- Refaster template
CollectionRules.ListAddFirst - Prefer
List#addFirst(Object)over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ListAddRecipe
- Refaster template
CollectionRules.ListAdd - Prefer
List#add(Object)over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ListRemoveFirstRecipe
- Refaster template
CollectionRules.ListRemoveFirst - Prefer
List#removeFirst()} over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$ListRemoveLastRecipe
- Refaster template
CollectionRules.ListRemoveLast - Prefer
List#removeLast()} over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$NewArrayListFromCollectionRecipe
- Refaster template
CollectionRules.NewArrayListFromCollection - Prefer
ArrayList#ArrayList(Collection)over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$OptionalFirstCollectionElementRecipe
- Refaster template
CollectionRules.OptionalFirstCollectionElement - Don't use the ternary operator to extract the first element of a possibly-empty
Collectionas anOptional, and (when applicable) preferStream#findFirst()overStream#findAny()to communicate that the collection's first element (if any, according to iteration order) will be returned.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$RemoveOptionalFirstNavigableSetElementRecipe
- Refaster template
CollectionRules.RemoveOptionalFirstNavigableSetElement - Avoid contrived constructions when extracting the first element from a possibly empty
NavigableSet.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$SequencedCollectionGetFirstRecipe
- Refaster template
CollectionRules.SequencedCollectionGetFirst - Prefer
SequencedCollection#getFirst()over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$SequencedCollectionGetLastRecipe
- Refaster template
CollectionRules.SequencedCollectionGetLast - Prefer
SequencedCollection#getLast()over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$SetStreamRecipe
- Refaster template
CollectionRules.SetStream - Don't unnecessarily call
Stream#distinct()on an already-unique stream of elements.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$SortedSetFirstRecipe
- Refaster template
CollectionRules.SortedSetFirst - Prefer
SortedSet#first()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.CollectionRulesRecipes$SortedSetLastRecipe
- Refaster template
CollectionRules.SortedSetLast - Prefer
SortedSet#last()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes
ComparatorRulesRefaster recipes- Refaster rules related to expressions dealing with
Comparators. Source.
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$CollectionsMaxRecipe
- Refaster template
ComparatorRules.CollectionsMax - Prefer
Collections#max(Collection)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$CollectionsMaxWithComparatorRecipe
- Refaster template
ComparatorRules.CollectionsMaxWithComparator - Avoid unnecessary creation of a
Streamto determine the maximum of a known collection of values.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$CollectionsMinRecipe
- Refaster template
ComparatorRules.CollectionsMin - Prefer
Collections#min(Collection)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$CollectionsMinWithComparatorRecipe
- Refaster template
ComparatorRules.CollectionsMinWithComparator - Avoid unnecessary creation of a
Streamto determine the minimum of a known collection of values.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$CollectionsSortRecipe
- Refaster template
ComparatorRules.CollectionsSort - Prefer
Collections#sort(List)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ComparatorsMaxRecipe
- Refaster template
ComparatorRules.ComparatorsMax - Prefer a method reference to
Comparators#max(Comparable, Comparable)over callingBinaryOperator#minBy(Comparator)withComparator#naturalOrder().
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ComparatorsMinRecipe
- Refaster template
ComparatorRules.ComparatorsMin - Prefer a method reference to
Comparators#min(Comparable, Comparable)over callingBinaryOperator#minBy(Comparator)withComparator#naturalOrder().
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$CompareToRecipe
- Refaster template
ComparatorRules.CompareTo - Prefer
Comparable#compareTo(Object)} over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$IsLessThanOrEqualToRecipe
- Refaster template
ComparatorRules.IsLessThanOrEqualTo - Don't explicitly compare enums by their ordinal.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$IsLessThanRecipe
- Refaster template
ComparatorRules.IsLessThan - Don't explicitly compare enums by their ordinal.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$MaxByNaturalOrderRecipe
- Refaster template
ComparatorRules.MaxByNaturalOrder - Prefer
Comparator#naturalOrder()overComparator#reverseOrder()where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$MaxOfArrayRecipe
- Refaster template
ComparatorRules.MaxOfArray - Avoid unnecessary creation of a
Streamto determine the maximum of a known collection of values.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$MinByNaturalOrderRecipe
- Refaster template
ComparatorRules.MinByNaturalOrder - Prefer
Comparator#naturalOrder()overComparator#reverseOrder()where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$MinOfArrayRecipe
- Refaster template
ComparatorRules.MinOfArray - Avoid unnecessary creation of a
Streamto determine the minimum of a known collection of values.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ReverseOrderRecipe
- Refaster template
ComparatorRules.ReverseOrder - Prefer
Comparator#reverseOrder()over more complicated constructs.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ThenComparingCustomRecipe
- Refaster template
ComparatorRules.ThenComparingCustom - Don't explicitly create
Comparators unnecessarily.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ThenComparingCustomReversedRecipe
- Refaster template
ComparatorRules.ThenComparingCustomReversed - Don't explicitly create
Comparators unnecessarily.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ThenComparingDoubleRecipe
- Refaster template
ComparatorRules.ThenComparingDouble - Don't explicitly create
Comparators unnecessarily.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ThenComparingIntRecipe
- Refaster template
ComparatorRules.ThenComparingInt - Don't explicitly create
Comparators unnecessarily.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ThenComparingLongRecipe
- Refaster template
ComparatorRules.ThenComparingLong - Don't explicitly create
Comparators unnecessarily.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ThenComparingRecipe
- Refaster template
ComparatorRules.ThenComparing - Don't explicitly create
Comparators unnecessarily.
- Refaster template
- tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes$ThenComparingReversedRecipe
- Refaster template
ComparatorRules.ThenComparingReversed - Don't explicitly create
Comparators unnecessarily.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes
DoubleStreamRulesRefaster recipes- Refaster rules related to expressions dealing with
DoubleStreams. Source.
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$ConcatOneDoubleStreamRecipe
- Refaster template
DoubleStreamRules.ConcatOneDoubleStream - Don't unnecessarily call
Streams#concat(DoubleStream...).
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$ConcatTwoDoubleStreamsRecipe
- Refaster template
DoubleStreamRules.ConcatTwoDoubleStreams - Prefer
DoubleStream#concat(DoubleStream, DoubleStream)over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamAllMatchRecipe
- Refaster template
DoubleStreamRules.DoubleStreamAllMatch - Recipe created for the following Refaster template:
java static final class DoubleStreamAllMatch { @BeforeTemplate boolean before(DoubleStream stream, DoublePredicate predicate) { return stream.noneMatch(predicate.negate()); } @AfterTemplate boolean after(DoubleStream stream, DoublePredicate predicate) { return stream.allMatch(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamAnyMatchRecipe
- Refaster template
DoubleStreamRules.DoubleStreamAnyMatch - Prefer
DoubleStream#anyMatch(DoublePredicate)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamFilterSortedRecipe
- Refaster template
DoubleStreamRules.DoubleStreamFilterSorted - Apply
DoubleStream#filter(DoublePredicate)beforeDoubleStream#sorted()to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamIsEmptyRecipe
- Refaster template
DoubleStreamRules.DoubleStreamIsEmpty - In order to test whether a stream has any element, simply try to find one.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamIsNotEmptyRecipe
- Refaster template
DoubleStreamRules.DoubleStreamIsNotEmpty - In order to test whether a stream has any element, simply try to find one.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamMinRecipe
- Refaster template
DoubleStreamRules.DoubleStreamMin - Recipe created for the following Refaster template:
java static final class DoubleStreamMin { @BeforeTemplate OptionalDouble before(DoubleStream stream) { return stream.sorted().findFirst(); } @AfterTemplate OptionalDouble after(DoubleStream stream) { return stream.min(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamNoneMatchRecipe
- Refaster template
DoubleStreamRules.DoubleStreamNoneMatch - Prefer
DoubleStream#noneMatch(DoublePredicate)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.DoubleStreamRulesRecipes$DoubleStreamTakeWhileRecipe
- Refaster template
DoubleStreamRules.DoubleStreamTakeWhile - Recipe created for the following Refaster template:
java static final class DoubleStreamTakeWhile { @BeforeTemplate DoubleStream before(DoubleStream stream, DoublePredicate predicate) { return stream.takeWhile(predicate).filter(predicate); } @AfterTemplate DoubleStream after(DoubleStream stream, DoublePredicate predicate) { return stream.takeWhile(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.EqualityRulesRecipes
EqualityRulesRefaster recipes- Refaster rules related to expressions dealing with (in)equalities. Source.
- tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$DoubleNegationRecipe
- Refaster template
EqualityRules.DoubleNegation - Avoid double negations; this is not Javascript.
- Refaster template
- tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$EnumReferenceEqualityLambdaRecipe
- Refaster template
EqualityRules.EnumReferenceEqualityLambda - Prefer reference-based equality for enums.
- Refaster template
- tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$EnumReferenceEqualityRecipe
- Refaster template
EqualityRules.EnumReferenceEquality - Prefer reference-based equality for enums.
- Refaster template
- tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$EqualsPredicateRecipe
- Refaster template
EqualityRules.EqualsPredicate - Prefer
Object#equals(Object)over the equivalent lambda function.
- Refaster template
- tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$EqualsRecipe
- Refaster template
EqualityRules.Equals - Avoid contrived ways of handling
nullvalues during equality testing.
- Refaster template
- 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.
- Refaster template
- 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.
- Refaster template
- tech.picnic.errorprone.refasterrules.EqualityRulesRecipes$ObjectsEqualsRecipe
- Refaster template
EqualityRules.ObjectsEquals - Avoid contrived ways of handling
nullvalues during equality testing.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes
FileRulesRefaster recipes- Refaster rules related to expressions dealing with files. Source.
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FileMkDirsFileExistsRecipe
- Refaster template
FileRules.FileMkDirsFileExists - Invoke
File#mkdirs()beforeFile#exists()to avoid concurrency issues.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesCreateTempFileInCustomDirectoryToFileRecipe
- Prefer
Files#createTempFile(Path, String, String, FileAttribute[])over alternatives that create files with more liberal permissions - Note that
File#createTempFiletreats 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 withFiles#createTempFile, which will instead throw anIllegalArgumentExceptionif the prefix contains any file separators.
- Prefer
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesCreateTempFileToFileRecipe
- Prefer
Files#createTempFile(String, String, FileAttribute[])over alternatives that create files with more liberal permissions - Note that
File#createTempFiletreats 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 withFiles#createTempFile, which will instead throw anIllegalArgumentExceptionif the prefix contains any file separators.
- Prefer
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderPathOfRecipe
- Refaster template
FileRules.FilesNewBufferedReaderPathOf - Prefer
Files#newBufferedReader(Path)over more verbose or contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderPathOfWithCharsetRecipe
- Refaster template
FileRules.FilesNewBufferedReaderPathOfWithCharset - Prefer
Files#newBufferedReader(Path, Charset)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderToPathRecipe
- Refaster template
FileRules.FilesNewBufferedReaderToPath - Prefer
Files#newBufferedReader(Path)over more verbose or contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesNewBufferedReaderToPathWithCharsetRecipe
- Refaster template
FileRules.FilesNewBufferedReaderToPathWithCharset - Prefer
Files#newBufferedReader(Path, Charset)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesReadStringRecipe
- Refaster template
FileRules.FilesReadString - Prefer
Files#readString(Path)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesReadStringWithCharsetRecipe
- Refaster template
FileRules.FilesReadStringWithCharset - Prefer
Files#readString(Path, Charset)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$PathInstanceRecipe
- Refaster template
FileRules.PathInstance - Avoid redundant conversions from
PathtoFile.
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$PathOfUriRecipe
- Refaster template
FileRules.PathOfUri - Prefer the more idiomatic
Path#of(URI)overPaths#get(URI).
- Refaster template
- tech.picnic.errorprone.refasterrules.FileRulesRecipes$PathToFileMkDirsFilesExistsRecipe
- Refaster template
FileRules.PathToFileMkDirsFilesExists - Invoke
File#mkdirs()beforeFiles#exists(Path, LinkOption...)to avoid concurrency issues.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes
ImmutableEnumSetRulesRefaster recipes- Refaster rules related to expressions dealing with
com.google.common.collect.ImmutableEnumSets. Source.
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSet1Recipe
- Refaster template
ImmutableEnumSetRules.SetsImmutableEnumSet1 - Prefer
Sets#immutableEnumSet(Enum, Enum[])for enum collections to take advantage of the internally usedEnumSet.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSet2Recipe
- Prefer
Sets#immutableEnumSet(Enum, Enum[])for enum collections to take advantage of the internally usedEnumSet - <strong>Warning:</strong> this rule is not completely behavior preserving: while the
ImmutableSet#ofexpression produces a set that iterates over its elements in the listed order, the replacement code iterates over the elements in enum definition order.
- Prefer
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSet3Recipe
- Prefer
Sets#immutableEnumSet(Enum, Enum[])for enum collections to take advantage of the internally usedEnumSet - <strong>Warning:</strong> this rule is not completely behavior preserving: while the
ImmutableSet#ofexpression produces a set that iterates over its elements in the listed order, the replacement code iterates over the elements in enum definition order.
- Prefer
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSet4Recipe
- Prefer
Sets#immutableEnumSet(Enum, Enum[])for enum collections to take advantage of the internally usedEnumSet - <strong>Warning:</strong> this rule is not completely behavior preserving: while the
ImmutableSet#ofexpression produces a set that iterates over its elements in the listed order, the replacement code iterates over the elements in enum definition order.
- Prefer
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSet5Recipe
- Prefer
Sets#immutableEnumSet(Enum, Enum[])for enum collections to take advantage of the internally usedEnumSet - <strong>Warning:</strong> this rule is not completely behavior preserving: while the
ImmutableSet#ofexpression produces a set that iterates over its elements in the listed order, the replacement code iterates over the elements in enum definition order.
- Prefer
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSet6Recipe
- Prefer
Sets#immutableEnumSet(Enum, Enum[])for enum collections to take advantage of the internally usedEnumSet - <strong>Warning:</strong> this rule is not completely behavior preserving: while the original code produces a set that iterates over its elements in the listed order, the replacement code iterates over the elements in enum definition order.
- Prefer
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSetArraysAsListRecipe
- Prefer
Sets#immutableEnumSet(Iterable)for enum collections to take advantage of the internally usedEnumSet - <strong>Warning:</strong> this rule is not completely behavior preserving: while the original code produces a set that iterates over its elements in the same order as defined in the array, the replacement code iterates over the elements in enum definition order.
- Prefer
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$SetsImmutableEnumSetIterableRecipe
- Prefer
Sets#immutableEnumSet(Iterable)for enum collections to take advantage of the internally usedEnumSet - <strong>Warning:</strong> this rule is not completely behavior preserving: while the original code produces a set that iterates over its elements in the same order as the input
Iterable, the replacement code iterates over the elements in enum definition order.
- Prefer
- tech.picnic.errorprone.refasterrules.ImmutableEnumSetRulesRecipes$StreamToImmutableEnumSetRecipe
- Use
Sets#toImmutableEnumSet()when possible, as it is more efficient thanImmutableSet#toImmutableSet()and produces a more compact object - <strong>Warning:</strong> this rule is not completely behavior preserving: while the original code produces a set that iterates over its elements in encounter order, the replacement code iterates over the elements in enum definition order.
- Use
- tech.picnic.errorprone.refasterrules.ImmutableListMultimapRulesRecipes
ImmutableListMultimapRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableListMultimaps. Source.
- tech.picnic.errorprone.refasterrules.ImmutableListMultimapRulesRecipes$EmptyImmutableListMultimapRecipe
- Refaster template
ImmutableListMultimapRules.EmptyImmutableListMultimap - Prefer
ImmutableListMultimap#of()over more contrived or less-specific alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListMultimapRulesRecipes$EntryToImmutableListMultimapRecipe
- Refaster template
ImmutableListMultimapRules.EntryToImmutableListMultimap - Prefer
ImmutableListMultimap#of(Object, Object)over more contrived or less-specific alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListMultimapRulesRecipes$ImmutableListMultimapBuilderRecipe
- Refaster template
ImmutableListMultimapRules.ImmutableListMultimapBuilder - Prefer
ImmutableListMultimap#builder()over the associated constructor on constructions that produce a less-specific type.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListMultimapRulesRecipes$IterableToImmutableListMultimapRecipe
- Refaster template
ImmutableListMultimapRules.IterableToImmutableListMultimap - Prefer
ImmutableListMultimap#copyOf(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListMultimapRulesRecipes$PairToImmutableListMultimapRecipe
- Refaster template
ImmutableListMultimapRules.PairToImmutableListMultimap - Prefer
ImmutableListMultimap#of(Object, Object)over more contrived or less-specific alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListMultimapRulesRecipes$TransformMultimapValuesToImmutableListMultimap2Recipe
- Refaster template
ImmutableListMultimapRules.TransformMultimapValuesToImmutableListMultimap2 - Prefer creating an immutable copy of the result of
Multimaps#transformValues(Multimap, com.google.common.base.Function)over creating and directly collecting a stream.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes
ImmutableListRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableLists. Source.
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListBuilderRecipe
- Refaster template
ImmutableListRules.ImmutableListBuilder - Prefer
ImmutableList#builder()over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListOf1Recipe
- Refaster template
ImmutableListRules.ImmutableListOf1 - Prefer
ImmutableList#of(Object)over more contrived alternatives or alternatives that don't communicate the immutability of the resulting list at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListOf2Recipe
- Refaster template
ImmutableListRules.ImmutableListOf2 - Prefer
ImmutableList#of(Object, Object)over alternatives that don't communicate the immutability of the resulting list at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListOf3Recipe
- Refaster template
ImmutableListRules.ImmutableListOf3 - Prefer
ImmutableList#of(Object, Object, Object)over alternatives that don't communicate the immutability of the resulting list at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListOf4Recipe
- Refaster template
ImmutableListRules.ImmutableListOf4 - Prefer
ImmutableList#of(Object, Object, Object, Object)over alternatives that don't communicate the immutability of the resulting list at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListOf5Recipe
- Refaster template
ImmutableListRules.ImmutableListOf5 - Prefer
ImmutableList#of(Object, Object, Object, Object, Object)over alternatives that don't communicate the immutability of the resulting list at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListOfRecipe
- Refaster template
ImmutableListRules.ImmutableListOf - Prefer
ImmutableList#of()over more contrived alternatives or alternatives that don't communicate the immutability of the resulting list at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListSortedCopyOfRecipe
- Refaster template
ImmutableListRules.ImmutableListSortedCopyOf - Prefer
ImmutableList#sortedCopyOf(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$ImmutableListSortedCopyOfWithCustomComparatorRecipe
- Refaster template
ImmutableListRules.ImmutableListSortedCopyOfWithCustomComparator - Prefer
ImmutableList#sortedCopyOf(Comparator, Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$IterableToImmutableListRecipe
- Refaster template
ImmutableListRules.IterableToImmutableList - Prefer
ImmutableList#copyOf(Iterable)and variants over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$StreamToDistinctImmutableListRecipe
- Refaster template
ImmutableListRules.StreamToDistinctImmutableList - Collecting to an
ImmutableSetand converting the result to anImmutableListmay be more efficient than deduplicating a stream and collecting the result to anImmutableList.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableListRulesRecipes$StreamToImmutableListRecipe
- Refaster template
ImmutableListRules.StreamToImmutableList - Prefer
ImmutableList#toImmutableList()over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes
ImmutableMapRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableMaps. Source.
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$EntryIterableToImmutableMapRecipe
- Refaster template
ImmutableMapRules.EntryIterableToImmutableMap - Prefer
ImmutableMap#copyOf(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$EntryToImmutableMapRecipe
- Refaster template
ImmutableMapRules.EntryToImmutableMap - Prefer
ImmutableMap#of(Object, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapBuilderBuildOrThrowRecipe
- Refaster template
ImmutableMapRules.ImmutableMapBuilderBuildOrThrow - Prefer
ImmutableMap.Builder#buildOrThrow()over the less explicitImmutableMap.Builder#build().
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapBuilderRecipe
- Refaster template
ImmutableMapRules.ImmutableMapBuilder - Prefer
ImmutableMap#builder()over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapOf1Recipe
- Refaster template
ImmutableMapRules.ImmutableMapOf1 - Prefer
ImmutableMap#of(Object, Object)over more contrived alternatives or alternatives that don't communicate the immutability of the resulting map at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapOf2Recipe
- Refaster template
ImmutableMapRules.ImmutableMapOf2 - Prefer
ImmutableMap#of(Object, Object, Object, Object)over alternatives that don't communicate the immutability of the resulting map at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapOf3Recipe
- Refaster template
ImmutableMapRules.ImmutableMapOf3 - Prefer
ImmutableMap#of(Object, Object, Object, Object, Object, Object)over alternatives that don't communicate the immutability of the resulting map at the type level.
- Refaster template
- 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.
- Refaster template
- 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.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMapRulesRecipes$ImmutableMapOfRecipe
- Refaster template
ImmutableMapRules.ImmutableMapOf - Prefer
ImmutableMap#of()over more contrived alternatives or alternatives that don't communicate the immutability of the resulting map at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMultisetRulesRecipes
ImmutableMultisetRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableMultisets. Source.
- tech.picnic.errorprone.refasterrules.ImmutableMultisetRulesRecipes$EmptyImmutableMultisetRecipe
- Refaster template
ImmutableMultisetRules.EmptyImmutableMultiset - Prefer
ImmutableMultiset#of()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMultisetRulesRecipes$ImmutableMultisetBuilderRecipe
- Refaster template
ImmutableMultisetRules.ImmutableMultisetBuilder - Prefer
ImmutableMultiset#builder()over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMultisetRulesRecipes$IterableToImmutableMultisetRecipe
- Refaster template
ImmutableMultisetRules.IterableToImmutableMultiset - Prefer
ImmutableMultiset#copyOf(Iterable)and variants over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableMultisetRulesRecipes$StreamToImmutableMultisetRecipe
- Refaster template
ImmutableMultisetRules.StreamToImmutableMultiset - Prefer
ImmutableMultiset#toImmutableMultiset()over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetMultimapRulesRecipes
ImmutableSetMultimapRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableSetMultimaps. Source.
- tech.picnic.errorprone.refasterrules.ImmutableSetMultimapRulesRecipes$EmptyImmutableSetMultimapRecipe
- Refaster template
ImmutableSetMultimapRules.EmptyImmutableSetMultimap - Prefer
ImmutableSetMultimap#of()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetMultimapRulesRecipes$EntryToImmutableSetMultimapRecipe
- Refaster template
ImmutableSetMultimapRules.EntryToImmutableSetMultimap - Prefer
ImmutableSetMultimap#of(Object, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetMultimapRulesRecipes$ImmutableSetMultimapBuilderRecipe
- Refaster template
ImmutableSetMultimapRules.ImmutableSetMultimapBuilder - Prefer
ImmutableSetMultimap#builder()over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetMultimapRulesRecipes$IterableToImmutableSetMultimapRecipe
- Refaster template
ImmutableSetMultimapRules.IterableToImmutableSetMultimap - Prefer
ImmutableSetMultimap#copyOf(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetMultimapRulesRecipes$PairToImmutableSetMultimapRecipe
- Refaster template
ImmutableSetMultimapRules.PairToImmutableSetMultimap - Prefer
ImmutableSetMultimap#of(Object, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetMultimapRulesRecipes$TransformMultimapValuesToImmutableSetMultimap2Recipe
- Refaster template
ImmutableSetMultimapRules.TransformMultimapValuesToImmutableSetMultimap2 - Prefer creating an immutable copy of the result of
Multimaps#transformValues(Multimap, com.google.common.base.Function)over creating and directly collecting a stream.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes
ImmutableSetRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableSets. Source.
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetBuilderRecipe
- Refaster template
ImmutableSetRules.ImmutableSetBuilder - Prefer
ImmutableSet#builder()over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetCopyOfSetViewRecipe
- Refaster template
ImmutableSetRules.ImmutableSetCopyOfSetView - Prefer
SetView#immutableCopy()over the more verbose alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetOf1Recipe
- Refaster template
ImmutableSetRules.ImmutableSetOf1 - Prefer
ImmutableSet#of(Object)over more contrived alternatives or alternatives that don't communicate the immutability of the resulting set at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetOf2Recipe
- Refaster template
ImmutableSetRules.ImmutableSetOf2 - Prefer
ImmutableSet#of(Object, Object)over alternatives that don't communicate the immutability of the resulting set at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetOf3Recipe
- Refaster template
ImmutableSetRules.ImmutableSetOf3 - Prefer
ImmutableSet#of(Object, Object, Object)over alternatives that don't communicate the immutability of the resulting set at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetOf4Recipe
- Refaster template
ImmutableSetRules.ImmutableSetOf4 - Prefer
ImmutableSet#of(Object, Object, Object, Object)over alternatives that don't communicate the immutability of the resulting set at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetOf5Recipe
- Refaster template
ImmutableSetRules.ImmutableSetOf5 - Prefer
ImmutableSet#of(Object, Object, Object, Object, Object)over alternatives that don't communicate the immutability of the resulting set at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$ImmutableSetOfRecipe
- Refaster template
ImmutableSetRules.ImmutableSetOf - Prefer
ImmutableSet#of()over more contrived alternatives or alternatives that don't communicate the immutability of the resulting set at the type level.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$IterableToImmutableSetRecipe
- Refaster template
ImmutableSetRules.IterableToImmutableSet - Prefer
ImmutableSet#copyOf(Iterable)and variants over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$SetsDifferenceMapRecipe
- Refaster template
ImmutableSetRules.SetsDifferenceMap - Prefer an immutable copy of
Sets#difference(Set, Set)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$SetsDifferenceMultimapRecipe
- Refaster template
ImmutableSetRules.SetsDifferenceMultimap - Prefer an immutable copy of
Sets#difference(Set, Set)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$SetsDifferenceRecipe
- Refaster template
ImmutableSetRules.SetsDifference - Prefer an immutable copy of
Sets#difference(Set, Set)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$SetsIntersectionMapRecipe
- Refaster template
ImmutableSetRules.SetsIntersectionMap - Prefer an immutable copy of
Sets#intersection(Set, Set)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$SetsIntersectionMultimapRecipe
- Refaster template
ImmutableSetRules.SetsIntersectionMultimap - Prefer an immutable copy of
Sets#intersection(Set, Set)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$SetsIntersectionRecipe
- Refaster template
ImmutableSetRules.SetsIntersection - Prefer an immutable copy of
Sets#intersection(Set, Set)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$SetsUnionRecipe
- Refaster template
ImmutableSetRules.SetsUnion - Prefer an immutable copy of
Sets#union(Set, Set)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSetRulesRecipes$StreamToImmutableSetRecipe
- Refaster template
ImmutableSetRules.StreamToImmutableSet - Prefer
ImmutableSet#toImmutableSet()over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes
ImmutableSortedMapRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableSortedMaps. Source.
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes$EmptyImmutableSortedMapRecipe
- Refaster template
ImmutableSortedMapRules.EmptyImmutableSortedMap - Prefer
ImmutableSortedMap#of()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes$EntryToImmutableSortedMapRecipe
- Refaster template
ImmutableSortedMapRules.EntryToImmutableSortedMap - Prefer
ImmutableSortedMap#of(Object, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes$ImmutableSortedMapBuilderRecipe
- Refaster template
ImmutableSortedMapRules.ImmutableSortedMapBuilder - Prefer
ImmutableSortedMap#orderedBy(Comparator)over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes$ImmutableSortedMapNaturalOrderBuilderRecipe
- Refaster template
ImmutableSortedMapRules.ImmutableSortedMapNaturalOrderBuilder - Prefer
ImmutableSortedMap#naturalOrder()over the alternative that requires explicitly providing theComparator.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes$ImmutableSortedMapReverseOrderBuilderRecipe
- Refaster template
ImmutableSortedMapRules.ImmutableSortedMapReverseOrderBuilder - Prefer
ImmutableSortedMap#reverseOrder()over the alternative that requires explicitly providing theComparator.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes$IterableToImmutableSortedMapRecipe
- Refaster template
ImmutableSortedMapRules.IterableToImmutableSortedMap - Prefer
ImmutableSortedMap#copyOf(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMapRulesRecipes$PairToImmutableSortedMapRecipe
- Refaster template
ImmutableSortedMapRules.PairToImmutableSortedMap - Prefer
ImmutableSortedMap#of(Object, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMultisetRulesRecipes
ImmutableSortedMultisetRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableSortedMultisets. Source.
- tech.picnic.errorprone.refasterrules.ImmutableSortedMultisetRulesRecipes$EmptyImmutableSortedMultisetRecipe
- Refaster template
ImmutableSortedMultisetRules.EmptyImmutableSortedMultiset - Prefer
ImmutableSortedMultiset#of()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMultisetRulesRecipes$ImmutableSortedMultisetBuilderRecipe
- Refaster template
ImmutableSortedMultisetRules.ImmutableSortedMultisetBuilder - Prefer
ImmutableSortedMultiset#orderedBy(Comparator)over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMultisetRulesRecipes$ImmutableSortedMultisetNaturalOrderBuilderRecipe
- Refaster template
ImmutableSortedMultisetRules.ImmutableSortedMultisetNaturalOrderBuilder - Prefer
ImmutableSortedMultiset#naturalOrder()over the alternative that requires explicitly providing theComparator.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMultisetRulesRecipes$ImmutableSortedMultisetReverseOrderBuilderRecipe
- Refaster template
ImmutableSortedMultisetRules.ImmutableSortedMultisetReverseOrderBuilder - Prefer
ImmutableSortedMultiset#reverseOrder()over the alternative that requires explicitly providing theComparator.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMultisetRulesRecipes$IterableToImmutableSortedMultisetRecipe
- Refaster template
ImmutableSortedMultisetRules.IterableToImmutableSortedMultiset - Prefer
ImmutableSortedMultiset#copyOf(Iterable)and variants over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedMultisetRulesRecipes$StreamToImmutableSortedMultisetRecipe
- Refaster template
ImmutableSortedMultisetRules.StreamToImmutableSortedMultiset - Prefer
ImmutableSortedMultiset#toImmutableSortedMultiset(Comparator)over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedSetRulesRecipes
ImmutableSortedSetRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableSortedSets. Source.
- tech.picnic.errorprone.refasterrules.ImmutableSortedSetRulesRecipes$EmptyImmutableSortedSetRecipe
- Refaster template
ImmutableSortedSetRules.EmptyImmutableSortedSet - Prefer
ImmutableSortedSet#of()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedSetRulesRecipes$ImmutableSortedSetBuilderRecipe
- Refaster template
ImmutableSortedSetRules.ImmutableSortedSetBuilder - Prefer
ImmutableSortedSet#orderedBy(Comparator)over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedSetRulesRecipes$ImmutableSortedSetNaturalOrderBuilderRecipe
- Refaster template
ImmutableSortedSetRules.ImmutableSortedSetNaturalOrderBuilder - Prefer
ImmutableSortedSet#naturalOrder()over the alternative that requires explicitly providing theComparator.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedSetRulesRecipes$ImmutableSortedSetReverseOrderBuilderRecipe
- Refaster template
ImmutableSortedSetRules.ImmutableSortedSetReverseOrderBuilder - Prefer
ImmutableSortedSet#reverseOrder()over the alternative that requires explicitly providing theComparator.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedSetRulesRecipes$IterableToImmutableSortedSetRecipe
- Refaster template
ImmutableSortedSetRules.IterableToImmutableSortedSet - Prefer
ImmutableSortedSet#copyOf(Iterable)and variants over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableSortedSetRulesRecipes$StreamToImmutableSortedSetRecipe
- Refaster template
ImmutableSortedSetRules.StreamToImmutableSortedSet - Prefer
ImmutableSortedSet#toImmutableSortedSet(Comparator)over less idiomatic alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableTableRulesRecipes
ImmutableTableRulesRefaster recipes- Refaster rules related to expressions dealing with
ImmutableTables. Source.
- tech.picnic.errorprone.refasterrules.ImmutableTableRulesRecipes$CellToImmutableTableRecipe
- Refaster template
ImmutableTableRules.CellToImmutableTable - Prefer
ImmutableTable#of(Object, Object, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableTableRulesRecipes$ImmutableTableBuilderBuildOrThrowRecipe
- Refaster template
ImmutableTableRules.ImmutableTableBuilderBuildOrThrow - Prefer
ImmutableTable.Builder#buildOrThrow()over the less explicitImmutableTable.Builder#build().
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableTableRulesRecipes$ImmutableTableBuilderRecipe
- Refaster template
ImmutableTableRules.ImmutableTableBuilder - Prefer
ImmutableTable#builder()over the associated constructor.
- Refaster template
- tech.picnic.errorprone.refasterrules.ImmutableTableRulesRecipes$ImmutableTableOfRecipe
- Refaster template
ImmutableTableRules.ImmutableTableOf - Prefer
ImmutableTable#of()over more contrived alternatives .
- Refaster template
- tech.picnic.errorprone.refasterrules.InputStreamRulesRecipes
InputStreamRulesRefaster recipes- Refaster rules related to expressions dealing with
InputStreams. Source.
- tech.picnic.errorprone.refasterrules.InputStreamRulesRecipes$InputStreamReadAllBytesRecipe
- Refaster template
InputStreamRules.InputStreamReadAllBytes - Recipe created for the following Refaster template:
java static final class InputStreamReadAllBytes { @BeforeTemplate byte[] before(InputStream in) throws IOException { return ByteStreams.toByteArray(in); } @AfterTemplate byte[] after(InputStream in) throws IOException { return in.readAllBytes(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.InputStreamRulesRecipes$InputStreamReadNBytesRecipe
- Refaster template
InputStreamRules.InputStreamReadNBytes - Recipe created for the following Refaster template:
java static final class InputStreamReadNBytes { @BeforeTemplate byte[] before(InputStream in, int n) throws IOException { return ByteStreams.limit(in, n).readAllBytes(); } @AfterTemplate byte[] after(InputStream in, int n) throws IOException { return in.readNBytes(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.InputStreamRulesRecipes$InputStreamSkipNBytesRecipe
- Refaster template
InputStreamRules.InputStreamSkipNBytes - Recipe created for the following Refaster template:
java static final class InputStreamSkipNBytes { @BeforeTemplate void before(InputStream in, long n) throws IOException { ByteStreams.skipFully(in, n); } @AfterTemplate void after(InputStream in, long n) throws IOException { in.skipNBytes(n); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.InputStreamRulesRecipes$InputStreamTransferToRecipe
- Refaster template
InputStreamRules.InputStreamTransferTo - Recipe created for the following Refaster template:
java static final class InputStreamTransferTo { @BeforeTemplate long before(InputStream in, OutputStream out) throws IOException { return ByteStreams.copy(in, out); } @AfterTemplate long after(InputStream in, OutputStream out) throws IOException { return in.transferTo(out); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes
IntStreamRulesRefaster recipes- Refaster rules related to expressions dealing with
IntStreams. Source.
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$ConcatOneIntStreamRecipe
- Refaster template
IntStreamRules.ConcatOneIntStream - Don't unnecessarily call
Streams#concat(IntStream...).
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$ConcatTwoIntStreamsRecipe
- Refaster template
IntStreamRules.ConcatTwoIntStreams - Prefer
IntStream#concat(IntStream, IntStream)over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamAllMatchRecipe
- Refaster template
IntStreamRules.IntStreamAllMatch - Recipe created for the following Refaster template:
java static final class IntStreamAllMatch { @BeforeTemplate boolean before(IntStream stream, IntPredicate predicate) { return stream.noneMatch(predicate.negate()); } @AfterTemplate boolean after(IntStream stream, IntPredicate predicate) { return stream.allMatch(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamAnyMatchRecipe
- Refaster template
IntStreamRules.IntStreamAnyMatch - Prefer
IntStream#anyMatch(IntPredicate)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamClosedOpenRangeRecipe
- Refaster template
IntStreamRules.IntStreamClosedOpenRange - Prefer
IntStream#range(int, int)over the more contrived alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamFilterSortedRecipe
- Refaster template
IntStreamRules.IntStreamFilterSorted - Apply
IntStream#filter(IntPredicate)beforeIntStream#sorted()to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamIsEmptyRecipe
- Refaster template
IntStreamRules.IntStreamIsEmpty - In order to test whether a stream has any element, simply try to find one.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamIsNotEmptyRecipe
- Refaster template
IntStreamRules.IntStreamIsNotEmpty - In order to test whether a stream has any element, simply try to find one.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamMinRecipe
- Refaster template
IntStreamRules.IntStreamMin - Recipe created for the following Refaster template:
java static final class IntStreamMin { @BeforeTemplate OptionalInt before(IntStream stream) { return stream.sorted().findFirst(); } @AfterTemplate OptionalInt after(IntStream stream) { return stream.min(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamNoneMatchRecipe
- Refaster template
IntStreamRules.IntStreamNoneMatch - Prefer
IntStream#noneMatch(IntPredicate)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.IntStreamRulesRecipes$IntStreamTakeWhileRecipe
- Refaster template
IntStreamRules.IntStreamTakeWhile - Recipe created for the following Refaster template:
java static final class IntStreamTakeWhile { @BeforeTemplate IntStream before(IntStream stream, IntPredicate predicate) { return stream.takeWhile(predicate).filter(predicate); } @AfterTemplate IntStream after(IntStream stream, IntPredicate predicate) { return stream.takeWhile(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes
- Refaster rules to replace JUnit assertions with AssertJ equivalents
- Note that, while both libraries throw an
AssertionErrorin case of an assertion failure, the exact subtype used generally differs. Source.
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatBooleanArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatBooleanArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatBooleanArrayContainsExactly { @BeforeTemplate void before(boolean[] actual, boolean[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean[] actual, boolean[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatBooleanArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatBooleanArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatBooleanArrayWithFailMessageContainsExactly { @BeforeTemplate void before(boolean[] actual, String message, boolean[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean[] actual, String message, boolean[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatByteArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatByteArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatByteArrayContainsExactly { @BeforeTemplate void before(byte[] actual, byte[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(byte[] actual, byte[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatByteArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatByteArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatByteArrayWithFailMessageContainsExactly { @BeforeTemplate void before(byte[] actual, String message, byte[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(byte[] actual, String message, byte[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatCharArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatCharArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatCharArrayContainsExactly { @BeforeTemplate void before(char[] actual, char[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(char[] actual, char[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatCharArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatCharArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatCharArrayWithFailMessageContainsExactly { @BeforeTemplate void before(char[] actual, String message, char[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(char[] actual, String message, char[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatCodeDoesNotThrowAnyExceptionRecipe
- Refaster template
JUnitToAssertJRules.AssertThatCodeDoesNotThrowAnyException - Recipe created for the following Refaster template:
java static final class AssertThatCodeDoesNotThrowAnyException { @BeforeTemplate void before(Executable throwingCallable) { assertDoesNotThrow(throwingCallable); } @BeforeTemplate void before(ThrowingSupplier<?> throwingCallable) { assertDoesNotThrow(throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable) { assertThatCode(throwingCallable).doesNotThrowAnyException(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatCodeWithFailMessageStringDoesNotThrowAnyExceptionRecipe
- Refaster template
JUnitToAssertJRules.AssertThatCodeWithFailMessageStringDoesNotThrowAnyException - Recipe created for the following Refaster template:
java static final class AssertThatCodeWithFailMessageStringDoesNotThrowAnyException { @BeforeTemplate void before(Executable throwingCallable, String message) { assertDoesNotThrow(throwingCallable, message); } @BeforeTemplate void before(ThrowingSupplier<?> throwingCallable, String message) { assertDoesNotThrow(throwingCallable, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, String message) { assertThatCode(throwingCallable).withFailMessage(message).doesNotThrowAnyException(); } }.
- Refaster template
- 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(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatDoubleArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatDoubleArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatDoubleArrayContainsExactly { @BeforeTemplate void before(double[] actual, double[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, double[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatDoubleArrayContainsExactlyWithOffsetRecipe
- Refaster template
JUnitToAssertJRules.AssertThatDoubleArrayContainsExactlyWithOffset - Recipe created for the following Refaster template:
java static final class AssertThatDoubleArrayContainsExactlyWithOffset { @BeforeTemplate void before(double[] actual, double[] expected, double delta) { assertArrayEquals(expected, actual, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, double[] expected, double delta) { assertThat(actual).containsExactly(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatDoubleArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatDoubleArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatDoubleArrayWithFailMessageContainsExactly { @BeforeTemplate void before(double[] actual, String message, double[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, String message, double[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatDoubleArrayWithFailMessageContainsExactlyWithOffsetRecipe
- Refaster template
JUnitToAssertJRules.AssertThatDoubleArrayWithFailMessageContainsExactlyWithOffset - Recipe created for the following Refaster template:
java static final class AssertThatDoubleArrayWithFailMessageContainsExactlyWithOffset { @BeforeTemplate void before(double[] actual, String message, double[] expected, double delta) { assertArrayEquals(expected, actual, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, String message, double[] expected, double delta) { assertThat(actual).withFailMessage(message).containsExactly(expected, offset(delta)); } }.
- Refaster template
- 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); } }.
- Refaster template
- 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)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatFloatArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatFloatArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatFloatArrayContainsExactly { @BeforeTemplate void before(float[] actual, float[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, float[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatFloatArrayContainsExactlyWithOffsetRecipe
- Refaster template
JUnitToAssertJRules.AssertThatFloatArrayContainsExactlyWithOffset - Recipe created for the following Refaster template:
java static final class AssertThatFloatArrayContainsExactlyWithOffset { @BeforeTemplate void before(float[] actual, float[] expected, float delta) { assertArrayEquals(expected, actual, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, float[] expected, float delta) { assertThat(actual).containsExactly(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatFloatArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatFloatArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatFloatArrayWithFailMessageContainsExactly { @BeforeTemplate void before(float[] actual, String message, float[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, String message, float[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatFloatArrayWithFailMessageContainsExactlyWithOffsetRecipe
- Refaster template
JUnitToAssertJRules.AssertThatFloatArrayWithFailMessageContainsExactlyWithOffset - Recipe created for the following Refaster template:
java static final class AssertThatFloatArrayWithFailMessageContainsExactlyWithOffset { @BeforeTemplate void before(float[] actual, String message, float[] expected, float delta) { assertArrayEquals(expected, actual, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, String message, float[] expected, float delta) { assertThat(actual).withFailMessage(message).containsExactly(expected, offset(delta)); } }.
- Refaster template
- 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); } }.
- Refaster template
- 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)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIntArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIntArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatIntArrayContainsExactly { @BeforeTemplate void before(int[] actual, int[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(int[] actual, int[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIntArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIntArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatIntArrayWithFailMessageContainsExactly { @BeforeTemplate void before(int[] actual, String message, int[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(int[] actual, String message, int[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIsFalseRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIsFalse - Recipe created for the following Refaster template:
java static final class AssertThatIsFalse { @BeforeTemplate void before(boolean actual) { assertFalse(actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean actual) { assertThat(actual).isFalse(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIsInstanceOfRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIsInstanceOf - Recipe created for the following Refaster template:
java static final class AssertThatIsInstanceOf<T> { @BeforeTemplate void before(Object actual, Class<T> clazz) { assertInstanceOf(clazz, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Class<T> clazz) { assertThat(actual).isInstanceOf(clazz); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIsNotNullRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIsNotNull - Recipe created for the following Refaster template:
java static final class AssertThatIsNotNull { @BeforeTemplate void before(Object actual) { assertNotNull(actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual) { assertThat(actual).isNotNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIsNotSameAsRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIsNotSameAs - Recipe created for the following Refaster template:
java static final class AssertThatIsNotSameAs { @BeforeTemplate void before(Object actual, Object expected) { assertNotSame(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Object expected) { assertThat(actual).isNotSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIsNullRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIsNull - Recipe created for the following Refaster template:
java static final class AssertThatIsNull { @BeforeTemplate void before(Object actual) { assertNull(actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual) { assertThat(actual).isNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIsSameAsRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIsSameAs - Recipe created for the following Refaster template:
java static final class AssertThatIsSameAs { @BeforeTemplate void before(Object actual, Object expected) { assertSame(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Object expected) { assertThat(actual).isSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatIsTrueRecipe
- Refaster template
JUnitToAssertJRules.AssertThatIsTrue - Recipe created for the following Refaster template:
java static final class AssertThatIsTrue { @BeforeTemplate void before(boolean actual) { assertTrue(actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean actual) { assertThat(actual).isTrue(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatLongArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatLongArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatLongArrayContainsExactly { @BeforeTemplate void before(long[] actual, long[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(long[] actual, long[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatLongArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatLongArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatLongArrayWithFailMessageContainsExactly { @BeforeTemplate void before(long[] actual, String message, long[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(long[] actual, String message, long[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatObjectArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatObjectArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatObjectArrayContainsExactly { @BeforeTemplate void before(Object[] actual, Object[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object[] actual, Object[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatObjectArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatObjectArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatObjectArrayWithFailMessageContainsExactly { @BeforeTemplate void before(Object[] actual, String message, Object[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object[] actual, String message, Object[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatShortArrayContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatShortArrayContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatShortArrayContainsExactly { @BeforeTemplate void before(short[] actual, short[] expected) { assertArrayEquals(expected, actual); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(short[] actual, short[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatShortArrayWithFailMessageContainsExactlyRecipe
- Refaster template
JUnitToAssertJRules.AssertThatShortArrayWithFailMessageContainsExactly - Recipe created for the following Refaster template:
java static final class AssertThatShortArrayWithFailMessageContainsExactly { @BeforeTemplate void before(short[] actual, String message, short[] expected) { assertArrayEquals(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(short[] actual, String message, short[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatThrownByIsExactlyInstanceOfRecipe
- Refaster template
JUnitToAssertJRules.AssertThatThrownByIsExactlyInstanceOf - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIsExactlyInstanceOf<T extends Throwable> { @BeforeTemplate void before(Executable throwingCallable, Class<T> clazz) { assertThrowsExactly(clazz, throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, Class<T> clazz) { assertThatThrownBy(throwingCallable).isExactlyInstanceOf(clazz); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatThrownByIsInstanceOfRecipe
- Refaster template
JUnitToAssertJRules.AssertThatThrownByIsInstanceOf - Recipe created for the following Refaster template:
java static final class AssertThatThrownByIsInstanceOf<T extends Throwable> { @BeforeTemplate void before(Executable throwingCallable, Class<T> clazz) { assertThrows(clazz, throwingCallable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, Class<T> clazz) { assertThatThrownBy(throwingCallable).isInstanceOf(clazz); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatThrownByWithFailMessageStringIsExactlyInstanceOfRecipe
- Refaster template
JUnitToAssertJRules.AssertThatThrownByWithFailMessageStringIsExactlyInstanceOf - Recipe created for the following Refaster template:
java static final class AssertThatThrownByWithFailMessageStringIsExactlyInstanceOf<T extends Throwable> { @BeforeTemplate void before(Executable throwingCallable, String message, Class<T> clazz) { assertThrowsExactly(clazz, throwingCallable, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, String message, Class<T> clazz) { assertThatThrownBy(throwingCallable).withFailMessage(message).isExactlyInstanceOf(clazz); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatThrownByWithFailMessageStringIsInstanceOfRecipe
- Refaster template
JUnitToAssertJRules.AssertThatThrownByWithFailMessageStringIsInstanceOf - Recipe created for the following Refaster template:
java static final class AssertThatThrownByWithFailMessageStringIsInstanceOf<T extends Throwable> { @BeforeTemplate void before(Executable throwingCallable, String message, Class<T> clazz) { assertThrows(clazz, throwingCallable, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable throwingCallable, String message, Class<T> clazz) { assertThatThrownBy(throwingCallable).withFailMessage(message).isInstanceOf(clazz); } }.
- Refaster template
- 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); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageStringIsFalseRecipe
- Refaster template
JUnitToAssertJRules.AssertThatWithFailMessageStringIsFalse - Recipe created for the following Refaster template:
java static final class AssertThatWithFailMessageStringIsFalse { @BeforeTemplate void before(boolean actual, String message) { assertFalse(actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean actual, String message) { assertThat(actual).withFailMessage(message).isFalse(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageStringIsInstanceOfRecipe
- Refaster template
JUnitToAssertJRules.AssertThatWithFailMessageStringIsInstanceOf - Recipe created for the following Refaster template:
java static final class AssertThatWithFailMessageStringIsInstanceOf<T> { @BeforeTemplate void before(Object actual, String message, Class<T> clazz) { assertInstanceOf(clazz, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message, Class<T> clazz) { assertThat(actual).withFailMessage(message).isInstanceOf(clazz); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageStringIsNotNullRecipe
- Refaster template
JUnitToAssertJRules.AssertThatWithFailMessageStringIsNotNull - Recipe created for the following Refaster template:
java static final class AssertThatWithFailMessageStringIsNotNull { @BeforeTemplate void before(Object actual, String message) { assertNotNull(actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message) { assertThat(actual).withFailMessage(message).isNotNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageStringIsNotSameAsRecipe
- Refaster template
JUnitToAssertJRules.AssertThatWithFailMessageStringIsNotSameAs - Recipe created for the following Refaster template:
java static final class AssertThatWithFailMessageStringIsNotSameAs { @BeforeTemplate void before(Object actual, String message, Object expected) { assertNotSame(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message, Object expected) { assertThat(actual).withFailMessage(message).isNotSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageStringIsNullRecipe
- Refaster template
JUnitToAssertJRules.AssertThatWithFailMessageStringIsNull - Recipe created for the following Refaster template:
java static final class AssertThatWithFailMessageStringIsNull { @BeforeTemplate void before(Object actual, String message) { assertNull(actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message) { assertThat(actual).withFailMessage(message).isNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageStringIsSameAsRecipe
- Refaster template
JUnitToAssertJRules.AssertThatWithFailMessageStringIsSameAs - Recipe created for the following Refaster template:
java static final class AssertThatWithFailMessageStringIsSameAs { @BeforeTemplate void before(Object actual, String message, Object expected) { assertSame(expected, actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message, Object expected) { assertThat(actual).withFailMessage(message).isSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$AssertThatWithFailMessageStringIsTrueRecipe
- Refaster template
JUnitToAssertJRules.AssertThatWithFailMessageStringIsTrue - Recipe created for the following Refaster template:
java static final class AssertThatWithFailMessageStringIsTrue { @BeforeTemplate void before(boolean actual, String message) { assertTrue(actual, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean actual, String message) { assertThat(actual).withFailMessage(message).isTrue(); } }.
- Refaster template
- 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(); } }.
- Refaster template
- 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); } }.
- Refaster template
- 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(); } }.
- Refaster template
- 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); } }.
- Refaster template
- 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(); } }.
- Refaster template
- 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); } }.
- Refaster template
- 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(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$FailRecipe
- Refaster template
JUnitToAssertJRules.Fail - Recipe created for the following Refaster template:
java static final class Fail<T> { @BeforeTemplate T before() { return Assertions.fail(); } @AfterTemplate @DoNotCall T after() { return fail(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$FailWithMessageAndThrowableRecipe
- Refaster template
JUnitToAssertJRules.FailWithMessageAndThrowable - Recipe created for the following Refaster template:
java static final class FailWithMessageAndThrowable<T> { @BeforeTemplate T before(String message, Throwable throwable) { return Assertions.fail(message, throwable); } @AfterTemplate T after(String message, Throwable throwable) { return fail(message, throwable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$FailWithMessageRecipe
- Refaster template
JUnitToAssertJRules.FailWithMessage - Recipe created for the following Refaster template:
java static final class FailWithMessage<T> { @BeforeTemplate T before(String message) { return Assertions.fail(message); } @AfterTemplate T after(String message) { return fail(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.JUnitToAssertJRulesRecipes$FailWithThrowableRecipe
- Refaster template
JUnitToAssertJRules.FailWithThrowable - Recipe created for the following Refaster template:
java static final class FailWithThrowable<T> { @BeforeTemplate T before(Throwable throwable) { return Assertions.fail(throwable); } @AfterTemplate @DoNotCall T after(Throwable throwable) { return fail(throwable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson2RulesRecipes
Jackson2RulesRefaster recipes- Refaster rules related to Jackson 2.x expressions and statements. Source.
- tech.picnic.errorprone.refasterrules.Jackson2RulesRecipes$JsonNodeOptionalIntRecipe
- Refaster template
Jackson2Rules.JsonNodeOptionalInt - Prefer
JsonNode#optional(int)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson2RulesRecipes$JsonNodeOptionalStringRecipe
- Refaster template
Jackson2Rules.JsonNodeOptionalString - Prefer
JsonNode#optional(String)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson2RulesRecipes$ObjectMapperConvertValueWithClassRecipe
- Refaster template
Jackson2Rules.ObjectMapperConvertValueWithClass - Prefer
ObjectMapper#convertValue(Object, Class)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson2RulesRecipes$ObjectMapperConvertValueWithJavaTypeRecipe
- Refaster template
Jackson2Rules.ObjectMapperConvertValueWithJavaType - Prefer
ObjectMapper#convertValue(Object, JavaType)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson2RulesRecipes$ObjectMapperConvertValueWithTypeReferenceRecipe
- Refaster template
Jackson2Rules.ObjectMapperConvertValueWithTypeReference - Prefer
ObjectMapper#convertValue(Object, TypeReference)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson2RulesRecipes$ObjectMapperValueToTreeRecipe
- Refaster template
Jackson2Rules.ObjectMapperValueToTree - Prefer
ObjectMapper#valueToTree(Object)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson3RulesRecipes
Jackson3RulesRefaster recipes- Refaster rules related to Jackson 3.x expressions and statements. Source.
- tech.picnic.errorprone.refasterrules.Jackson3RulesRecipes$JsonNodeOptionalIntRecipe
- Refaster template
Jackson3Rules.JsonNodeOptionalInt - Prefer
JsonNode#optional(int)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson3RulesRecipes$JsonNodeOptionalStringRecipe
- Refaster template
Jackson3Rules.JsonNodeOptionalString - Prefer
JsonNode#optional(String)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson3RulesRecipes$ObjectMapperConvertValueWithClassRecipe
- Refaster template
Jackson3Rules.ObjectMapperConvertValueWithClass - Prefer
ObjectMapper#convertValue(Object, Class)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson3RulesRecipes$ObjectMapperConvertValueWithJavaTypeRecipe
- Refaster template
Jackson3Rules.ObjectMapperConvertValueWithJavaType - Prefer
ObjectMapper#convertValue(Object, JavaType)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson3RulesRecipes$ObjectMapperConvertValueWithTypeReferenceRecipe
- Refaster template
Jackson3Rules.ObjectMapperConvertValueWithTypeReference - Prefer
ObjectMapper#convertValue(Object, TypeReference)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.Jackson3RulesRecipes$ObjectMapperValueToTreeRecipe
- Refaster template
Jackson3Rules.ObjectMapperValueToTree - Prefer
ObjectMapper#valueToTree(Object)over more contrived and less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes
LongStreamRulesRefaster recipes- Refaster rules related to expressions dealing with
LongStreams. Source.
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$ConcatOneLongStreamRecipe
- Refaster template
LongStreamRules.ConcatOneLongStream - Don't unnecessarily call
Streams#concat(LongStream...).
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$ConcatTwoLongStreamsRecipe
- Refaster template
LongStreamRules.ConcatTwoLongStreams - Prefer
LongStream#concat(LongStream, LongStream)over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamAllMatchRecipe
- Refaster template
LongStreamRules.LongStreamAllMatch - Recipe created for the following Refaster template:
java static final class LongStreamAllMatch { @BeforeTemplate boolean before(LongStream stream, LongPredicate predicate) { return stream.noneMatch(predicate.negate()); } @AfterTemplate boolean after(LongStream stream, LongPredicate predicate) { return stream.allMatch(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamAnyMatchRecipe
- Refaster template
LongStreamRules.LongStreamAnyMatch - Prefer
LongStream#anyMatch(LongPredicate)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamClosedOpenRangeRecipe
- Refaster template
LongStreamRules.LongStreamClosedOpenRange - Prefer
LongStream#range(long, long)over the more contrived alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamFilterSortedRecipe
- Refaster template
LongStreamRules.LongStreamFilterSorted - Apply
LongStream#filter(LongPredicate)beforeLongStream#sorted()to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamIsEmptyRecipe
- Refaster template
LongStreamRules.LongStreamIsEmpty - In order to test whether a stream has any element, simply try to find one.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamIsNotEmptyRecipe
- Refaster template
LongStreamRules.LongStreamIsNotEmpty - In order to test whether a stream has any element, simply try to find one.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamMinRecipe
- Refaster template
LongStreamRules.LongStreamMin - Recipe created for the following Refaster template:
java static final class LongStreamMin { @BeforeTemplate OptionalLong before(LongStream stream) { return stream.sorted().findFirst(); } @AfterTemplate OptionalLong after(LongStream stream) { return stream.min(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamNoneMatchRecipe
- Refaster template
LongStreamRules.LongStreamNoneMatch - Prefer
LongStream#noneMatch(LongPredicate)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.LongStreamRulesRecipes$LongStreamTakeWhileRecipe
- Refaster template
LongStreamRules.LongStreamTakeWhile - Recipe created for the following Refaster template:
java static final class LongStreamTakeWhile { @BeforeTemplate LongStream before(LongStream stream, LongPredicate predicate) { return stream.takeWhile(predicate).filter(predicate); } @AfterTemplate LongStream after(LongStream stream, LongPredicate predicate) { return stream.takeWhile(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapEntryRulesRecipes
MapEntryRulesRefaster recipes- Refaster rules related to expressions dealing with
Map.Entryinstances. Source.
- tech.picnic.errorprone.refasterrules.MapEntryRulesRecipes$MapEntryComparingByKeyRecipe
- Refaster template
MapEntryRules.MapEntryComparingByKey - Prefer
Map.Entry#comparingByKey()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapEntryRulesRecipes$MapEntryComparingByKeyWithCustomComparatorRecipe
- Refaster template
MapEntryRules.MapEntryComparingByKeyWithCustomComparator - Prefer
Map.Entry#comparingByKey(Comparator)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapEntryRulesRecipes$MapEntryComparingByValueRecipe
- Refaster template
MapEntryRules.MapEntryComparingByValue - Prefer
Map.Entry#comparingByValue()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapEntryRulesRecipes$MapEntryComparingByValueWithCustomComparatorRecipe
- Refaster template
MapEntryRules.MapEntryComparingByValueWithCustomComparator - Prefer
Map.Entry#comparingByValue(Comparator)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapEntryRulesRecipes$MapEntryRecipe
- Prefer
Map#entry(Object, Object)over alternative ways to create an immutable map entry - <strong>Warning:</strong> while both
Maps#immutableEntry(Object, Object)andAbstractMap.SimpleImmutableEntryallownullkeys and values, the preferred @link Map#entry(Object, Object)} variant does not. Moreover, theMap.Entryinstances produced by the former approaches isjava.io.Serializable, while this does not hold for the object returned by the preferred approach.
- Prefer
- tech.picnic.errorprone.refasterrules.MapRulesRecipes
MapRulesRefaster recipes- Refaster rules related to expressions dealing with
Mapinstances. Source.
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapContainsKeyRecipe
- Refaster template
MapRules.MapContainsKey - Prefer
Map#containsKey(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapContainsValueRecipe
- Refaster template
MapRules.MapContainsValue - Prefer
Map#containsValue(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapGetOrDefaultRecipe
- Refaster template
MapRules.MapGetOrDefault - Prefer
Map#getOrDefault(Object, Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapGetOrNullRecipe
- Refaster template
MapRules.MapGetOrNull - Recipe created for the following Refaster template:
java static final class MapGetOrNull<K, V, T> { @BeforeTemplate @Nullable V before(Map<K, V> map, T key) { return map.getOrDefault(key, null); } @AfterTemplate @Nullable V after(Map<K, V> map, T key) { return map.get(key); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapIsEmptyRecipe
- Refaster template
MapRules.MapIsEmpty - Prefer
Map#isEmpty()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapKeyStreamRecipe
- Refaster template
MapRules.MapKeyStream - Don't unnecessarily use
Map#entrySet().
- Refaster template
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapSizeRecipe
- Refaster template
MapRules.MapSize - Prefer
Map#size()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MapRulesRecipes$MapValueStreamRecipe
- Refaster template
MapRules.MapValueStream - Don't unnecessarily use
Map#entrySet().
- Refaster template
- tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes
MicrometerRulesRefaster recipes- Refaster rules related to expressions dealing with Micrometer. Source.
- tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes$TagsOf1Recipe
- Refaster template
MicrometerRules.TagsOf1 - Prefer using
Tagsover other immutable collections.
- Refaster template
- tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes$TagsOf2Recipe
- Refaster template
MicrometerRules.TagsOf2 - Prefer using
Tagsover other immutable collections.
- Refaster template
- tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes$TagsOf3Recipe
- Refaster template
MicrometerRules.TagsOf3 - Prefer using
Tagsover other immutable collections.
- Refaster template
- tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes$TagsOf4Recipe
- Refaster template
MicrometerRules.TagsOf4 - Prefer using
Tagsover other immutable collections.
- Refaster template
- tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes$TagsOf5Recipe
- Refaster template
MicrometerRules.TagsOf5 - Prefer using
Tagsover other immutable collections.
- Refaster template
- tech.picnic.errorprone.refasterrules.MockitoRulesRecipes
MockitoRulesRefaster recipes- Refaster rules related to Mockito expressions and statements. Source.
- tech.picnic.errorprone.refasterrules.MockitoRulesRecipes$InvocationOnMockGetArgumentsRecipe
- Refaster template
MockitoRules.InvocationOnMockGetArguments - Recipe created for the following Refaster template:
java static final class InvocationOnMockGetArguments { @BeforeTemplate Object before(InvocationOnMock invocation, int i) { return invocation.getArguments()[i]; } @AfterTemplate Object after(InvocationOnMock invocation, int i) { return invocation.getArgument(i); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.MockitoRulesRecipes$NeverRecipe
- Refaster template
MockitoRules.Never - Prefer
Mockito#never()} over explicitly specifying that the associated invocation must happen precisely zero times.
- Refaster template
- tech.picnic.errorprone.refasterrules.MockitoRulesRecipes$VerifyOnceRecipe
- Refaster template
MockitoRules.VerifyOnce - Prefer
Mockito#verify(Object)over explicitly specifying that the associated invocation must happen precisely once; this is the default behavior.
- Refaster template
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes
MultimapRulesRefaster recipes- Refaster rules related to expressions dealing with
Multimaps. Source.
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapContainsKeyRecipe
- Refaster template
MultimapRules.MultimapContainsKey - Prefer
Multimap#containsKey(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapContainsValueRecipe
- Refaster template
MultimapRules.MultimapContainsValue - Prefer
Multimap#containsValue(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapGetRecipe
- Prefer
Multimap#get(Object)over more contrived alternatives - <strong>Warning:</strong> this rewrite rule is not completely behavior preserving: the original code will yield
nullfor unknown keys, while the replacement code will return an empty collection for unknown keys.
- Prefer
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapIsEmptyRecipe
- Refaster template
MultimapRules.MultimapIsEmpty - Prefer
Multimap#isEmpty()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapKeySetRecipe
- Refaster template
MultimapRules.MultimapKeySet - Prefer
Multimap#keySet()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapKeysStreamRecipe
- Refaster template
MultimapRules.MultimapKeysStream - Don't unnecessarily use
Multimap#entries().
- Refaster template
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapSizeRecipe
- Refaster template
MultimapRules.MultimapSize - Prefer
Multimap#size()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.MultimapRulesRecipes$MultimapValuesStreamRecipe
- Refaster template
MultimapRules.MultimapValuesStream - Don't unnecessarily use
Multimap#entries().
- Refaster template
- tech.picnic.errorprone.refasterrules.NullRulesRecipes
NullRulesRefaster recipes- Refaster rules related to expressions dealing with (possibly) null values. Source.
- tech.picnic.errorprone.refasterrules.NullRulesRecipes$IsNotNullRecipe
- Refaster template
NullRules.IsNotNull - Prefer the
!=operator (withnullas the second operand) overObjects#nonNull(Object).
- Refaster template
- tech.picnic.errorprone.refasterrules.NullRulesRecipes$IsNullFunctionRecipe
- Refaster template
NullRules.IsNullFunction - Prefer
Objects#isNull(Object)over the equivalent lambda function or more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.NullRulesRecipes$IsNullRecipe
- Refaster template
NullRules.IsNull - Prefer the
==operator (withnullas the second operand) overObjects#isNull(Object).
- Refaster template
- tech.picnic.errorprone.refasterrules.NullRulesRecipes$NonNullFunctionRecipe
- Refaster template
NullRules.NonNullFunction - Prefer
Objects#nonNull(Object)over the equivalent lambda function or more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.NullRulesRecipes$RequireNonNullElseGetRecipe
- Refaster template
NullRules.RequireNonNullElseGet - Prefer
Objects#requireNonNullElseGet(Object, Supplier)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.NullRulesRecipes$RequireNonNullElseRecipe
- Refaster template
NullRules.RequireNonNullElse - Prefer
Objects#requireNonNullElse(Object, Object)over non-JDK or more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes
OptionalRulesRefaster recipes- Refaster rules related to expressions dealing with
Optionals. Source.
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$MapOptionalToBooleanRecipe
- Refaster template
OptionalRules.MapOptionalToBoolean - Prefer
Optional#filter(Predicate)overOptional#map(Function)when converting anOptionalto a boolean.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalEmptyRecipe
- Refaster template
OptionalRules.OptionalEmpty - Prefer
Optional#empty()over the more contrived alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalEqualsOptionalRecipe
- Refaster template
OptionalRules.OptionalEqualsOptional - Prefer
Optional#equals(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalFilterRecipe
- Refaster template
OptionalRules.OptionalFilter - Avoid unnecessary
OptionaltoStreamconversion when filtering a value of the former type.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalFirstIteratorElementRecipe
- Refaster template
OptionalRules.OptionalFirstIteratorElement - Don't use the ternary operator to extract the first element of a possibly-empty
Iteratoras anOptional.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalIsEmptyRecipe
- Refaster template
OptionalRules.OptionalIsEmpty - Prefer
Optional#isEmpty()over the more verbose alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalIsPresentRecipe
- Refaster template
OptionalRules.OptionalIsPresent - Prefer
Optional#isPresent()over the inverted alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalMapRecipe
- Refaster template
OptionalRules.OptionalMap - Avoid unnecessary
OptionaltoStreamconversion when mapping a value of the former type.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalOfNullableRecipe
- Refaster template
OptionalRules.OptionalOfNullable - Recipe created for the following Refaster template:
java static final class OptionalOfNullable<T> { @BeforeTemplate @SuppressWarnings(value = "TernaryOperatorOptionalNegativeFiltering") Optional<T> before(@Nullable T object) { return object == null ? Optional.empty() : Optional.of(object); } @AfterTemplate Optional<T> after(T object) { return Optional.ofNullable(object); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalOrElseThrowMethodReferenceRecipe
- Refaster template
OptionalRules.OptionalOrElseThrowMethodReference - Prefer
Optional#orElseThrow()over the less explicitOptional#get().
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalOrElseThrowRecipe
- Refaster template
OptionalRules.OptionalOrElseThrow - Prefer
Optional#orElseThrow()over the less explicitOptional#get().
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalOrOtherOptionalRecipe
- Refaster template
OptionalRules.OptionalOrOtherOptional - Prefer
Optional#or(Supplier)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OptionalStreamRecipe
- Refaster template
OptionalRules.OptionalStream - Prefer
Optional#stream()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$OrOrElseThrowRecipe
- Refaster template
OptionalRules.OrOrElseThrow - Recipe created for the following Refaster template:
java static final class OrOrElseThrow<T> { @BeforeTemplate T before(Optional<T> o1, Optional<T> o2) { return o1.orElseGet(()->o2.orElseThrow()); } @AfterTemplate T after(Optional<T> o1, Optional<T> o2) { return o1.or(()->o2).orElseThrow(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.OptionalRulesRecipes$StreamFlatMapOptionalRecipe
- Refaster template
OptionalRules.StreamFlatMapOptional - Flatten a stream of
Optionals usingOptional#stream(), rather than using one of the more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PatternRulesRecipes
PatternRulesRefaster recipes- Refaster rules related to code dealing with regular expressions. Source.
- tech.picnic.errorprone.refasterrules.PatternRulesRecipes$PatternAsPredicateRecipe
- Refaster template
PatternRules.PatternAsPredicate - Prefer
Pattern#asPredicate()over non-JDK alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PatternRulesRecipes$PatternCompileAsPredicateRecipe
- Refaster template
PatternRules.PatternCompileAsPredicate - Prefer
Pattern#asPredicate()over non-JDK alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PreconditionsRulesRecipes
PreconditionsRulesRefaster recipes- Refaster templates related to statements dealing with
Preconditions. Source.
- tech.picnic.errorprone.refasterrules.PreconditionsRulesRecipes$RequireNonNullRecipe
- Refaster template
PreconditionsRules.RequireNonNull - Prefer
Objects#requireNonNull(Object)over non-JDK alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PreconditionsRulesRecipes$RequireNonNullWithMessageRecipe
- Refaster template
PreconditionsRules.RequireNonNullWithMessage - Prefer
Objects#requireNonNull(Object, String)over non-JDK alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes
PrimitiveRulesRefaster recipes- Refaster rules related to expressions dealing with primitives. Source.
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$ArraysCompareUnsignedBytesRecipe
- Refaster template
PrimitiveRules.ArraysCompareUnsignedBytes - Prefer JDK's
Arrays#compareUnsigned(byte[], byte[])over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$ArraysCompareUnsignedIntsRecipe
- Refaster template
PrimitiveRules.ArraysCompareUnsignedInts - Prefer JDK's
Arrays#compareUnsigned(int[], int[])over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$ArraysCompareUnsignedLongsRecipe
- Refaster template
PrimitiveRules.ArraysCompareUnsignedLongs - Prefer JDK's
Arrays#compareUnsigned(long[], long[])over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$CharacterBytesRecipe
- Refaster template
PrimitiveRules.CharacterBytes - Prefer
Character#BYTESover the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$DoubleBytesRecipe
- Refaster template
PrimitiveRules.DoubleBytes - Prefer
Double#BYTESover the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$FloatBytesRecipe
- Refaster template
PrimitiveRules.FloatBytes - Prefer
Float#BYTESover the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$GreaterThanOrEqualToRecipe
- Refaster template
PrimitiveRules.GreaterThanOrEqualTo - Avoid contrived ways of expressing the "greater than or equal to" relationship.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$GreaterThanRecipe
- Refaster template
PrimitiveRules.GreaterThan - Avoid contrived ways of expressing the "greater than" relationship.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerBytesRecipe
- Refaster template
PrimitiveRules.IntegerBytes - Prefer
Integer#BYTESover the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerCompareUnsignedRecipe
- Refaster template
PrimitiveRules.IntegerCompareUnsigned - Prefer JDK's
Integer#compareUnsigned(int, int)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerDivideUnsignedRecipe
- Refaster template
PrimitiveRules.IntegerDivideUnsigned - Prefer JDK's
Integer#divideUnsigned(int, int)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerParseUnsignedIntRecipe
- Refaster template
PrimitiveRules.IntegerParseUnsignedInt - Prefer JDK's
Integer#parseUnsignedInt(String)over third-party or more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerParseUnsignedIntWithRadixRecipe
- Refaster template
PrimitiveRules.IntegerParseUnsignedIntWithRadix - Prefer JDK's
Integer#parseUnsignedInt(String, int)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerRemainderUnsignedRecipe
- Refaster template
PrimitiveRules.IntegerRemainderUnsigned - Prefer JDK's
Integer#remainderUnsigned(int, int)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerSignumIsNegativeRecipe
- Refaster template
PrimitiveRules.IntegerSignumIsNegative - Prefer an
Integer#signum(int)comparison to -1 over less clear alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerSignumIsPositiveRecipe
- Refaster template
PrimitiveRules.IntegerSignumIsPositive - Prefer an
Integer#signum(int)comparison to 1 over less clear alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerToUnsignedStringRecipe
- Refaster template
PrimitiveRules.IntegerToUnsignedString - Prefer JDK's
Integer#toUnsignedString(int)over third-party or more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$IntegerToUnsignedStringWithRadixRecipe
- Refaster template
PrimitiveRules.IntegerToUnsignedStringWithRadix - Prefer JDK's
Integer#toUnsignedString(int,int)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LessThanOrEqualToRecipe
- Refaster template
PrimitiveRules.LessThanOrEqualTo - Avoid contrived ways of expressing the "less than or equal to" relationship.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LessThanRecipe
- Refaster template
PrimitiveRules.LessThan - Avoid contrived ways of expressing the "less than" relationship.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongBytesRecipe
- Refaster template
PrimitiveRules.LongBytes - Prefer
Long#BYTESover the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongCompareUnsignedRecipe
- Refaster template
PrimitiveRules.LongCompareUnsigned - Prefer JDK's
Long#compareUnsigned(long, long)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongDivideUnsignedRecipe
- Refaster template
PrimitiveRules.LongDivideUnsigned - Prefer JDK's
Long#divideUnsigned(long, long)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongParseUnsignedLongRecipe
- Refaster template
PrimitiveRules.LongParseUnsignedLong - Prefer JDK's
Long#parseUnsignedLong(String)over third-party or more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongParseUnsignedLongWithRadixRecipe
- Refaster template
PrimitiveRules.LongParseUnsignedLongWithRadix - Prefer JDK's
Long#parseUnsignedLong(String, int)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongRemainderUnsignedRecipe
- Refaster template
PrimitiveRules.LongRemainderUnsigned - Prefer JDK's
Long#remainderUnsigned(long, long)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongSignumIsNegativeRecipe
- Refaster template
PrimitiveRules.LongSignumIsNegative - Prefer an
Long#signum(long)comparison to -1 over less clear alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongSignumIsPositiveRecipe
- Refaster template
PrimitiveRules.LongSignumIsPositive - Prefer an
Long#signum(long)comparison to 1 over less clear alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongToIntExactRecipe
- Refaster template
PrimitiveRules.LongToIntExact - Prefer
Math#toIntExact(long)over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongToUnsignedStringRecipe
- Refaster template
PrimitiveRules.LongToUnsignedString - Prefer JDK's
Long#toUnsignedString(long)over third-party or more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$LongToUnsignedStringWithRadixRecipe
- Refaster template
PrimitiveRules.LongToUnsignedStringWithRadix - Prefer JDK's
Long#toUnsignedString(long,int)over third-party alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes$ShortBytesRecipe
- Refaster template
PrimitiveRules.ShortBytes - Prefer
Short#BYTESover the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.RandomGeneratorRulesRecipes
RandomGeneratorRulesRefaster recipes- Refaster rules related to expressions dealing with
RandomGeneratorinstances. Source.
- tech.picnic.errorprone.refasterrules.RandomGeneratorRulesRecipes$RandomGeneratorNextDoubleRecipe
- Refaster template
RandomGeneratorRules.RandomGeneratorNextDouble - Prefer
RandomGenerator#nextDouble(double)over alternatives that yield a smaller domain of values and may result inDouble#isInfinite() inifinity.
- Refaster template
- tech.picnic.errorprone.refasterrules.RandomGeneratorRulesRecipes$RandomGeneratorNextIntRecipe
- Refaster template
RandomGeneratorRules.RandomGeneratorNextInt - Prefer
RandomGenerator#nextInt(int)over more contrived alternatives.
- Refaster template
- 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
longvalues from being generated.
- Prefer
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes
ReactorRulesRefaster recipes- Refaster rules related to Reactor expressions and statements. Source.
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$ConcatMapIterableIdentityRecipe
- Refaster template
ReactorRules.ConcatMapIterableIdentity - Prefer
Flux#concatMapIterable(Function)over alternatives that require an additional subscription.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$ConcatMapIterableIdentityWithPrefetchRecipe
- Refaster template
ReactorRules.ConcatMapIterableIdentityWithPrefetch - Prefer
Flux#concatMapIterable(Function, int)over alternatives that require an additional subscription.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxAsStepVerifierExpectNextRecipe
- Refaster template
ReactorRules.FluxAsStepVerifierExpectNext - Avoid list collection when verifying that a
Fluxemits exactly one value.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxCollectToImmutableListRecipe
- Refaster template
ReactorRules.FluxCollectToImmutableList - Prefer
Flux#collect(Collector)withImmutableList#toImmutableList()over alternatives that do not explicitly return an immutable collection.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxCollectToImmutableSetRecipe
- Refaster template
ReactorRules.FluxCollectToImmutableSet - Prefer
Flux#collect(Collector)withImmutableSet#toImmutableSet()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxDefaultIfEmptyRecipe
- Refaster template
ReactorRules.FluxDefaultIfEmpty - Prefer
Flux#defaultIfEmpty(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxDeferredErrorRecipe
- Refaster template
ReactorRules.FluxDeferredError - Don't unnecessarily defer
Flux#error(Throwable).
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxDistinctSortRecipe
- Refaster template
ReactorRules.FluxDistinctSort - Apply
Flux#distinct()beforeFlux#sort()to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxDistinctSortWithComparatorRecipe
- Refaster template
ReactorRules.FluxDistinctSortWithComparator - Apply
Flux#distinct()beforeFlux#sort(Comparator)to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxDoOnErrorRecipe
- Refaster template
ReactorRules.FluxDoOnError - Prefer
Flux#doOnError(Class, Consumer)overFlux#doOnError(Predicate, Consumer)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxErrorSupplierRecipe
- Refaster template
ReactorRules.FluxErrorSupplier - Don't unnecessarily pass
Flux#error(Supplier)a method reference or lambda expression.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxFilterSortRecipe
- Refaster template
ReactorRules.FluxFilterSort - Apply
Flux#filter(Predicate)beforeFlux#sort()to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxFilterSortWithComparatorRecipe
- Refaster template
ReactorRules.FluxFilterSortWithComparator - Apply
Flux#filter(Predicate)beforeFlux#sort(Comparator)to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxFromIterableRecipe
- Refaster template
ReactorRules.FluxFromIterable - Prefer
Flux#fromIterable(Iterable)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxFromStreamSupplierRecipe
- Refaster template
ReactorRules.FluxFromStreamSupplier - Prefer
Flux#fromStream(Supplier)overFlux#fromStream(Stream), as the former yields aFluxthat is more likely to behave as expected when subscribed to more than once.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxJustRecipe
- Refaster template
ReactorRules.FluxJust - Prefer
Flux#just(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxMapNotNullOrElseRecipe
- Refaster template
ReactorRules.FluxMapNotNullOrElse - Prefer
Flux#mapNotNull(Function)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxNextRecipe
- Refaster template
ReactorRules.FluxNext - Prefer fluent
Flux#next()over less explicit alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxOfTypeRecipe
- Refaster template
ReactorRules.FluxOfType - Prefer
Flux#ofType(Class)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxOnErrorCompletePredicateRecipe
- Refaster template
ReactorRules.FluxOnErrorCompletePredicate - Prefer
Flux#onErrorComplete(Predicate)} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxOnErrorContinueRecipe
- Refaster template
ReactorRules.FluxOnErrorContinue - Prefer
Flux#onErrorContinue(Class, BiConsumer)overFlux#onErrorContinue(Predicate, BiConsumer)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxOnErrorMapRecipe
- Refaster template
ReactorRules.FluxOnErrorMap - Prefer
Flux#onErrorMap(Class, Function)overFlux#onErrorMap(Predicate, Function)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxOnErrorResumeRecipe
- Refaster template
ReactorRules.FluxOnErrorResume - Prefer
Flux#onErrorResume(Class, Function)overFlux#onErrorResume(Predicate, Function)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxOnErrorReturnRecipe
- Refaster template
ReactorRules.FluxOnErrorReturn - Prefer
Flux#onErrorReturn(Class, Object)overFlux#onErrorReturn(Predicate, Object)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxSortRecipe
- Refaster template
ReactorRules.FluxSort - Prefer
Flux#sort()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxSwitchIfEmptyOfEmptyPublisherRecipe
- Refaster template
ReactorRules.FluxSwitchIfEmptyOfEmptyPublisher - Don't unnecessarily pass an empty publisher to
Flux#switchIfEmpty(Publisher).
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxTakeRecipe
- Prefer
Flux#take(long)overFlux#take(long, boolean)where relevant - In Reactor versions prior to 3.5.0,
Flux#take(long)makes an unbounded request upstream, and is equivalent toFlux#take(long, false). From version 3.5.0 onwards, the behavior ofFlux#take(long)instead matchesFlux#take(long, true).
- Prefer
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxTakeWhileRecipe
- Refaster template
ReactorRules.FluxTakeWhile - Do not unnecessarily
Flux#filter(Predicate) filterthe result ofFlux#takeWhile(Predicate)using the samePredicate.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxThenEmptyRecipe
- Refaster template
ReactorRules.FluxThenEmpty - Avoid vacuous invocations of
Flux#ignoreElements().
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxThenManyRecipe
- Refaster template
ReactorRules.FluxThenMany - Avoid vacuous invocations of
Flux#ignoreElements().
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxThenMonoRecipe
- Refaster template
ReactorRules.FluxThenMono - Avoid vacuous invocations of
Flux#ignoreElements().
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxThenRecipe
- Refaster template
ReactorRules.FluxThen - Avoid vacuous invocations of
Flux#ignoreElements().
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxTimeoutFluxEmptyRecipe
- Refaster template
ReactorRules.FluxTimeoutFluxEmpty - Prefer
Flux#timeout(Duration, Publisher)over more contrived or less performant alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxTransformMaxRecipe
- Refaster template
ReactorRules.FluxTransformMax - Prefer
MathFlux#max(Publisher)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxTransformMaxWithComparatorRecipe
- Refaster template
ReactorRules.FluxTransformMaxWithComparator - Prefer
MathFlux#max(Publisher, Comparator)over less efficient or more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxTransformMinRecipe
- Refaster template
ReactorRules.FluxTransformMin - Prefer
MathFlux#min(Publisher)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxTransformMinWithComparatorRecipe
- Refaster template
ReactorRules.FluxTransformMinWithComparator - Prefer
MathFlux#min(Publisher, Comparator)over less efficient or more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxZipRecipe
- Refaster template
ReactorRules.FluxZip - Prefer
Flux#zip(Publisher, Publisher)over a chainedFlux#zipWith(Publisher), as the former better conveys that thePublishers may be subscribed to concurrently, and generalizes to combining three or more reactive streams.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxZipWithCombinatorRecipe
- Refaster template
ReactorRules.FluxZipWithCombinator - Prefer
Flux#zip(Publisher, Publisher)with a chained combinator over a chainedFlux#zipWith(Publisher, BiFunction), as the former better conveys that thePublishers may be subscribed to concurrently, and generalizes to combining three or more reactive streams.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxZipWithIterableBiFunctionRecipe
- Refaster template
ReactorRules.FluxZipWithIterableBiFunction - Prefer
Flux#zipWithIterable(Iterable, BiFunction)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxZipWithIterableMapFunctionRecipe
- Refaster template
ReactorRules.FluxZipWithIterableMapFunction - Prefer
Flux#zipWithIterable(Iterable)with a chained combinator overFlux#zipWithIterable(Iterable, BiFunction), as the former generally yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$FluxZipWithIterableRecipe
- Refaster template
ReactorRules.FluxZipWithIterable - Prefer
Flux#zipWithIterable(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MathFluxMaxRecipe
- Refaster template
ReactorRules.MathFluxMax - Prefer
MathFlux#max(Publisher)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MathFluxMinRecipe
- Refaster template
ReactorRules.MathFluxMin - Prefer
MathFlux#min(Publisher)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoDefaultIfEmptyRecipe
- Refaster template
ReactorRules.MonoDefaultIfEmpty - Prefer
Mono#defaultIfEmpty(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoDeferMonoJustOrEmptyRecipe
- Refaster template
ReactorRules.MonoDeferMonoJustOrEmpty - Prefer
Mono#defer(Supplier) deferringMono#justOrEmpty(Optional)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoDeferredErrorRecipe
- Refaster template
ReactorRules.MonoDeferredError - Don't unnecessarily defer
Mono#error(Throwable).
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoDoOnErrorRecipe
- Refaster template
ReactorRules.MonoDoOnError - Prefer
Mono#doOnError(Class, Consumer)overMono#doOnError(Predicate, Consumer)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoEmptyRecipe
- Refaster template
ReactorRules.MonoEmpty - Prefer
Mono#empty()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoErrorSupplierRecipe
- Refaster template
ReactorRules.MonoErrorSupplier - Don't unnecessarily pass
Mono#error(Supplier)a method reference or lambda expression.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoFlatMapIterableIdentityRecipe
- Refaster template
ReactorRules.MonoFlatMapIterableIdentity - Prefer
Mono#flatMapIterable(Function)to flatten aMonoof someIterableover less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoFluxRecipe
- Refaster template
ReactorRules.MonoFlux - Prefer
Mono#flux()} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoFromFutureAsyncLoadingCacheGetAllRecipe
- Refaster template
ReactorRules.MonoFromFutureAsyncLoadingCacheGetAll - Don't propagate
Monocancellations to upstream cache value computations, as completion of such computations may benefit concurrent or subsequent cache usages.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoFromFutureAsyncLoadingCacheGetRecipe
- Refaster template
ReactorRules.MonoFromFutureAsyncLoadingCacheGet - Don't propagate
Monocancellations to an upstream cache value computation, as completion of such computations may benefit concurrent or subsequent cache usages.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoFromFutureSupplierBooleanRecipe
- Refaster template
ReactorRules.MonoFromFutureSupplierBoolean - Prefer
Mono#fromFuture(Supplier, boolean)overMono#fromFuture(CompletableFuture, boolean), as the former may defer initiation of the asynchronous computation until subscription.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoFromFutureSupplierRecipe
- Refaster template
ReactorRules.MonoFromFutureSupplier - Prefer
Mono#fromFuture(Supplier)overMono#fromFuture(CompletableFuture), as the former may defer initiation of the asynchronous computation until subscription.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoFromOptionalSwitchIfEmptyRecipe
- Prefer a
Mono#justOrEmpty(Optional)andMono#switchIfEmpty(Mono)chain over more contrived alternatives - In particular, avoid mixing of the
OptionalandMonoAPIs.
- Prefer a
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoIdentityRecipe
- Refaster template
ReactorRules.MonoIdentity - Don't unnecessarily transform a
Monoto an equivalent instance.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoJustOrEmptyObjectRecipe
- Refaster template
ReactorRules.MonoJustOrEmptyObject - Prefer
Mono#justOrEmpty(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoJustOrEmptyOptionalRecipe
- Refaster template
ReactorRules.MonoJustOrEmptyOptional - Prefer
Mono#justOrEmpty(Optional)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoJustRecipe
- Refaster template
ReactorRules.MonoJust - Prefer
Mono#just(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOfTypeRecipe
- Refaster template
ReactorRules.MonoOfType - Prefer
Mono#ofType(Class)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOnErrorCompleteClassRecipe
- Refaster template
ReactorRules.MonoOnErrorCompleteClass - Prefer
Mono#onErrorComplete(Class)} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOnErrorCompletePredicateRecipe
- Refaster template
ReactorRules.MonoOnErrorCompletePredicate - Prefer
Mono#onErrorComplete(Predicate)} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOnErrorCompleteRecipe
- Refaster template
ReactorRules.MonoOnErrorComplete - Prefer
Mono#onErrorComplete()over more contrived alternatives, and don't chain it with redundant calls toMono#doOnError.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOnErrorContinueRecipe
- Refaster template
ReactorRules.MonoOnErrorContinue - Prefer
Mono#onErrorContinue(Class, BiConsumer)overMono#onErrorContinue(Predicate, BiConsumer)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOnErrorMapRecipe
- Refaster template
ReactorRules.MonoOnErrorMap - Prefer
Mono#onErrorMap(Class, Function)overMono#onErrorMap(Predicate, Function)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOnErrorResumeRecipe
- Refaster template
ReactorRules.MonoOnErrorResume - Prefer
Mono#onErrorResume(Class, Function)overMono#onErrorResume(Predicate, Function)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoOnErrorReturnRecipe
- Refaster template
ReactorRules.MonoOnErrorReturn - Prefer
Mono#onErrorReturn(Class, Object)overMono#onErrorReturn(Predicate, Object)where possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoSingleOptionalRecipe
- Refaster template
ReactorRules.MonoSingleOptional - Prefer
Mono#singleOptional()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoSingleRecipe
- Refaster template
ReactorRules.MonoSingle - Don't unnecessarily transform a
Monoto aFluxto expect exactly one item.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenEmptyRecipe
- Refaster template
ReactorRules.MonoThenEmpty - Avoid vacuous invocations of
Mono#ignoreElement().
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenManyRecipe
- Refaster template
ReactorRules.MonoThenMany - Avoid vacuous operations prior to invocation of
Mono#thenMany(Publisher).
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenMonoFluxRecipe
- Refaster template
ReactorRules.MonoThenMonoFlux - Prefer explicit invocation of
Mono#flux()over implicit conversions fromMonotoFlux.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenMonoRecipe
- Refaster template
ReactorRules.MonoThenMono - Avoid vacuous operations prior to invocation of
Mono#then(Mono).
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenRecipe
- Refaster template
ReactorRules.MonoThen - Prefer direct invocation of
Mono#then()} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoThenReturnRecipe
- Refaster template
ReactorRules.MonoThenReturn - Prefer
Mono#thenReturn(Object)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoTimeoutDurationMonoEmptyRecipe
- Refaster template
ReactorRules.MonoTimeoutDurationMonoEmpty - Prefer
Mono#timeout(Duration, Mono)over more contrived or less performant alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoTimeoutDurationMonoJustRecipe
- Refaster template
ReactorRules.MonoTimeoutDurationMonoJust - Prefer
Mono#timeout(Duration, Mono)over more contrived or less performant alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoTimeoutDurationRecipe
- Refaster template
ReactorRules.MonoTimeoutDuration - Prefer
Mono#timeout(Duration, Mono)over more contrived or less performant alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoTimeoutPublisherMonoEmptyRecipe
- Refaster template
ReactorRules.MonoTimeoutPublisherMonoEmpty - Prefer
Mono#timeout(Publisher, Mono)over more contrived or less performant alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoTimeoutPublisherMonoJustRecipe
- Refaster template
ReactorRules.MonoTimeoutPublisherMonoJust - Prefer
Mono#timeout(Publisher, Mono)over more contrived or less performant alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoTimeoutPublisherRecipe
- Refaster template
ReactorRules.MonoTimeoutPublisher - Prefer
Mono#timeout(Publisher, Mono)over more contrived or less performant alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoZipRecipe
- Refaster template
ReactorRules.MonoZip - Prefer
Mono#zip(Mono, Mono)over a chainedMono#zipWith(Mono), as the former better conveys that theMonos may be subscribed to concurrently, and generalizes to combining three or more reactive streams.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$MonoZipWithCombinatorRecipe
- Refaster template
ReactorRules.MonoZipWithCombinator - Prefer
Mono#zip(Mono, Mono)with a chained combinator over a chainedMono#zipWith(Mono, BiFunction), as the former better conveys that theMonos may be subscribed to concurrently, and generalizes to combining three or more reactive streams.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$OptionalMapMonoJustRecipe
- Refaster template
ReactorRules.OptionalMapMonoJust - Try to avoid expressions of type
Optional<Mono<T>>, but if you must map anOptionalto this type, prefer usingMono#just(Object).
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$PublisherProbeAssertWasCancelledRecipe
- Refaster template
ReactorRules.PublisherProbeAssertWasCancelled - Prefer
PublisherProbe#assertWasCancelled()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$PublisherProbeAssertWasNotCancelledRecipe
- Refaster template
ReactorRules.PublisherProbeAssertWasNotCancelled - Prefer
PublisherProbe#assertWasNotCancelled()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$PublisherProbeAssertWasNotRequestedRecipe
- Refaster template
ReactorRules.PublisherProbeAssertWasNotRequested - Prefer
PublisherProbe#assertWasNotRequested()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$PublisherProbeAssertWasNotSubscribedRecipe
- Refaster template
ReactorRules.PublisherProbeAssertWasNotSubscribed - Prefer
PublisherProbe#assertWasNotSubscribed()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$PublisherProbeAssertWasRequestedRecipe
- Refaster template
ReactorRules.PublisherProbeAssertWasRequested - Prefer
PublisherProbe#assertWasRequested()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$PublisherProbeAssertWasSubscribedRecipe
- Refaster template
ReactorRules.PublisherProbeAssertWasSubscribed - Prefer
PublisherProbe#assertWasSubscribed()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$PublisherProbeEmptyRecipe
- Refaster template
ReactorRules.PublisherProbeEmpty - Prefer
PublisherProbe#empty()} over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierFromFluxRecipe
- Refaster template
ReactorRules.StepVerifierFromFlux - Prefer
Flux#as(Function)when creating aStepVerifier.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierFromMonoRecipe
- Refaster template
ReactorRules.StepVerifierFromMono - Prefer
Mono#as(Function)when creating aStepVerifier.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyCompleteRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyComplete - Prefer
StepVerifier.LastStep#verifyComplete()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyErrorClassRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyErrorClass - Prefer
StepVerifier.LastStep#verifyError(Class)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyErrorMatchesRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyErrorMatches - Prefer
StepVerifier.LastStep#verifyErrorMatches(Predicate)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyErrorMessageRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyErrorMessage - Prefer
StepVerifier.LastStep#verifyErrorMessage(String)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyErrorRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyError - Prefer
StepVerifier.LastStep#verifyError()over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyErrorSatisfiesAssertJRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyErrorSatisfiesAssertJ - Prefer
StepVerifier.LastStep#verifyErrorSatisfies(Consumer)with AssertJ over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyErrorSatisfiesRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyErrorSatisfies - Prefer
StepVerifier.LastStep#verifyErrorSatisfies(Consumer)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierLastStepVerifyTimeoutRecipe
- Refaster template
ReactorRules.StepVerifierLastStepVerifyTimeout - Prefer
StepVerifier.LastStep#verifyTimeout(Duration)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierStepExpectNextRecipe
- Refaster template
ReactorRules.StepVerifierStepExpectNext - Prefer
StepVerifier.Step#expectNext(Object)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierVerifyDurationRecipe
- Refaster template
ReactorRules.StepVerifierVerifyDuration - Prefer
StepVerifier#verify(Duration)over a danglingStepVerifier#verifyThenAssertThat(Duration).
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierVerifyLaterRecipe
- Refaster template
ReactorRules.StepVerifierVerifyLater - Don't unnecessarily invoke
StepVerifier#verifyLater()multiple times.
- Refaster template
- tech.picnic.errorprone.refasterrules.ReactorRulesRecipes$StepVerifierVerifyRecipe
- Refaster template
ReactorRules.StepVerifierVerify - Prefer
StepVerifier#verify()over a danglingStepVerifier#verifyThenAssertThat().
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes
RxJava2AdapterRulesRefaster recipes- Refaster rules related to expressions dealing with
RxJava2Adapter. Source.
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$CompletableToMonoRecipe
- Refaster template
RxJava2AdapterRules.CompletableToMono - Use the fluent API style when using
RxJava2Adapter#completableToMono.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$FlowableToFluxRecipe
- Refaster template
RxJava2AdapterRules.FlowableToFlux - Use
RxJava2Adapter#flowableToFluxto convert aFlowableto aFlux, and do so using the fluent API style.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$FluxToFlowableRecipe
- Refaster template
RxJava2AdapterRules.FluxToFlowable - Use
RxJava2Adapter#fluxToFlowableto convert aFluxto aFlowable, and do so using the fluent API style.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$FluxToObservableRecipe
- Refaster template
RxJava2AdapterRules.FluxToObservable - Use
RxJava2Adapter#fluxToObservableto convert aFluxto aObservable, and do so using the fluent API style.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$MaybeToMonoRecipe
- Refaster template
RxJava2AdapterRules.MaybeToMono - Use the fluent API style when using
RxJava2Adapter#maybeToMono.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$MonoToCompletableRecipe
- Refaster template
RxJava2AdapterRules.MonoToCompletable - Use
RxJava2Adapter#monoToCompletableto convert aMonoto aCompletable, and do so using the fluent API style.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$MonoToFlowableRecipe
- Refaster template
RxJava2AdapterRules.MonoToFlowable - Use
RxJava2Adapter#monoToFlowableto convert aMonoto aFlowable, and do so using the fluent API style.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$MonoToMaybeRecipe
- Refaster template
RxJava2AdapterRules.MonoToMaybe - Use the fluent API style when using
RxJava2Adapter#monoToMaybe.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$MonoToSingleRecipe
- Refaster template
RxJava2AdapterRules.MonoToSingle - Use
RxJava2Adapter#monoToSingleto convert aMonoto aSingle, and do so using the fluent API style.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$ObservableToFluxRecipe
- Refaster template
RxJava2AdapterRules.ObservableToFlux - Use the fluent API style when using
RxJava2Adapter#observableToFlux.
- Refaster template
- tech.picnic.errorprone.refasterrules.RxJava2AdapterRulesRecipes$SingleToMonoRecipe
- Refaster template
RxJava2AdapterRules.SingleToMono - Use the fluent API style when using
RxJava2Adapter#singleToMono.
- Refaster template
- tech.picnic.errorprone.refasterrules.SpringTestRulesRecipes
SpringTestRulesRefaster recipes- Refaster rules related to Spring Test expressions and statements. Source.
- tech.picnic.errorprone.refasterrules.SpringTestRulesRecipes$BodyContentSpecJsonLenientRecipe
- Refaster template
SpringTestRules.BodyContentSpecJsonLenient - Prefer
BodyContentSpec#json(String, JsonCompareMode)over alternatives that implicitly perform aJsonCompareMode#LENIENT lenientcomparison or are deprecated.
- Refaster template
- tech.picnic.errorprone.refasterrules.SpringTestRulesRecipes$BodyContentSpecJsonStrictRecipe
- Refaster template
SpringTestRules.BodyContentSpecJsonStrict - Prefer
BodyContentSpec#json(String, JsonCompareMode)over the deprecated alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes
StreamRulesRefaster recipes- Refaster rules related to expressions dealing with
Streams. Source.
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$CollectionParallelStreamRecipe
- Refaster template
StreamRules.CollectionParallelStream - Prefer
Collection#parallelStream()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$ConcatOneStreamRecipe
- Refaster template
StreamRules.ConcatOneStream - Don't unnecessarily call
Streams#concat(Stream...).
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$ConcatTwoStreamsRecipe
- Refaster template
StreamRules.ConcatTwoStreams - Prefer
Stream#concat(Stream, Stream)over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$JoiningRecipe
- Refaster template
StreamRules.Joining - Prefer
Collectors#joining()overCollectors#joining(CharSequence)with an empty delimiter string.
- Refaster template
- 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(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamDistinctSortedRecipe
- Refaster template
StreamRules.StreamDistinctSorted - Apply
Stream#distinct()beforeStream#sorted()to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamDistinctSortedWithComparatorRecipe
- Refaster template
StreamRules.StreamDistinctSortedWithComparator - Apply
Stream#distinct()beforeStream#sorted(Comparator)to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFilterCollectRecipe
- Refaster template
StreamRules.StreamFilterCollect - Recipe created for the following Refaster template:
java static final class StreamFilterCollect<T, R> { @BeforeTemplate R before(Stream<T> stream, Predicate<? super T> predicate, Collector<? super T, ?, R> collector) { return stream.collect(filtering(predicate, collector)); } @AfterTemplate R after(Stream<T> stream, Predicate<? super T> predicate, Collector<? super T, ?, R> collector) { return stream.filter(predicate).collect(collector); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFilterSortedRecipe
- Refaster template
StreamRules.StreamFilterSorted - Apply
Stream#filter(Predicate)beforeStream#sorted()to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFilterSortedWithComparatorRecipe
- Refaster template
StreamRules.StreamFilterSortedWithComparator - Apply
Stream#filter(Predicate)beforeStream#sorted(Comparator)to reduce the number of elements to sort.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFindAnyIsEmptyRecipe
- Refaster template
StreamRules.StreamFindAnyIsEmpty - In order to test whether a stream has any element, simply try to find one.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFindAnyIsPresentRecipe
- Refaster template
StreamRules.StreamFindAnyIsPresent - Prefer
Stream#findAny()overStream#findFirst()if one only cares whether the stream is nonempty.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFlatMapCollectRecipe
- Refaster template
StreamRules.StreamFlatMapCollect - Recipe created for the following Refaster template:
java static final class StreamFlatMapCollect<T, U, R> { @BeforeTemplate R before(Stream<T> stream, Function<? super T, ? extends Stream<? extends U>> mapper, Collector<? super U, ?, R> collector) { return stream.collect(flatMapping(mapper, collector)); } @AfterTemplate R after(Stream<T> stream, Function<? super T, ? extends Stream<? extends U>> mapper, Collector<? super U, ?, R> collector) { return stream.flatMap(mapper).collect(collector); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamIterateRecipe
- Refaster template
StreamRules.StreamIterate - Prefer
Stream#iterate(Object, Predicate, UnaryOperator)over more contrived alternatives.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMapFilterRecipe
- Refaster template
StreamRules.StreamMapFilter - Prefer an unconditional
Map#get(Object)call followed by anullcheck over a call toMap#containsKey(Object), as the former avoids a second lookup operation.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMapFirstRecipe
- Refaster template
StreamRules.StreamMapFirst - Where possible, clarify that a mapping operation will be applied only to a single stream element.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMapToDoubleSummaryStatisticsRecipe
- Refaster template
StreamRules.StreamMapToDoubleSummaryStatistics - Recipe created for the following Refaster template:
java static final class StreamMapToDoubleSummaryStatistics<T> { @BeforeTemplate DoubleSummaryStatistics before(Stream<T> stream, ToDoubleFunction<T> mapper) { return stream.collect(summarizingDouble(mapper)); } @AfterTemplate DoubleSummaryStatistics after(Stream<T> stream, ToDoubleFunction<T> mapper) { return stream.mapToDouble(mapper).summaryStatistics(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMapToIntSummaryStatisticsRecipe
- Refaster template
StreamRules.StreamMapToIntSummaryStatistics - Recipe created for the following Refaster template:
java static final class StreamMapToIntSummaryStatistics<T> { @BeforeTemplate IntSummaryStatistics before(Stream<T> stream, ToIntFunction<T> mapper) { return stream.collect(summarizingInt(mapper)); } @AfterTemplate IntSummaryStatistics after(Stream<T> stream, ToIntFunction<T> mapper) { return stream.mapToInt(mapper).summaryStatistics(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMapToLongSummaryStatisticsRecipe
- Refaster template
StreamRules.StreamMapToLongSummaryStatistics - Recipe created for the following Refaster template:
java static final class StreamMapToLongSummaryStatistics<T> { @BeforeTemplate LongSummaryStatistics before(Stream<T> stream, ToLongFunction<T> mapper) { return stream.collect(summarizingLong(mapper)); } @AfterTemplate LongSummaryStatistics after(Stream<T> stream, ToLongFunction<T> mapper) { return stream.mapToLong(mapper).summaryStatistics(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMaxNaturalOrderRecipe
- Refaster template
StreamRules.StreamMaxNaturalOrder - Recipe created for the following Refaster template:
java static final class StreamMaxNaturalOrder<T extends Comparable<? super T>> { @BeforeTemplate Optional<T> before(Stream<T> stream) { return Refaster.anyOf(stream.min(reverseOrder()), Streams.findLast(stream.sorted())); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) Optional<T> after(Stream<T> stream) { return stream.max(naturalOrder()); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMinNaturalOrderRecipe
- Refaster template
StreamRules.StreamMinNaturalOrder - Recipe created for the following Refaster template:
java static final class StreamMinNaturalOrder<T extends Comparable<? super T>> { @BeforeTemplate Optional<T> before(Stream<T> stream) { return Refaster.anyOf(stream.max(reverseOrder()), stream.sorted().findFirst()); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) Optional<T> after(Stream<T> stream) { return stream.min(naturalOrder()); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOf1Recipe
- Refaster template
StreamRules.StreamOf1 - Prefer
Stream#of(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOf2Recipe
- Refaster template
StreamRules.StreamOf2 - Prefer
Stream#of(Object[])over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOf3Recipe
- Refaster template
StreamRules.StreamOf3 - Prefer
Stream#of(Object[])over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOf4Recipe
- Refaster template
StreamRules.StreamOf4 - Prefer
Stream#of(Object[])over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOf5Recipe
- Refaster template
StreamRules.StreamOf5 - Prefer
Stream#of(Object[])over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOfNullableRecipe
- Refaster template
StreamRules.StreamOfNullable - Prefer
Stream#ofNullable(Object)over more contrived alternatives.
- Refaster template
- 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); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamTakeWhileRecipe
- Refaster template
StreamRules.StreamTakeWhile - Recipe created for the following Refaster template:
java static final class StreamTakeWhile<T> { @BeforeTemplate Stream<T> before(Stream<T> stream, Predicate<? super T> predicate) { return stream.takeWhile(predicate).filter(predicate); } @AfterTemplate Stream<T> after(Stream<T> stream, Predicate<? super T> predicate) { return stream.takeWhile(predicate); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamsStreamRecipe
- Refaster template
StreamRules.StreamsStream - Prefer
Streams#stream(Iterable)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes
StringRulesRefaster recipes- Refaster rules related to expressions dealing with
Strings. Source.
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$EmptyStringRecipe
- Refaster template
StringRules.EmptyString - Avoid unnecessary creation of new empty
Stringobjects; use the empty string literal instead.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$FilterEmptyStringRecipe
- Refaster template
StringRules.FilterEmptyString - Recipe created for the following Refaster template:
java static final class FilterEmptyString { @BeforeTemplate Optional<String> before(Optional<String> optional) { return optional.map(Strings::emptyToNull); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) Optional<String> after(Optional<String> optional) { return optional.filter(not(String::isEmpty)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$JoinStringsRecipe
- Refaster template
StringRules.JoinStrings - Prefer
String#join(CharSequence, Iterable)and variants over the Guava alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$NewStringFromCharArrayRecipe
- Refaster template
StringRules.NewStringFromCharArray - Prefer direct invocation of
String#String(char[])over the indirection introduced by alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$NewStringFromCharArraySubSequenceRecipe
- Refaster template
StringRules.NewStringFromCharArraySubSequence - Prefer direct invocation of
String#String(char[], int, int)over the indirection introduced by alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$OptionalNonEmptyStringRecipe
- Refaster template
StringRules.OptionalNonEmptyString - Don't use the ternary operator to create an optionally-absent string.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIdentityRecipe
- Refaster template
StringRules.StringIdentity - Avoid unnecessary creation of new
Stringobjects.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfCharBetweenIndicesRecipe
- Refaster template
StringRules.StringIndexOfCharBetweenIndices - Prefer
String#indexOf(int, int, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfCharFromIndexRecipe
- Refaster template
StringRules.StringIndexOfCharFromIndex - Prefer
String#indexOf(int, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfStringBetweenIndicesRecipe
- Refaster template
StringRules.StringIndexOfStringBetweenIndices - Prefer
String#indexOf(String, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIndexOfStringFromIndexRecipe
- Refaster template
StringRules.StringIndexOfStringFromIndex - Prefer
String#indexOf(String, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIsBlankRecipe
- Refaster template
StringRules.StringIsBlank - Prefer
String#isBlank()over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIsEmptyPredicateRecipe
- Refaster template
StringRules.StringIsEmptyPredicate - Prefer a method reference to
String#isEmpty()over the equivalent lambda function.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIsEmptyRecipe
- Refaster template
StringRules.StringIsEmpty - Prefer
String#isEmpty()over alternatives that consult the string's length.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIsNotEmptyPredicateRecipe
- Refaster template
StringRules.StringIsNotEmptyPredicate - Prefer a method reference to
String#isEmpty()over the equivalent lambda function.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringIsNullOrEmptyRecipe
- Refaster template
StringRules.StringIsNullOrEmpty - Prefer
Strings#isNullOrEmpty(String)over the more verbose alternative.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfCharRecipe
- Refaster template
StringRules.StringLastIndexOfChar - Prefer
String#lastIndexOf(int, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfCharWithIndexRecipe
- Refaster template
StringRules.StringLastIndexOfCharWithIndex - Prefer
String#lastIndexOf(int, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfStringRecipe
- Refaster template
StringRules.StringLastIndexOfString - Prefer
String#lastIndexOf(String, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringLastIndexOfStringWithIndexRecipe
- Refaster template
StringRules.StringLastIndexOfStringWithIndex - Prefer
String#lastIndexOf(String, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringStartsWithRecipe
- Refaster template
StringRules.StringStartsWith - Prefer
String#startsWith(String, int)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringValueOfMethodReferenceRecipe
- Refaster template
StringRules.StringValueOfMethodReference - Prefer direct delegation to
String#valueOf(Object)over the indirection introduced byObjects#toString(Object).
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$StringValueOfRecipe
- Refaster template
StringRules.StringValueOf - Prefer direct invocation of
String#valueOf(Object)over the indirection introduced byObjects#toString(Object).
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$SubstringRemainderRecipe
- Refaster template
StringRules.SubstringRemainder - Don't unnecessarily use the two-argument
String#substring(int, int).
- Refaster template
- tech.picnic.errorprone.refasterrules.StringRulesRecipes$Utf8EncodedLengthRecipe
- Refaster template
StringRules.Utf8EncodedLength - Prefer
Utf8#encodedLength(CharSequence)over less efficient alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes
SuggestedFixRulesRefaster recipes- Refaster rules related to expressions dealing with
SuggestedFixes. Source.
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixDeleteRecipe
- Refaster template
SuggestedFixRules.SuggestedFixDelete - Prefer
SuggestedFix#delete(Tree)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixPostfixWithRecipe
- Refaster template
SuggestedFixRules.SuggestedFixPostfixWith - Prefer
SuggestedFix#postfixWith(Tree, String)} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixPrefixWithRecipe
- Refaster template
SuggestedFixRules.SuggestedFixPrefixWith - Prefer
SuggestedFix#prefixWith(Tree, String)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixReplaceStartEndRecipe
- Refaster template
SuggestedFixRules.SuggestedFixReplaceStartEnd - Prefer
SuggestedFix#replace(int, int, String)} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixReplaceTreeRecipe
- Refaster template
SuggestedFixRules.SuggestedFixReplaceTree - Prefer
SuggestedFix#replace(Tree, String)} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixReplaceTreeStartEndRecipe
- Refaster template
SuggestedFixRules.SuggestedFixReplaceTreeStartEnd - Prefer
SuggestedFix#replace(Tree, String, int, int)} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixSwapRecipe
- Refaster template
SuggestedFixRules.SuggestedFixSwap - Prefer
SuggestedFix#swap(Tree, Tree, VisitorState)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes$SuggestedFixToBuilderRecipe
- Refaster template
SuggestedFixRules.SuggestedFixToBuilder - Prefer
SuggestedFix#toBuilder()} over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes
- Refaster rules that replace TestNG assertions with equivalent AssertJ assertions
- Some of the classes below have TestNG
@BeforeTemplates that reference wildcard type bounds (<?>), while the associated AssertJ@AfterTemplates reference stricter type bounds. This introduces the risk of producing invalid code. We do this anyway, because TestNG's wildcard types can cause javac to infer less specific types than AssertJ requires, while the appropriate (more specific) types will be inferred properly when plugged into AssertJ's API. The following is an example of a TestNG statement, which would not be rewritten if it weren't for the wildcard matching (note that the type parameters of the map on the right-hand side will be inferred to be<Object, Object>rather than<String, Object>).java List<Map<String, Object>> myMaps = new ArrayList<>(); assertEquals(myMaps, ImmutableList.of(ImmutableMap.of()));. Source.
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualArrayIterationOrderRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualArrayIterationOrder - Recipe created for the following Refaster template:
java static final class AssertEqualArrayIterationOrder { @BeforeTemplate void before(boolean[] actual, boolean[] 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(short[] actual, short[] expected) { assertEquals(actual, expected); } @BeforeTemplate void before(int[] actual, int[] 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(double[] actual, double[] expected) { assertEquals(actual, expected); } @BeforeTemplate void before(Object[] actual, Object[] expected) { assertEquals(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object[] actual, Object[] expected) { assertThat(actual).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualArrayIterationOrderWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualArrayIterationOrderWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualArrayIterationOrderWithMessage { @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(char[] actual, String message, char[] 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(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(double[] actual, String message, double[] expected) { assertEquals(actual, expected, message); } @BeforeTemplate void before(Object[] actual, String message, Object[] expected) { assertEquals(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object[] actual, String message, Object[] expected) { assertThat(actual).withFailMessage(message).containsExactly(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualArraysIrrespectiveOfOrderRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualArraysIrrespectiveOfOrder - Recipe created for the following Refaster template:
java static final class AssertEqualArraysIrrespectiveOfOrder { @BeforeTemplate void before(Object[] actual, Object[] expected) { assertEqualsNoOrder(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object[] actual, Object[] expected) { assertThat(actual).containsExactlyInAnyOrder(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualArraysIrrespectiveOfOrderWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualArraysIrrespectiveOfOrderWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualArraysIrrespectiveOfOrderWithMessage { @BeforeTemplate void before(Object[] actual, String message, Object[] expected) { assertEqualsNoOrder(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object[] actual, String message, Object[] expected) { assertThat(actual).withFailMessage(message).containsExactlyInAnyOrder(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualDoubleArraysWithDeltaRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualDoubleArraysWithDelta - Recipe created for the following Refaster template:
java static final class AssertEqualDoubleArraysWithDelta { @BeforeTemplate void before(double[] actual, double[] expected, double delta) { assertEquals(actual, expected, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, double[] expected, double delta) { assertThat(actual).containsExactly(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualDoubleArraysWithDeltaWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualDoubleArraysWithDeltaWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualDoubleArraysWithDeltaWithMessage { @BeforeTemplate void before(double[] actual, String message, double[] expected, double delta) { assertEquals(actual, expected, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double[] actual, String message, double[] expected, double delta) { assertThat(actual).withFailMessage(message).containsExactly(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualDoublesWithDeltaRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualDoublesWithDelta - Recipe created for the following Refaster template:
java static final class AssertEqualDoublesWithDelta { @BeforeTemplate void before(double actual, double expected, double delta) { assertEquals(actual, expected, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double actual, double expected, double delta) { assertThat(actual).isCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualDoublesWithDeltaWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualDoublesWithDeltaWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualDoublesWithDeltaWithMessage { @BeforeTemplate void before(double actual, String message, double expected, double delta) { assertEquals(actual, expected, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double actual, String message, double expected, double delta) { assertThat(actual).withFailMessage(message).isCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualFloatArraysWithDeltaRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualFloatArraysWithDelta - Recipe created for the following Refaster template:
java static final class AssertEqualFloatArraysWithDelta { @BeforeTemplate void before(float[] actual, float[] expected, float delta) { assertEquals(actual, expected, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, float[] expected, float delta) { assertThat(actual).containsExactly(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualFloatArraysWithDeltaWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualFloatArraysWithDeltaWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualFloatArraysWithDeltaWithMessage { @BeforeTemplate void before(float[] actual, String message, float[] expected, float delta) { assertEquals(actual, expected, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float[] actual, String message, float[] expected, float delta) { assertThat(actual).withFailMessage(message).containsExactly(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualFloatsWithDeltaRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualFloatsWithDelta - Recipe created for the following Refaster template:
java static final class AssertEqualFloatsWithDelta { @BeforeTemplate void before(float actual, float expected, float delta) { assertEquals(actual, expected, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Float actual, float expected, float delta) { assertThat(actual).isCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualFloatsWithDeltaWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualFloatsWithDeltaWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualFloatsWithDeltaWithMessage { @BeforeTemplate void before(float actual, String message, float expected, float delta) { assertEquals(actual, expected, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float actual, String message, float expected, float delta) { assertThat(actual).withFailMessage(message).isCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualIterableIterationOrderRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualIterableIterationOrder - Recipe created for the following Refaster template:
java static final class AssertEqualIterableIterationOrder<S, T extends S> { @BeforeTemplate void before(Iterable<S> actual, Iterable<T> expected) { assertEquals(actual, expected); } @BeforeTemplate void before(Collection<S> actual, Collection<T> expected) { assertEquals(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Iterable<S> actual, Iterable<T> expected) { assertThat(actual).containsExactlyElementsOf(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualIterableIterationOrderWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualIterableIterationOrderWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualIterableIterationOrderWithMessage<S, T extends S> { @BeforeTemplate void before(Iterable<S> actual, String message, Iterable<T> expected) { assertEquals(actual, expected, message); } @BeforeTemplate void before(Collection<S> actual, String message, Collection<T> expected) { assertEquals(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Iterable<S> actual, String message, Iterable<T> expected) { assertThat(actual).withFailMessage(message).containsExactlyElementsOf(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualIteratorIterationOrderRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualIteratorIterationOrder - Recipe created for the following Refaster template:
java static final class AssertEqualIteratorIterationOrder<S, T extends S> { @BeforeTemplate void before(Iterator<S> actual, Iterator<T> expected) { assertEquals(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Iterator<S> actual, Iterator<T> expected) { assertThat(actual).toIterable().containsExactlyElementsOf(ImmutableList.copyOf(expected)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualIteratorIterationOrderWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualIteratorIterationOrderWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualIteratorIterationOrderWithMessage<S, T extends S> { @BeforeTemplate void before(Iterator<S> actual, String message, Iterator<T> expected) { assertEquals(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Iterator<S> actual, String message, Iterator<T> expected) { assertThat(actual).toIterable().withFailMessage(message).containsExactlyElementsOf(ImmutableList.copyOf(expected)); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualSetsRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualSets - Recipe created for the following Refaster template:
java static final class AssertEqualSets<S, T extends S> { @BeforeTemplate void before(Set<S> actual, Set<T> expected) { assertEquals(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Set<S> actual, Set<T> expected) { assertThat(actual).hasSameElementsAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertEqualSetsWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertEqualSetsWithMessage - Recipe created for the following Refaster template:
java static final class AssertEqualSetsWithMessage<S, T extends S> { @BeforeTemplate void before(Set<S> actual, String message, Set<T> expected) { assertEquals(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Set<S> actual, String message, Set<T> expected) { assertThat(actual).withFailMessage(message).hasSameElementsAs(expected); } }.
- Refaster template
- 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); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertFalseRecipe
- Refaster template
TestNGToAssertJRules.AssertFalse - Recipe created for the following Refaster template:
java static final class AssertFalse { @BeforeTemplate void before(boolean condition) { assertFalse(condition); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean condition) { assertThat(condition).isFalse(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertFalseWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertFalseWithMessage - Recipe created for the following Refaster template:
java static final class AssertFalseWithMessage { @BeforeTemplate void before(boolean condition, String message) { assertFalse(condition, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean condition, String message) { assertThat(condition).withFailMessage(message).isFalse(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertNotNullRecipe
- Refaster template
TestNGToAssertJRules.AssertNotNull - Recipe created for the following Refaster template:
java static final class AssertNotNull { @BeforeTemplate void before(Object object) { assertNotNull(object); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object object) { assertThat(object).isNotNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertNotNullWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertNotNullWithMessage - Recipe created for the following Refaster template:
java static final class AssertNotNullWithMessage { @BeforeTemplate void before(Object object, String message) { assertNotNull(object, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object object, String message) { assertThat(object).withFailMessage(message).isNotNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertNotSameRecipe
- Refaster template
TestNGToAssertJRules.AssertNotSame - Recipe created for the following Refaster template:
java static final class AssertNotSame { @BeforeTemplate void before(Object actual, Object expected) { assertNotSame(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Object expected) { assertThat(actual).isNotSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertNotSameWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertNotSameWithMessage - Recipe created for the following Refaster template:
java static final class AssertNotSameWithMessage { @BeforeTemplate void before(Object actual, String message, Object expected) { assertNotSame(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message, Object expected) { assertThat(actual).withFailMessage(message).isNotSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertNullRecipe
- Refaster template
TestNGToAssertJRules.AssertNull - Recipe created for the following Refaster template:
java static final class AssertNull { @BeforeTemplate void before(Object object) { assertNull(object); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object object) { assertThat(object).isNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertNullWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertNullWithMessage - Recipe created for the following Refaster template:
java static final class AssertNullWithMessage { @BeforeTemplate void before(Object object, String message) { assertNull(object, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object object, String message) { assertThat(object).withFailMessage(message).isNull(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertSameRecipe
- Refaster template
TestNGToAssertJRules.AssertSame - Recipe created for the following Refaster template:
java static final class AssertSame { @BeforeTemplate void before(Object actual, Object expected) { assertSame(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Object expected) { assertThat(actual).isSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertSameWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertSameWithMessage - Recipe created for the following Refaster template:
java static final class AssertSameWithMessage { @BeforeTemplate void before(Object actual, String message, Object expected) { assertSame(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message, Object expected) { assertThat(actual).withFailMessage(message).isSameAs(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertThrowsRecipe
- Refaster template
TestNGToAssertJRules.AssertThrows - Recipe created for the following Refaster template:
java static final class AssertThrows { @BeforeTemplate void before(ThrowingRunnable runnable) { assertThrows(runnable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable runnable) { assertThatThrownBy(runnable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertThrowsWithTypeRecipe
- Refaster template
TestNGToAssertJRules.AssertThrowsWithType - Recipe created for the following Refaster template:
java static final class AssertThrowsWithType<T extends Throwable> { @BeforeTemplate void before(ThrowingRunnable runnable, Class<T> clazz) { assertThrows(clazz, runnable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(ThrowingCallable runnable, Class<T> clazz) { assertThatThrownBy(runnable).isInstanceOf(clazz); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertTrueRecipe
- Refaster template
TestNGToAssertJRules.AssertTrue - Recipe created for the following Refaster template:
java static final class AssertTrue { @BeforeTemplate void before(boolean condition) { assertTrue(condition); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean condition) { assertThat(condition).isTrue(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertTrueWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertTrueWithMessage - Recipe created for the following Refaster template:
java static final class AssertTrueWithMessage { @BeforeTemplate void before(boolean condition, String message) { assertTrue(condition, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(boolean condition, String message) { assertThat(condition).withFailMessage(message).isTrue(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertUnequalDoublesWithDeltaRecipe
- Refaster template
TestNGToAssertJRules.AssertUnequalDoublesWithDelta - Recipe created for the following Refaster template:
java static final class AssertUnequalDoublesWithDelta { @BeforeTemplate void before(double actual, double expected, double delta) { assertNotEquals(actual, expected, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double actual, double expected, double delta) { assertThat(actual).isNotCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertUnequalDoublesWithDeltaWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertUnequalDoublesWithDeltaWithMessage - Recipe created for the following Refaster template:
java static final class AssertUnequalDoublesWithDeltaWithMessage { @BeforeTemplate void before(double actual, String message, double expected, double delta) { assertNotEquals(actual, expected, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(double actual, String message, double expected, double delta) { assertThat(actual).withFailMessage(message).isNotCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertUnequalFloatsWithDeltaRecipe
- Refaster template
TestNGToAssertJRules.AssertUnequalFloatsWithDelta - Recipe created for the following Refaster template:
java static final class AssertUnequalFloatsWithDelta { @BeforeTemplate void before(float actual, float expected, float delta) { assertNotEquals(actual, expected, delta); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float actual, float expected, float delta) { assertThat(actual).isNotCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertUnequalFloatsWithDeltaWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertUnequalFloatsWithDeltaWithMessage - Recipe created for the following Refaster template:
java static final class AssertUnequalFloatsWithDeltaWithMessage { @BeforeTemplate void before(float actual, String message, float expected, float delta) { assertNotEquals(actual, expected, delta, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(float actual, String message, float expected, float delta) { assertThat(actual).withFailMessage(message).isNotCloseTo(expected, offset(delta)); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertUnequalRecipe
- Refaster template
TestNGToAssertJRules.AssertUnequal - Recipe created for the following Refaster template:
java static final class AssertUnequal { @BeforeTemplate void before(boolean actual, boolean expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(byte actual, byte expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(char actual, char expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(short actual, short expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(int actual, int expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(long actual, long expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(float actual, float expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(double actual, double expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(Object actual, Object expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(String actual, String expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(Set<?> actual, Set<?> expected) { assertNotEquals(actual, expected); } @BeforeTemplate void before(Map<?, ?> actual, Map<?, ?> expected) { assertNotEquals(actual, expected); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, Object expected) { assertThat(actual).isNotEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$AssertUnequalWithMessageRecipe
- Refaster template
TestNGToAssertJRules.AssertUnequalWithMessage - Recipe created for the following Refaster template:
java static final class AssertUnequalWithMessage { @BeforeTemplate void before(boolean actual, String message, boolean expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(byte actual, String message, byte expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(char actual, String message, char expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(short actual, String message, short expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(int actual, String message, int expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(long actual, String message, long expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(float actual, String message, float expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(double actual, String message, double expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(Object actual, String message, Object expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(String actual, String message, String expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(Set<?> actual, String message, Set<?> expected) { assertNotEquals(actual, expected, message); } @BeforeTemplate void before(Map<?, ?> actual, String message, Map<?, ?> expected) { assertNotEquals(actual, expected, message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(Object actual, String message, Object expected) { assertThat(actual).withFailMessage(message).isNotEqualTo(expected); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$FailRecipe
- Refaster template
TestNGToAssertJRules.Fail - Recipe created for the following Refaster template:
java static final class Fail { @BeforeTemplate void before() { Assert.fail(); } @AfterTemplate @DoNotCall @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after() { fail(); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$FailWithMessageAndThrowableRecipe
- Refaster template
TestNGToAssertJRules.FailWithMessageAndThrowable - Recipe created for the following Refaster template:
java static final class FailWithMessageAndThrowable { @BeforeTemplate void before(String message, Throwable throwable) { Assert.fail(message, throwable); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(String message, Throwable throwable) { fail(message, throwable); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes$FailWithMessageRecipe
- Refaster template
TestNGToAssertJRules.FailWithMessage - Recipe created for the following Refaster template:
java static final class FailWithMessage { @BeforeTemplate void before(String message) { Assert.fail(message); } @AfterTemplate @UseImportPolicy(value = STATIC_IMPORT_ALWAYS) void after(String message) { fail(message); } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes
TimeRulesRefaster recipes- Refaster rules related to expressions dealing with time. Source.
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ChronoLocalDateIsAfterRecipe
- Refaster template
TimeRules.ChronoLocalDateIsAfter - Prefer
ChronoLocalDate#isBefore(ChronoLocalDate)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ChronoLocalDateIsBeforeRecipe
- Refaster template
TimeRules.ChronoLocalDateIsBefore - Prefer
ChronoLocalDate#isBefore(ChronoLocalDate)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ChronoLocalDateTimeIsAfterRecipe
- Refaster template
TimeRules.ChronoLocalDateTimeIsAfter - Prefer
ChronoLocalDateTime#isBefore(ChronoLocalDateTime)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ChronoLocalDateTimeIsBeforeRecipe
- Refaster template
TimeRules.ChronoLocalDateTimeIsBefore - Prefer
ChronoLocalDateTime#isBefore(ChronoLocalDateTime)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ChronoZonedDateTimeIsAfterRecipe
- Refaster template
TimeRules.ChronoZonedDateTimeIsAfter - Prefer
ChronoZonedDateTime#isBefore(ChronoZonedDateTime)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ChronoZonedDateTimeIsBeforeRecipe
- Refaster template
TimeRules.ChronoZonedDateTimeIsBefore - Prefer
ChronoZonedDateTime#isBefore(ChronoZonedDateTime)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ClockInstantRecipe
- Refaster template
TimeRules.ClockInstant - Prefer
Clock#instant()overInstant#now(Clock), as it is more concise and more "OOP-py".
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationBetweenInstantsRecipe
- Refaster template
TimeRules.DurationBetweenInstants - Don't unnecessarily convert to and from milliseconds. (This way nanosecond precision is retained.) <strong>Warning:</strong> this rewrite rule increases precision!.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationBetweenOffsetDateTimesRecipe
- Refaster template
TimeRules.DurationBetweenOffsetDateTimes - Don't unnecessarily convert to and from milliseconds. (This way nanosecond precision is retained.) <strong>Warning:</strong> this rewrite rule increases precision!.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationIsZeroRecipe
- Refaster template
TimeRules.DurationIsZero - Prefer
Duration#isZero()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationOfDaysRecipe
- Refaster template
TimeRules.DurationOfDays - Prefer
Duration#ofDays(long)over alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationOfHoursRecipe
- Refaster template
TimeRules.DurationOfHours - Prefer
Duration#ofHours(long)over alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationOfMillisRecipe
- Refaster template
TimeRules.DurationOfMillis - Prefer
Duration#ofMillis(long)over alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationOfMinutesRecipe
- Refaster template
TimeRules.DurationOfMinutes - Prefer
Duration#ofMinutes(long)over alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationOfNanosRecipe
- Refaster template
TimeRules.DurationOfNanos - Prefer
Duration#ofNanos(long)over alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$DurationOfSecondsRecipe
- Refaster template
TimeRules.DurationOfSeconds - Prefer
Duration#ofSeconds(long)over alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$EpochInstantRecipe
- Refaster template
TimeRules.EpochInstant - Prefer
Instant#EPOCHover alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$InstantAtOffsetRecipe
- Refaster template
TimeRules.InstantAtOffset - Prefer
Instant#atOffset(ZoneOffset)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$InstantAtZoneRecipe
- Refaster template
TimeRules.InstantAtZone - Prefer
Instant#atZone(ZoneId)over more verbose alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$InstantIdentityRecipe
- Refaster template
TimeRules.InstantIdentity - Don't unnecessarily transform an
Instantto an equivalent instance.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$InstantIsAfterRecipe
- Refaster template
TimeRules.InstantIsAfter - Prefer
Instant#isBefore(Instant)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$InstantIsBeforeRecipe
- Refaster template
TimeRules.InstantIsBefore - Prefer
Instant#isBefore(Instant)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$InstantTruncatedToMillisecondsRecipe
- Prefer
Instant#truncatedTo(TemporalUnit)over less obvious alternatives - Note that
Instant#toEpochMilli()throws anArithmeticExceptionfor dates very far in the past or future, while the suggested alternative doesn't.
- Prefer
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$InstantTruncatedToSecondsRecipe
- Refaster template
TimeRules.InstantTruncatedToSeconds - Prefer
Instant#truncatedTo(TemporalUnit)over less obvious alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateAtStartOfDayRecipe
- Refaster template
TimeRules.LocalDateAtStartOfDay - Prefer
LocalDate#atStartOfDay()over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateMinusDaysRecipe
- Refaster template
TimeRules.LocalDateMinusDays - Prefer
LocalDate#minusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateMinusMonthsRecipe
- Refaster template
TimeRules.LocalDateMinusMonths - Prefer
LocalDate#minusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateMinusWeeksRecipe
- Refaster template
TimeRules.LocalDateMinusWeeks - Prefer
LocalDate#minusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateMinusYearsRecipe
- Refaster template
TimeRules.LocalDateMinusYears - Prefer
LocalDate#minusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateOfInstantRecipe
- Refaster template
TimeRules.LocalDateOfInstant - Prefer
LocalDate#ofInstant(Instant, ZoneId)over more indirect alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDatePlusDaysRecipe
- Refaster template
TimeRules.LocalDatePlusDays - Prefer
LocalDate#plusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDatePlusMonthsRecipe
- Refaster template
TimeRules.LocalDatePlusMonths - Prefer
LocalDate#plusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDatePlusWeeksRecipe
- Refaster template
TimeRules.LocalDatePlusWeeks - Prefer
LocalDate#plusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDatePlusYearsRecipe
- Refaster template
TimeRules.LocalDatePlusYears - Prefer
LocalDate#plusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusDaysRecipe
- Refaster template
TimeRules.LocalDateTimeMinusDays - Prefer
LocalDateTime#minusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusHoursRecipe
- Refaster template
TimeRules.LocalDateTimeMinusHours - Prefer
LocalDateTime#minusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusMinutesRecipe
- Refaster template
TimeRules.LocalDateTimeMinusMinutes - Prefer
LocalDateTime#minusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusMonthsRecipe
- Refaster template
TimeRules.LocalDateTimeMinusMonths - Prefer
LocalDateTime#minusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusNanosRecipe
- Refaster template
TimeRules.LocalDateTimeMinusNanos - Prefer
LocalDateTime#minusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusSecondsRecipe
- Refaster template
TimeRules.LocalDateTimeMinusSeconds - Prefer
LocalDateTime#minusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusWeeksRecipe
- Refaster template
TimeRules.LocalDateTimeMinusWeeks - Prefer
LocalDateTime#minusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeMinusYearsRecipe
- Refaster template
TimeRules.LocalDateTimeMinusYears - Prefer
LocalDateTime#minusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimeOfInstantRecipe
- Refaster template
TimeRules.LocalDateTimeOfInstant - Prefer
LocalDateTime#ofInstant(Instant, ZoneId)over more indirect alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusDaysRecipe
- Refaster template
TimeRules.LocalDateTimePlusDays - Prefer
LocalDateTime#plusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusHoursRecipe
- Refaster template
TimeRules.LocalDateTimePlusHours - Prefer
LocalDateTime#plusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusMinutesRecipe
- Refaster template
TimeRules.LocalDateTimePlusMinutes - Prefer
LocalDateTime#plusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusMonthsRecipe
- Refaster template
TimeRules.LocalDateTimePlusMonths - Prefer
LocalDateTime#plusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusNanosRecipe
- Refaster template
TimeRules.LocalDateTimePlusNanos - Prefer
LocalDateTime#plusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusSecondsRecipe
- Refaster template
TimeRules.LocalDateTimePlusSeconds - Prefer
LocalDateTime#plusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusWeeksRecipe
- Refaster template
TimeRules.LocalDateTimePlusWeeks - Prefer
LocalDateTime#plusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalDateTimePlusYearsRecipe
- Refaster template
TimeRules.LocalDateTimePlusYears - Prefer
LocalDateTime#plusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimeMinRecipe
- Refaster template
TimeRules.LocalTimeMin - Prefer the
LocalTime#MINover alternative representations.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimeMinusHoursRecipe
- Refaster template
TimeRules.LocalTimeMinusHours - Prefer
LocalTime#minusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimeMinusMinutesRecipe
- Refaster template
TimeRules.LocalTimeMinusMinutes - Prefer
LocalTime#minusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimeMinusNanosRecipe
- Refaster template
TimeRules.LocalTimeMinusNanos - Prefer
LocalTime#minusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimeMinusSecondsRecipe
- Refaster template
TimeRules.LocalTimeMinusSeconds - Prefer
LocalTime#minusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimeOfInstantRecipe
- Refaster template
TimeRules.LocalTimeOfInstant - Prefer
LocalTime#ofInstant(Instant, ZoneId)over more indirect alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimePlusHoursRecipe
- Refaster template
TimeRules.LocalTimePlusHours - Prefer
LocalTime#plusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimePlusMinutesRecipe
- Refaster template
TimeRules.LocalTimePlusMinutes - Prefer
LocalTime#plusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimePlusNanosRecipe
- Refaster template
TimeRules.LocalTimePlusNanos - Prefer
LocalTime#plusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$LocalTimePlusSecondsRecipe
- Refaster template
TimeRules.LocalTimePlusSeconds - Prefer
LocalTime#plusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeIsAfterRecipe
- Refaster template
TimeRules.OffsetDateTimeIsAfter - Prefer
OffsetDateTime#isBefore(OffsetDateTime)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeIsBeforeRecipe
- Refaster template
TimeRules.OffsetDateTimeIsBefore - Prefer
OffsetDateTime#isBefore(OffsetDateTime)over explicit comparison, as it yields more readable code.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusDaysRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusDays - Prefer
OffsetDateTime#minusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusHoursRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusHours - Prefer
OffsetDateTime#minusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusMinutesRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusMinutes - Prefer
OffsetDateTime#minusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusMonthsRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusMonths - Prefer
OffsetDateTime#minusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusNanosRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusNanos - Prefer
OffsetDateTime#minusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusSecondsRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusSeconds - Prefer
OffsetDateTime#minusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusWeeksRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusWeeks - Prefer
OffsetDateTime#minusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeMinusYearsRecipe
- Refaster template
TimeRules.OffsetDateTimeMinusYears - Prefer
OffsetDateTime#minusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimeOfInstantRecipe
- Refaster template
TimeRules.OffsetDateTimeOfInstant - Prefer
OffsetDateTime#ofInstant(Instant, ZoneId)over more indirect alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusDaysRecipe
- Refaster template
TimeRules.OffsetDateTimePlusDays - Prefer
OffsetDateTime#plusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusHoursRecipe
- Refaster template
TimeRules.OffsetDateTimePlusHours - Prefer
OffsetDateTime#plusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusMinutesRecipe
- Refaster template
TimeRules.OffsetDateTimePlusMinutes - Prefer
OffsetDateTime#plusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusMonthsRecipe
- Refaster template
TimeRules.OffsetDateTimePlusMonths - Prefer
OffsetDateTime#plusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusNanosRecipe
- Refaster template
TimeRules.OffsetDateTimePlusNanos - Prefer
OffsetDateTime#plusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusSecondsRecipe
- Refaster template
TimeRules.OffsetDateTimePlusSeconds - Prefer
OffsetDateTime#plusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusWeeksRecipe
- Refaster template
TimeRules.OffsetDateTimePlusWeeks - Prefer
OffsetDateTime#plusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetDateTimePlusYearsRecipe
- Refaster template
TimeRules.OffsetDateTimePlusYears - Prefer
OffsetDateTime#plusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimeMinusHoursRecipe
- Refaster template
TimeRules.OffsetTimeMinusHours - Prefer
OffsetTime#minusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimeMinusMinutesRecipe
- Refaster template
TimeRules.OffsetTimeMinusMinutes - Prefer
OffsetTime#minusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimeMinusNanosRecipe
- Refaster template
TimeRules.OffsetTimeMinusNanos - Prefer
OffsetTime#minusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimeMinusSecondsRecipe
- Refaster template
TimeRules.OffsetTimeMinusSeconds - Prefer
OffsetTime#minusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimeOfInstantRecipe
- Refaster template
TimeRules.OffsetTimeOfInstant - Prefer
OffsetTime#ofInstant(Instant, ZoneId)over more indirect alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimePlusHoursRecipe
- Refaster template
TimeRules.OffsetTimePlusHours - Prefer
OffsetTime#plusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimePlusMinutesRecipe
- Refaster template
TimeRules.OffsetTimePlusMinutes - Prefer
OffsetTime#plusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimePlusNanosRecipe
- Refaster template
TimeRules.OffsetTimePlusNanos - Prefer
OffsetTime#plusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$OffsetTimePlusSecondsRecipe
- Refaster template
TimeRules.OffsetTimePlusSeconds - Prefer
OffsetTime#plusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$UtcClockRecipe
- Refaster template
TimeRules.UtcClock - Use
Clock#systemUTC()when possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$UtcConstantRecipe
- Refaster template
TimeRules.UtcConstant - Use
ZoneOffset#UTCwhen possible.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZeroDurationRecipe
- Refaster template
TimeRules.ZeroDuration - Recipe created for the following Refaster template:
java static final class ZeroDuration { @BeforeTemplate Duration before(TemporalUnit temporalUnit) { return Refaster.anyOf(Duration.ofNanos(0), Duration.ofMillis(0), Duration.ofSeconds(0), Duration.ofSeconds(0, 0), Duration.ofMinutes(0), Duration.ofHours(0), Duration.ofDays(0), Duration.of(0, temporalUnit)); } @AfterTemplate Duration after() { return Duration.ZERO; } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZeroPeriodRecipe
- Refaster template
TimeRules.ZeroPeriod - Recipe created for the following Refaster template:
java static final class ZeroPeriod { @BeforeTemplate Period before() { return Refaster.anyOf(Period.ofDays(0), Period.ofWeeks(0), Period.ofMonths(0), Period.ofYears(0), Period.of(0, 0, 0)); } @AfterTemplate Period after() { return Period.ZERO; } }.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusDaysRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusDays - Prefer
ZonedDateTime#minusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusHoursRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusHours - Prefer
ZonedDateTime#minusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusMinutesRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusMinutes - Prefer
ZonedDateTime#minusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusMonthsRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusMonths - Prefer
ZonedDateTime#minusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusNanosRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusNanos - Prefer
ZonedDateTime#minusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusSecondsRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusSeconds - Prefer
ZonedDateTime#minusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusWeeksRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusWeeks - Prefer
ZonedDateTime#minusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimeMinusYearsRecipe
- Refaster template
TimeRules.ZonedDateTimeMinusYears - Prefer
ZonedDateTime#minusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusDaysRecipe
- Refaster template
TimeRules.ZonedDateTimePlusDays - Prefer
ZonedDateTime#plusDays(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusHoursRecipe
- Refaster template
TimeRules.ZonedDateTimePlusHours - Prefer
ZonedDateTime#plusHours(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusMinutesRecipe
- Refaster template
TimeRules.ZonedDateTimePlusMinutes - Prefer
ZonedDateTime#plusMinutes(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusMonthsRecipe
- Refaster template
TimeRules.ZonedDateTimePlusMonths - Prefer
ZonedDateTime#plusMonths(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusNanosRecipe
- Refaster template
TimeRules.ZonedDateTimePlusNanos - Prefer
ZonedDateTime#plusNanos(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusSecondsRecipe
- Refaster template
TimeRules.ZonedDateTimePlusSeconds - Prefer
ZonedDateTime#plusSeconds(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusWeeksRecipe
- Refaster template
TimeRules.ZonedDateTimePlusWeeks - Prefer
ZonedDateTime#plusWeeks(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes$ZonedDateTimePlusYearsRecipe
- Refaster template
TimeRules.ZonedDateTimePlusYears - Prefer
ZonedDateTime#plusYears(long)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes
WebClientRulesRefaster recipes- Refaster rules related to expressions dealing with
org.springframework.web.reactive.function.client.WebClientand related types. Source.
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$BodyValueRecipe
- Refaster template
WebClientRules.BodyValue - Prefer
RequestBodySpec#bodyValue(Object)over more contrived alternatives.
- Refaster template
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$WebClientGetRecipe
- Refaster template
WebClientRules.WebClientGet - Prefer
WebClient#get()overWebClient#method(HttpMethod)withHttpMethod#GET.
- Refaster template
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$WebClientHeadRecipe
- Refaster template
WebClientRules.WebClientHead - Prefer
WebClient#head()overWebClient#method(HttpMethod)withHttpMethod#HEAD.
- Refaster template
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$WebClientOptionsRecipe
- Refaster template
WebClientRules.WebClientOptions - Prefer
WebClient#options()overWebClient#method(HttpMethod)withHttpMethod#OPTIONS.
- Refaster template
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$WebClientPatchRecipe
- Refaster template
WebClientRules.WebClientPatch - Prefer
WebClient#patch()overWebClient#method(HttpMethod)withHttpMethod#PATCH.
- Refaster template
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$WebClientPostRecipe
- Refaster template
WebClientRules.WebClientPost - Prefer
WebClient#post()overWebClient#method(HttpMethod)withHttpMethod#POST.
- Refaster template
- tech.picnic.errorprone.refasterrules.WebClientRulesRecipes$WebClientPutRecipe
- Refaster template
WebClientRules.WebClientPut - Prefer
WebClient#put()overWebClient#method(HttpMethod)withHttpMethod#PUT.
- Refaster template
org.openrewrite:rewrite-core
License: Apache License Version 2.0
27 recipes
- org.openrewrite.AddToGitignore
- Add entries to
.gitignore - Adds entries to the project's
.gitignorefile. If no.gitignorefile exists, one will be created. Existing entries that match will not be duplicated.
- Add entries to
- org.openrewrite.DeleteSourceFiles
- Delete files
- Delete files by source path.
- org.openrewrite.ExcludeFileFromGitignore
- Remove ignoral of files or directories from .gitignore
- This recipe will remove a file or directory from the .gitignore file. If the file or directory is already in the .gitignore file, it will be removed or negated. If the file or directory is not in the .gitignore file, no action will be taken.
- org.openrewrite.FindCollidingSourceFiles
- Find colliding source files
- Finds source files which share a path with another source file. There should always be exactly one source file per path within a repository. This is a diagnostic for finding problems in OpenRewrite parsers/build plugins.
- org.openrewrite.FindDeserializationErrors
- Find deserialization errors
- Produces a data table collecting all deserialization errors of serialized LSTs.
- org.openrewrite.FindGitProvenance
- Show Git source control metadata
- List out the contents of each unique
GitProvenancemarker in the set of source files. When everything is working correctly, exactly one such marker should be printed as all source files are expected to come from the same repository / branch / commit hash.
- org.openrewrite.FindLstProvenance
- Find LST provenance
- Produces a data table showing what versions of OpenRewrite/Moderne tooling was used to produce a given LST.
- org.openrewrite.FindParseFailures
- Find source files with
ParseExceptionResultmarkers - This recipe explores parse failures after an LST is produced for classifying the types of failures that can occur and prioritizing fixes according to the most common problems.
- Find source files with
- org.openrewrite.FindQuarks
- Find instances of type
Quark Quarksource files are pointers to the existence of a file without capturing any of the contents of the file.
- Find instances of type
- org.openrewrite.FindSourceFiles
- Find files
- Find files by source path. Paths are always interpreted as relative to the repository root.
- org.openrewrite.IsInRepository
- Is in repository
- A search recipe which marks files that are in a repository with one of the supplied names. Intended for use as a precondition for other recipes being run over many different repositories.
- org.openrewrite.ListRuntimeClasspath
- List runtime classpath
- A diagnostic utility which emits the runtime classpath to a data table.
- org.openrewrite.MoveFile
- Move a file
- Move a file to a different directory. The file name will remain the same.
- org.openrewrite.RenameFile
- Rename a file
- Rename a file while keeping it in the same directory.
- org.openrewrite.SetFilePermissions
- Set file permission attributes
- Set a file's read, write and executable permission attributes.
- org.openrewrite.search.FindBuildMetadata
- Find build metadata
- Find source files with matching build metadata.
- org.openrewrite.search.FindCommitters
- Find committers on repositories
- List the committers on a repository.
- org.openrewrite.search.FindParseToPrintInequality
- Find parse to print inequality
- OpenRewrite
Parserimplementations should produceSourceFileobjects whoseprintAll()method should be byte-for-byte equivalent with the original source file. When this isn't true, recipes can still run on theSourceFileand even produce diffs, but the diffs would fail to apply as a patch to the original source file. MostParseruseParser#requirePrintEqualsInputto produce aParseErrorwhen they fail to produce aSourceFilethat is print idempotent.
- org.openrewrite.search.RepositoryContainsFile
- Repository contains file
- Intended to be used primarily as a precondition for other recipes, this recipe checks if a repository contains a specific file or files matching a pattern. If present all files in the repository are marked with a
SearchResultmarker. If you want to get only the matching file as a search result, useFindSourceFilesinstead.
- org.openrewrite.text.AppendToTextFile
- Append to text file
- Appends or replaces content of an existing plain text file, or creates a new one if it doesn't already exist. Please note that this recipes requires existing plain text files' format to be successfully parsable by OpenRewrite. If a file is left unchanged, it might be parsed as a
Quarkrather than plain text. In such case, use theplainTextMaskoption. See the Gradle or Maven plugin configuration page.
- org.openrewrite.text.ChangeText
- Change text
- Completely replaces the contents of the text file with other text. Use together with a
FindSourceFilesprecondition to limit which files are changed.
- org.openrewrite.text.CreateTextFile
- Create text file
- Creates a new plain text file.
- org.openrewrite.text.EndOfLineAtEndOfFile
- End of Line @ End of File (EOL @ EOF)
- Ensure that the file ends with the newline character. Note: If this recipe modifies a file, it converts the file into plain text. As such, this recipe should be run after any recipe that modifies the language-specific LST.
- org.openrewrite.text.Find
- Find text
- Textual search, optionally using Regular Expression (regex) to query.
- org.openrewrite.text.FindAndReplace
- Find and replace
- Textual find and replace, optionally interpreting the search query as a Regular Expression (regex). When operating on source files that are language-specific Lossless Semantic Tree, such as Java or XML, this operation converts the source file to plain text for the rest of the recipe run. So if you are combining this recipe with language-specific recipes in a single recipe run put all the language-specific recipes before this recipe.
- org.openrewrite.text.FindMultiselect
- Experimental find text with multiselect
- Search for text, treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
- org.openrewrite.text.RemoveByteOrderMark
- Remove byte order mark (BOM)
- Removes UTF-8 byte order marks from the beginning of files. The BOM character (U+FEFF) is generally unnecessary in UTF-8 files and can cause issues with some tools.
org.openrewrite:rewrite-csharp
License: Moderne Source Available License
570 recipes
- org.openrewrite.csharp.recipes.meziantou.analyzer.AbstractTypesShouldNotHaveConstructorsMA0017
- Abstract types should not have public or internal constructors
- org.openrewrite.csharp.recipes.meziantou.analyzer.ArgumentExceptionShouldSpecifyArgumentNameMA0043
- Use nameof operator in ArgumentException
- org.openrewrite.csharp.recipes.meziantou.analyzer.AvoidComparisonWithBoolConstantMA0073
- Avoid comparison with bool constant
- org.openrewrite.csharp.recipes.meziantou.analyzer.AvoidUsingRedundantElseMA0071
- Avoid using redundant else
- The 'if' block contains a jump statement (break, continue, goto, return, throw, yield break). Using 'else' is redundant and needlessly maintains a higher nesting level.
- org.openrewrite.csharp.recipes.meziantou.analyzer.ClassMustBeSealedMA0053
- Make class sealed
- org.openrewrite.csharp.recipes.meziantou.analyzer.CommaMA0007
- Add a comma after the last value
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotRemoveOriginalExceptionFromThrowStatementMA0027
- Prefer rethrowing an exception implicitly
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseBlockingCallInAsyncContextMA0042
- Do not use blocking calls in an async method
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseBlockingCallInAsyncContextMA0045
- Do not use blocking calls in a sync method (need to make calling method async)
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseEqualityComparerDefaultOfStringMA0024
- Use an explicit StringComparer when possible
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseEqualityOperatorsForSpanOfCharMA0103
- Use SequenceEqual instead of equality operator
- org.openrewrite.csharp.recipes.meziantou.analyzer.DoNotUseStringGetHashCodeMA0021
- Use StringComparer.GetHashCode instead of string.GetHashCode
- org.openrewrite.csharp.recipes.meziantou.analyzer.EqualityShouldBeCorrectlyImplementedMA0077
- A class that provides Equals(T) should implement IEquatable<T>
- org.openrewrite.csharp.recipes.meziantou.analyzer.EventsShouldHaveProperArgumentsMA0091
- Sender should be 'this' for instance events
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeClassStaticMA0036
- Make class static
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeInterpolatedStringMA0165
- Make interpolated string
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMemberReadOnlyMA0102
- Make member readonly
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMethodStaticMA0038
- Make method static (deprecated, use CA1822 instead)
- org.openrewrite.csharp.recipes.meziantou.analyzer.MakeMethodStaticMA0041
- Make property static (deprecated, use CA1822 instead)
- org.openrewrite.csharp.recipes.meziantou.analyzer.MarkAttributesWithAttributeUsageAttributeMA0010
- Mark attributes with AttributeUsageAttribute
- org.openrewrite.csharp.recipes.meziantou.analyzer.MethodOverridesShouldNotChangeParameterDefaultsMA0061
- Method overrides should not change default values
- org.openrewrite.csharp.recipes.meziantou.analyzer.NamedParameterMA0003
- Add parameter name to improve readability
- org.openrewrite.csharp.recipes.meziantou.analyzer.NotPatternShouldBeParenthesizedCodeMA0164
- Use parentheses to make not pattern clearer
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0020
- Use direct methods instead of LINQ methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0029
- Combine LINQ methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0030
- Remove useless OrderBy call
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0031
- Optimize Enumerable.Count() usage
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0078
- Use 'Cast' instead of 'Select' to cast
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0098
- Use indexer instead of LINQ methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeLinqUsageMA0159
- Use 'Order' instead of 'OrderBy'
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeStartsWithMA0089
- Optimize string method usage
- org.openrewrite.csharp.recipes.meziantou.analyzer.OptimizeStringBuilderUsageMA0028
- Optimize StringBuilder usage
- org.openrewrite.csharp.recipes.meziantou.analyzer.ParameterAttributeForRazorComponentMA0116
- Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter]
- org.openrewrite.csharp.recipes.meziantou.analyzer.ParameterAttributeForRazorComponentMA0117
- Parameters with [EditorRequired] attributes should also be marked as [Parameter]
- org.openrewrite.csharp.recipes.meziantou.analyzer.PreserveParamsOnOverrideMA0081
- Method overrides should not omit params keyword
- org.openrewrite.csharp.recipes.meziantou.analyzer.RemoveEmptyStatementMA0037
- Remove empty statement
- org.openrewrite.csharp.recipes.meziantou.analyzer.RemoveUselessToStringMA0044
- Remove useless ToString call
- org.openrewrite.csharp.recipes.meziantou.analyzer.ReplaceEnumToStringWithNameofMA0052
- Replace constant Enum.ToString with nameof
- org.openrewrite.csharp.recipes.meziantou.analyzer.ReturnTaskFromResultInsteadOfReturningNullMA0022
- Return Task.FromResult instead of returning null
- org.openrewrite.csharp.recipes.meziantou.analyzer.SimplifyCallerArgumentExpressionMA0108
- Remove redundant argument value
- org.openrewrite.csharp.recipes.meziantou.analyzer.StringShouldNotContainsNonDeterministicEndOfLineMA0101
- String contains an implicit end of line character
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasCancellationTokenFixer_ArgumentMA0040
- Forward the CancellationToken parameter to methods that take one
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasCancellationTokenFixer_AwaitForEachMA0079
- Forward the CancellationToken using .WithCancellation()
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseAnOverloadThatHasTimeProviderMA0166
- Forward the TimeProvider to methods that take one
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseArrayEmptyMA0005
- Use Array.Empty<T>()
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseConfigureAwaitMA0004
- Use Task.ConfigureAwait
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseDateTimeUnixEpochMA0113
- Use DateTime.UnixEpoch
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseDateTimeUnixEpochMA0114
- Use DateTimeOffset.UnixEpoch
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseEventArgsEmptyMA0019
- Use EventArgs.Empty
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseEventArgsEmptyMA0093
- EventArgs should not be null
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseGuidEmptyMA0067
- Use Guid.Empty
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseIsPatternInsteadOfSequenceEqualMA0128
- Use 'is' operator instead of SequenceEqual
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedMA0120
- Use InvokeVoidAsync when the returned value is not used
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseLangwordInXmlCommentMA0154
- Use langword in XML comment
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0141
- Use pattern matching instead of inequality operators for null check
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0142
- Use pattern matching instead of equality operators for null check
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0148
- Use pattern matching instead of equality operators for discrete value
- org.openrewrite.csharp.recipes.meziantou.analyzer.UsePatternMatchingForEqualityComparisonsMA0149
- Use pattern matching instead of inequality operators for discrete value
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseRegexSourceGeneratorMA0110
- Use the Regex source generator
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparerMA0002
- IEqualityComparer<string> or IComparer<string> is missing
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparisonMA0001
- StringComparison is missing
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringComparisonMA0074
- Avoid implicit culture-sensitive methods
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringCreateInsteadOfFormattableStringMA0111
- Use string.Create instead of FormattableString
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStringEqualsMA0006
- Use String.Equals instead of equality operator
- org.openrewrite.csharp.recipes.meziantou.analyzer.UseStructLayoutAttributeMA0008
- Add StructLayoutAttribute
- org.openrewrite.csharp.recipes.meziantou.analyzer.ValidateArgumentsCorrectlyMA0050
- Validate arguments correctly in iterator methods
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AbstractTypesShouldNotHaveConstructorsCA1012
- Abstract types should not have public constructors
- Constructors on abstract types can be called only by derived types. Because public constructors create instances of a type, and you cannot create instances of an abstract type, an abstract type that has a public constructor is incorrectly designed.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidConstArraysCA1861
- Avoid constant arrays as arguments
- Constant arrays passed as arguments are not reused when called repeatedly, which implies a new array is created each time. Consider extracting them to 'static readonly' fields to improve performance if the passed array is not mutated within the called method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidLengthCalculationWhenSlicingToEndCA1514
- Avoid redundant length argument
- An explicit length calculation can be error-prone and can be avoided when slicing to end of the buffer.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnreliableStreamReadCA2022
- Avoid inexact read with 'Stream.Read'
- A call to 'Stream.Read' may return fewer bytes than requested, resulting in unreliable code if the return value is not checked.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnsealedAttributesCA1813
- Avoid unsealed attributes
- The .NET Framework class library provides methods for retrieving custom attributes. By default, these methods search the attribute inheritance hierarchy. Sealing the attribute eliminates the search through the inheritance hierarchy and can improve performance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidUnusedPrivateFieldsCA1823
- Avoid unused private fields
- Private fields were detected that do not appear to be accessed in the assembly.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.AvoidZeroLengthArrayAllocationsCA1825
- Avoid zero-length array allocations
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpAvoidDuplicateElementInitializationCA2244
- Do not duplicate indexed element initializations
- Indexed elements in objects initializers must initialize unique elements. A duplicate index might overwrite a previous element initialization.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDisableRuntimeMarshallingCA1421
- This method uses runtime marshalling even when the 'DisableRuntimeMarshallingAttribute' is applied
- This method uses runtime marshalling even when runtime marshalling is disabled, which can cause unexpected behavior differences at runtime due to different expectations of a type's native layout.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDisposeMethodsShouldCallBaseClassDisposeCA2215
- Dispose methods should call base class dispose
- A type that implements System.IDisposable inherits from a type that also implements IDisposable. The Dispose method of the inheriting type does not call the Dispose method of the parent type. To fix a violation of this rule, call base.Dispose in your Dispose method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotCompareSpanToNullCA2265
- Do not compare Span<T> to 'null' or 'default'
- Comparing a span to 'null' or 'default' might not do what you intended. 'default' and the 'null' literal are implicitly converted to 'Span<T>.Empty'. Remove the redundant comparison or make the code more explicit by using 'IsEmpty'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotGuardCallCA1853
- Unnecessary call to 'Dictionary.ContainsKey(key)'
- Do not guard 'Dictionary.Remove(key)' with 'Dictionary.ContainsKey(key)'. The former already checks whether the key exists, and will not throw if it does not.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotGuardCallCA1868
- Unnecessary call to 'Contains(item)'
- Do not guard 'Add(item)' or 'Remove(item)' with 'Contains(item)' for the set. The former two already check whether the item exists and will return if it was added or removed.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotInitializeUnnecessarilyCA1805
- Do not initialize unnecessarily
- The .NET runtime initializes all fields of reference types to their default values before running the constructor. In most cases, explicitly initializing a field to its default value in a constructor is redundant, adding maintenance costs and potentially degrading performance (such as with increased assembly size), and the explicit initialization can be removed. In some cases, such as with static readonly fields that permanently retain their default value, consider instead changing them to be constants or properties.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA1871
- Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'
- 'ArgumentNullException.ThrowIfNull' accepts an 'object', so passing a nullable struct may cause the value to be boxed.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullCA2264
- Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'
- 'ArgumentNullException.ThrowIfNull' throws when the passed argument is 'null'. Certain constructs like non-nullable structs, 'nameof()' and 'new' expressions are known to never be null, so 'ArgumentNullException.ThrowIfNull' will never throw.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseCountWhenAnyCanBeUsedCA1827
- Do not use Count() or LongCount() when Any() can be used
- For non-empty collections, Count() and LongCount() enumerate the entire sequence, while Any() stops at the first item or the first item that satisfies a condition.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseCountWhenAnyCanBeUsedCA1828
- Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
- For non-empty collections, CountAsync() and LongCountAsync() enumerate the entire sequence, while AnyAsync() stops at the first item or the first item that satisfies a condition.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectlyCA1826
- Do not use Enumerable methods on indexable collections
- This collection is directly indexable. Going through LINQ here causes unnecessary allocations and CPU work.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDynamicInterfaceCastableImplementationCA2256
- All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface
- Types attributed with 'DynamicInterfaceCastableImplementationAttribute' act as an interface implementation for a type that implements the 'IDynamicInterfaceCastable' type. As a result, it must provide an implementation of all of the members defined in the inherited interfaces, because the type that implements 'IDynamicInterfaceCastable' will not provide them otherwise.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpDynamicInterfaceCastableImplementationCA2257
- Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static'
- Since a type that implements 'IDynamicInterfaceCastable' may not implement a dynamic interface in metadata, calls to an instance interface member that is not an explicit implementation defined on this type are likely to fail at runtime. Mark new interface members 'static' to avoid runtime errors.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpEnumStorageShouldBeInt32CA1028
- Enum Storage should be Int32
- An enumeration is a value type that defines a set of related named constants. By default, the System.Int32 data type is used to store the constant value. Although you can change this underlying type, it is not required or recommended for most scenarios.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpEnumsShouldHaveZeroValueCA1008
- Enums should have zero value
- The default value of an uninitialized enumeration, just as other value types, is zero. A nonflags-attributed enumeration should define a member by using the value of zero so that the default value is a valid value of the enumeration. If an enumeration that has the FlagsAttribute attribute applied defines a zero-valued member, its name should be ""None"" to indicate that no values have been set in the enumeration.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpForwardCancellationTokenToInvocationsCA2016
- Forward the 'CancellationToken' parameter to methods
- Forward the 'CancellationToken' parameter to methods to ensure the operation cancellation notifications gets properly propagated, or pass in 'CancellationToken.None' explicitly to indicate intentionally not propagating the token.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpIdentifiersShouldNotContainUnderscoresCA1707
- Identifiers should not contain underscores
- By convention, identifier names do not contain the underscore (_) character. This rule checks namespaces, types, members, and parameters.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMakeTypesInternalCA1515
- Consider making public types internal
- Unlike a class library, an application's API isn't typically referenced publicly, so types can be marked internal.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMarkAllNonSerializableFieldsCA2235
- Mark all non-serializable fields
- An instance field of a type that is not serializable is declared in a type that is serializable.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpMarkMembersAsStaticCA1822
- Mark members as static
- Members that do not access instance data or call instance methods can be marked as static. After you mark the methods as static, the compiler will emit nonvirtual call sites to these members. This can give you a measurable performance gain for performance-sensitive code.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpOverrideEqualsAndOperatorEqualsOnValueTypesCA1815
- Override equals and operator equals on value types
- For value types, the inherited implementation of Equals uses the Reflection library and compares the contents of all fields. Reflection is computationally expensive, and comparing every field for equality might be unnecessary. If you expect users to compare or sort instances, or to use instances as hash table keys, your value type should implement Equals.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferAsSpanOverSubstringCA1846
- Prefer 'AsSpan' over 'Substring'
- 'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryContainsMethodsCA1841
- Prefer Dictionary.Contains methods
- 'ContainsKey' is usually O(1), while 'Keys.Contains' may be O(n) in some cases. Additionally, many dictionary implementations lazily initialize the Keys collection to cut back on allocations.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1854
- Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method
- Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey' check. 'ContainsKey' and the indexer both would lookup the key under the hood, so using 'TryGetValue' removes the extra lookup.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferDictionaryTryMethodsOverContainsKeyGuardCA1864
- Prefer the 'IDictionary.TryAdd(TKey, TValue)' method
- Prefer a 'TryAdd' call over an 'Add' call guarded by a 'ContainsKey' check. 'TryAdd' behaves the same as 'Add', except that when the specified key already exists, it returns 'false' instead of throwing an exception.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferGenericOverloadsCA2263
- Prefer generic overload when type is known
- Using a generic overload is preferable to the 'System.Type' overload when the type is known, promoting cleaner and more type-safe code with improved compile-time checks.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferHashDataOverComputeHashCA1850
- Prefer static 'HashData' method over 'ComputeHash'
- It is more efficient to use the static 'HashData' method over creating and managing a HashAlgorithm instance to call 'ComputeHash'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferIsEmptyOverCountCA1836
- Prefer IsEmpty over Count
- For determining whether the object contains or not any items, prefer using 'IsEmpty' property rather than retrieving the number of items from the 'Count' property and comparing it to 0 or 1.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferLengthCountIsEmptyOverAnyCA1860
- Avoid using 'Enumerable.Any()' extension method
- Prefer using 'IsEmpty', 'Count' or 'Length' properties whichever available, rather than calling 'Enumerable.Any()'. The intent is clearer and it is more performant than using 'Enumerable.Any()' extension method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpPreferStreamAsyncMemoryOverloadsCA1835
- Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
- 'Stream' has a 'ReadAsync' overload that takes a 'Memory<Byte>' as the first argument, and a 'WriteAsync' overload that takes a 'ReadOnlyMemory<Byte>' as the first argument. Prefer calling the memory based overloads, which are more efficient.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpRecommendCaseInsensitiveStringComparisonCA1862
- Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
- Avoid calling 'ToLower', 'ToUpper', 'ToLowerInvariant' and 'ToUpperInvariant' to perform case-insensitive string comparisons because they lead to an allocation. Instead, prefer calling the method overloads of 'Contains', 'IndexOf' and 'StartsWith' that take a 'StringComparison' enum value to perform case-insensitive comparisons. Switching to using an overload that takes a 'StringComparison' might cause subtle changes in behavior, so it's important to conduct thorough testing after applying the suggestion. Additionally, if a culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpSpecifyCultureForToLowerAndToUpperCA1311
- Specify a culture or use an invariant version
- Specify culture to help avoid accidental implicit dependency on current culture. Using an invariant version yields consistent results regardless of the culture of an application.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpSpecifyMarshalingForPInvokeStringArgumentsCA2101
- Specify marshaling for P/Invoke string arguments
- A platform invoke member allows partially trusted callers, has a string parameter, and does not explicitly marshal the string. This can cause a potential security vulnerability.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpStaticHolderTypesCA1052
- Static holder types should be Static or NotInheritable
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpTestForEmptyStringsUsingStringLengthCA1820
- Test for empty strings using string length
- Comparing strings by using the String.Length property or the String.IsNullOrEmpty method is significantly faster than using Equals.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpTestForNaNCorrectlyCA2242
- Test for NaN correctly
- This expression tests a value against Single.Nan or Double.Nan. Use Single.IsNan(Single) or Double.IsNan(Double) to test the value.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1831
- Use AsSpan or AsMemory instead of Range-based indexers when appropriate
- The Range-based indexer on string values produces a copy of requested portion of the string. This copy is usually unnecessary when it is implicitly used as a ReadOnlySpan or ReadOnlyMemory value. Use the AsSpan method to avoid the unnecessary copy.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1832
- Use AsSpan or AsMemory instead of Range-based indexers when appropriate
- The Range-based indexer on array values produces a copy of requested portion of the array. This copy is usually unnecessary when it is implicitly used as a ReadOnlySpan or ReadOnlyMemory value. Use the AsSpan method to avoid the unnecessary copy.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseAsSpanInsteadOfRangeIndexerCA1833
- Use AsSpan or AsMemory instead of Range-based indexers when appropriate
- The Range-based indexer on array values produces a copy of requested portion of the array. This copy is often unwanted when it is implicitly used as a Span or Memory value. Use the AsSpan method to avoid the copy.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseLiteralsWhereAppropriateCA1802
- Use literals where appropriate
- A field is declared static and read-only (Shared and ReadOnly in Visual Basic), and is initialized by using a value that is computable at compile time. Because the value that is assigned to the targeted field is computable at compile time, change the declaration to a const (Const in Visual Basic) field so that the value is computed at compile time instead of at runtime.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseOrdinalStringComparisonCA1309
- Use ordinal string comparison
- A string comparison operation that is nonlinguistic does not set the StringComparison parameter to either Ordinal or OrdinalIgnoreCase. By explicitly setting the parameter to either StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase, your code often gains speed, becomes more correct, and becomes more reliable.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUsePropertyInsteadOfCountMethodWhenAvailableCA1829
- Use Length/Count property instead of Count() when available
- Enumerable.Count() potentially enumerates the sequence while a Length/Count property is a direct access.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSearchValuesCA1870
- Use a cached 'SearchValues' instance
- Using a cached 'SearchValues' instance is more efficient than passing values to 'IndexOfAny'/'ContainsAny' directly.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSpanBasedStringConcatCA1845
- Use span-based 'string.Concat'
- It is more efficient to use 'AsSpan' and 'string.Concat', instead of 'Substring' and a concatenation operator.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseSpanClearInsteadOfFillCA1855
- Prefer 'Clear' over 'Fill'
- It is more efficient to use 'Clear', instead of 'Fill' with default value.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStartsWithInsteadOfIndexOfComparisonWithZeroCodeFixCA1858
- Use 'StartsWith' instead of 'IndexOf'
- It is both clearer and faster to use 'StartsWith' instead of comparing the result of 'IndexOf' to zero.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStringContainsCharOverloadWithSingleCharactersCA1847
- Use char literal for a single character lookup
- 'string.Contains(char)' is available as a better performing overload for single char lookup.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.CSharpUseStringMethodCharOverloadWithSingleCharactersCA1865
- Use char overload
- The char overload is a better performing overload than a string with a single char.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DefineAccessorsForAttributeArgumentsCA1019
- Define accessors for attribute arguments
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueCA2009
- Do not call ToImmutableCollection on an ImmutableCollection value
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotCreateTaskCompletionSourceWithWrongArgumentsCA2247
- Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum
- TaskCompletionSource has constructors that take TaskCreationOptions that control the underlying Task, and constructors that take object state that's stored in the task. Accidentally passing a TaskContinuationOptions instead of a TaskCreationOptions will result in the call treating the options as state.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotDirectlyAwaitATaskCA2007
- Consider calling ConfigureAwait on the awaited task
- When an asynchronous method awaits a Task directly, continuation occurs in the same thread that created the task. Consider calling Task.ConfigureAwait(Boolean) to signal your intention for continuation. Call ConfigureAwait(false) on the task to schedule continuations to the thread pool, thereby avoiding a deadlock on the UI thread. Passing false is a good option for app-independent libraries. Calling ConfigureAwait(true) on the task has the same behavior as not explicitly calling ConfigureAwait. By explicitly calling this method, you're letting readers know you intentionally want to perform the continuation on the original synchronization context.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1842
- Do not use 'WhenAll' with a single task
- Using 'WhenAll' with a single task may result in performance loss, await or return the task instead.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.DoNotUseWhenAllOrWaitAllWithSingleArgumentCA1843
- Do not use 'WaitAll' with a single task
- Using 'WaitAll' with a single task may result in performance loss, await or return the task instead.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EnumWithFlagsAttributeCA1027
- Mark enums with FlagsAttribute
- An enumeration is a value type that defines a set of related named constants. Apply FlagsAttribute to an enumeration when its named constants can be meaningfully combined.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EnumWithFlagsAttributeCA2217
- Do not mark enums with FlagsAttribute
- An externally visible enumeration is marked by using FlagsAttribute, and it has one or more values that are not powers of two or a combination of the other defined values on the enumeration.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EquatableCA1066
- Implement IEquatable when overriding Object.Equals
- When a type T overrides Object.Equals(object), the implementation must cast the object argument to the correct type T before performing the comparison. If the type implements IEquatable<T>, and therefore offers the method T.Equals(T), and if the argument is known at compile time to be of type T, then the compiler can call IEquatable<T>.Equals(T) instead of Object.Equals(object), and no cast is necessary, improving performance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.EquatableCA1067
- Override Object.Equals(object) when implementing IEquatable<T>
- When a type T implements the interface IEquatable<T>, it suggests to a user who sees a call to the Equals method in source code that an instance of the type can be equated with an instance of any other type. The user might be confused if their attempt to equate the type with an instance of another type fails to compile. This violates the "principle of least surprise".
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ExceptionsShouldBePublicCA1064
- Exceptions should be public
- An internal exception is visible only inside its own internal scope. After the exception falls outside the internal scope, only the base exception can be used to catch the exception. If the internal exception is inherited from T:System.Exception, T:System.SystemException, or T:System.ApplicationException, the external code will not have sufficient information to know what to do with the exception.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ImplementStandardExceptionConstructorsCA1032
- Implement standard exception constructors
- Failure to provide the full set of constructors can make it difficult to correctly handle exceptions.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.InstantiateArgumentExceptionsCorrectlyCA2208
- Instantiate argument exceptions correctly
- A call is made to the default (parameterless) constructor of an exception type that is or derives from ArgumentException, or an incorrect string argument is passed to a parameterized constructor of an exception type that is or derives from ArgumentException.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.InterfaceMethodsShouldBeCallableByChildTypesCA1033
- Interface methods should be callable by child types
- An unsealed externally visible type provides an explicit method implementation of a public interface and does not provide an alternative externally visible method that has the same name.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.MarkAttributesWithAttributeUsageCA1018
- Mark attributes with AttributeUsageAttribute
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.MarkTypesWithSerializableCA2237
- Mark ISerializable types with serializable
- To be recognized by the common language runtime as serializable, types must be marked by using the SerializableAttribute attribute even when the type uses a custom serialization routine through implementation of the ISerializable interface.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OperatorOverloadsHaveNamedAlternatesCA2225
- Operator overloads have named alternates
- An operator overload was detected, and the expected named alternative method was not found. The named alternative member provides access to the same functionality as the operator and is provided for developers who program in languages that do not support overloaded operators.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OperatorsShouldHaveSymmetricalOverloadsCA2226
- Operators should have symmetrical overloads
- A type implements the equality or inequality operator and does not implement the opposite operator.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OverloadOperatorEqualsOnOverridingValueTypeEqualsCA2231
- Overload operator equals on overriding value type Equals
- In most programming languages there is no default implementation of the equality operator (==) for value types. If your programming language supports operator overloads, you should consider implementing the equality operator. Its behavior should be identical to that of Equals.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.OverrideMethodsOnComparableTypesCA1036
- Override methods on comparable types
- A public or protected type implements the System.IComparable interface. It does not override Object.Equals nor does it overload the language-specific operator for equality, inequality, less than, less than or equal, greater than or greater than or equal.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ParameterNamesShouldMatchBaseDeclarationCA1725
- Parameter names should match base declaration
- Consistent naming of parameters in an override hierarchy increases the usability of the method overrides. A parameter name in a derived method that differs from the name in the base declaration can cause confusion about whether the method is an override of the base method or a new overload of the method.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferConstCharOverConstUnitStringCA1834
- Consider using 'StringBuilder.Append(char)' when applicable
- 'StringBuilder.Append(char)' is more efficient than 'StringBuilder.Append(string)' when the string is a single character. When calling 'Append' with a constant, prefer using a constant char rather than a constant string containing one character.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferConvertToHexStringOverBitConverterCA1872
- Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'
- Use 'Convert.ToHexString' or 'Convert.ToHexStringLower' when encoding bytes to a hexadecimal string representation. These methods are more efficient and allocation-friendly than using 'BitConverter.ToString' in combination with 'String.Replace' to replace dashes and 'String.ToLower'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferStringContainsOverIndexOfCA2249
- Consider using 'string.Contains' instead of 'string.IndexOf'
- Calls to 'string.IndexOf' where the result is used to check for the presence/absence of a substring can be replaced by 'string.Contains'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.PreferTypedStringBuilderAppendOverloadsCA1830
- Prefer strongly-typed Append and Insert method overloads on StringBuilder
- StringBuilder.Append and StringBuilder.Insert provide overloads for multiple types beyond System.String. When possible, prefer the strongly-typed overloads over using ToString() and the string-based overload.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.ProvidePublicParameterlessSafeHandleConstructorCA1419
- Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle'
- Providing a parameterless constructor that is as visible as the containing type for a type derived from 'System.Runtime.InteropServices.SafeHandle' enables better performance and usage with source-generated interop solutions.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.RemoveEmptyFinalizersCA1821
- Remove empty Finalizers
- Finalizers should be avoided where possible, to avoid the additional performance overhead involved in tracking object lifetime.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.RethrowToPreserveStackDetailsCA2200
- Rethrow to preserve stack details
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.SealInternalTypesCA1852
- Seal internal types
- When a type is not accessible outside its assembly and has no subtypes within its containing assembly, it can be safely sealed. Sealing types can improve performance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.SealMethodsThatSatisfyPrivateInterfacesCA2119
- Seal methods that satisfy private interfaces
- An inheritable public type provides an overridable method implementation of an internal (Friend in Visual Basic) interface. To fix a violation of this rule, prevent the method from being overridden outside the assembly.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.TypesThatOwnDisposableFieldsShouldBeDisposableCA1001
- Types that own disposable fields should be disposable
- A class declares and implements an instance field that is a System.IDisposable type, and the class does not implement IDisposable. A class that declares an IDisposable field indirectly owns an unmanaged resource and should implement the IDisposable interface.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UriParametersShouldNotBeStringsCA1054
- URI-like parameters should not be strings
- This rule assumes that the parameter represents a Uniform Resource Identifier (URI). A string representation or a URI is prone to parsing and encoding errors, and can lead to security vulnerabilities. 'System.Uri' class provides these services in a safe and secure manner.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseCancellationTokenThrowIfCancellationRequestedCA2250
- Use 'ThrowIfCancellationRequested'
- 'ThrowIfCancellationRequested' automatically checks whether the token has been canceled, and throws an 'OperationCanceledException' if it has.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1837
- Use 'Environment.ProcessId'
- 'Environment.ProcessId' is simpler and faster than 'Process.GetCurrentProcess().Id'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1839
- Use 'Environment.ProcessPath'
- 'Environment.ProcessPath' is simpler and faster than 'Process.GetCurrentProcess().MainModule.FileName'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseEnvironmentMembersCA1840
- Use 'Environment.CurrentManagedThreadId'
- 'Environment.CurrentManagedThreadId' is simpler and faster than 'Thread.CurrentThread.ManagedThreadId'.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1510
- Use ArgumentNullException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1511
- Use ArgumentException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1512
- Use ArgumentOutOfRangeException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseExceptionThrowHelpersCA1513
- Use ObjectDisposedException throw helper
- Throw helpers are simpler and more efficient than an if block constructing a new exception instance.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseNameOfInPlaceOfStringCA1507
- Use nameof to express symbol names
- Using nameof helps keep your code valid when refactoring.
- org.openrewrite.csharp.recipes.microsoft.codeanalysis.netanalyzers.UseStringEqualsOverStringCompareCA2251
- Use 'string.Equals'
- It is both clearer and likely faster to use 'string.Equals' instead of comparing the result of 'string.Compare' to zero.
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1001
- Add braces (when expression spans over multiple lines)
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1007
- Add braces
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesRCS1126
- Add braces to if-else
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddBracesToIfElseRCS1003
- Add braces to if-else (when expression spans over multiple lines)
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddExceptionToDocumentationCommentRCS1140
- Add exception to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddOrRemoveParenthesesWhenCreatingNewObjectRCS1050
- Include/omit parentheses when creating new object
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddOrRemoveTrailingCommaRCS1260
- Add/remove trailing comma
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddParagraphToDocumentationCommentRCS1226
- Add paragraph to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.AddParenthesesWhenNecessaryRCS1123
- Add parentheses when necessary
- org.openrewrite.csharp.recipes.roslynator.analyzers.AnonymousMethodRCS1048
- Use lambda expression instead of anonymous method
- org.openrewrite.csharp.recipes.roslynator.analyzers.AssignmentExpressionRCS1089
- Use --/++ operator instead of assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.AssignmentExpressionRCS1114
- Remove redundant delegate creation
- org.openrewrite.csharp.recipes.roslynator.analyzers.AttributeArgumentListRCS1039
- Remove argument list from attribute
- org.openrewrite.csharp.recipes.roslynator.analyzers.AvoidBoxingOfValueTypeRCS1198
- Avoid unnecessary boxing of value type
- org.openrewrite.csharp.recipes.roslynator.analyzers.AvoidNullReferenceExceptionRCS1202
- Avoid NullReferenceException
- org.openrewrite.csharp.recipes.roslynator.analyzers.AwaitExpressionRCS1090
- Add/remove 'ConfigureAwait(false)' call
- org.openrewrite.csharp.recipes.roslynator.analyzers.BaseArgumentListRCS1205
- Order named arguments according to the order of parameters
- org.openrewrite.csharp.recipes.roslynator.analyzers.BaseTypeRCS1182
- Remove redundant base interface
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1098
- Constant values should be placed on right side of comparisons
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1113
- Use 'string.IsNullOrEmpty' method
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1143
- Simplify coalesce expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1145
- Remove redundant 'as' operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1156
- Use string.Length instead of comparison with empty string
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1165
- Unconstrained type parameter checked for null
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1166
- Value type object is never equal to null
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1190
- Join string expressions
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1195
- Use ^ operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1199
- Unnecessary null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1233
- Use short-circuiting operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1240
- Operator is unnecessary
- org.openrewrite.csharp.recipes.roslynator.analyzers.BinaryExpressionRCS1268
- Simplify numeric comparison
- org.openrewrite.csharp.recipes.roslynator.analyzers.BlockRCS1031
- Remove unnecessary braces in switch section
- org.openrewrite.csharp.recipes.roslynator.analyzers.BlockRCS1171
- Simplify lazy initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.CaseSwitchLabelRCS1069
- Remove unnecessary case label
- org.openrewrite.csharp.recipes.roslynator.analyzers.CastExpressionRCS1257
- Use enum field explicitly
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1102
- Make class static
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1108
- Add 'static' modifier to all partial class declarations
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1194
- Implement exception constructors
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1203
- Use AttributeUsageAttribute
- org.openrewrite.csharp.recipes.roslynator.analyzers.ClassDeclarationRCS1225
- Make class sealed
- org.openrewrite.csharp.recipes.roslynator.analyzers.CompositeEnumValueContainsUndefinedFlagRCS1157
- Composite enum value contains undefined flag
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1084
- Use coalesce expression instead of conditional expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1104
- Simplify conditional expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1206
- Use conditional access instead of conditional expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConditionalExpressionRCS1238
- Avoid nested ?: operators
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1071
- Remove redundant base constructor call
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1074
- Remove redundant constructor
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConstructorDeclarationRCS1160
- Abstract type should not have public constructors
- org.openrewrite.csharp.recipes.roslynator.analyzers.ConvertLambdaExpressionBodyToExpressionBodyRCS1021
- Convert lambda expression body to expression body
- org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareEachAttributeSeparatelyRCS1052
- Declare each attribute separately
- org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareEnumMemberWithZeroValueRCS1135
- Declare enum member with zero value (when enum has FlagsAttribute)
- org.openrewrite.csharp.recipes.roslynator.analyzers.DeclareTypeInsideNamespaceRCS1110
- Declare type inside namespace
- org.openrewrite.csharp.recipes.roslynator.analyzers.DefaultExpressionRCS1244
- Simplify 'default' expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.DestructorDeclarationRCS1106
- [deprecated] Remove empty destructor
- org.openrewrite.csharp.recipes.roslynator.analyzers.DirectiveTriviaRCS1222
- Merge preprocessor directives
- org.openrewrite.csharp.recipes.roslynator.analyzers.DisposeResourceAsynchronouslyRCS1261
- Resource can be disposed asynchronously
- org.openrewrite.csharp.recipes.roslynator.analyzers.DoStatementRCS1063
- [deprecated] Avoid usage of do statement to create an infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.DocumentRCS1093
- File contains no code
- org.openrewrite.csharp.recipes.roslynator.analyzers.DocumentationCommentRCS1139
- Add summary element to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.DuplicateWordInCommentRCS1243
- Duplicate word in a comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.ElseClauseRCS1006
- Merge 'else' with nested 'if'
- org.openrewrite.csharp.recipes.roslynator.analyzers.ElseClauseRCS1040
- [deprecated] Remove empty 'else' clause
- org.openrewrite.csharp.recipes.roslynator.analyzers.EmptyStatementRCS1038
- [deprecated] Remove empty statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.EndRegionDirectiveTriviaRCS1189
- Add or remove region name
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1154
- Sort enum members
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1161
- Enum should declare explicit values
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumDeclarationRCS1237
- [deprecated] Use bit shift operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1191
- Declare enum value as combination of names
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1234
- Duplicate enum value
- org.openrewrite.csharp.recipes.roslynator.analyzers.EnumMemberDeclarationRCS1254
- Normalize format of enum flag value
- org.openrewrite.csharp.recipes.roslynator.analyzers.ExpressionRCS1051
- Add/remove parentheses from condition in conditional operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.ExpressionRCS1215
- Expression is always equal to true/false
- org.openrewrite.csharp.recipes.roslynator.analyzers.ExtractMemberToNewDocumentRCS1060
- Declare each type in separate file
- org.openrewrite.csharp.recipes.roslynator.analyzers.FinallyClauseRCS1066
- [deprecated] Remove empty 'finally' clause
- org.openrewrite.csharp.recipes.roslynator.analyzers.ForStatementRCS1064
- [deprecated] Avoid usage of for statement to create an infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1061
- Merge 'if' with nested 'if'
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1073
- Convert 'if' to 'return' statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1103
- Convert 'if' to assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1173
- Use coalesce expression instead of 'if'
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1208
- Reduce 'if' nesting
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1236
- Use exception filter
- org.openrewrite.csharp.recipes.roslynator.analyzers.IfStatementRCS1255
- Simplify argument null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.ImplementNonGenericCounterpartRCS1241
- Implement non-generic counterpart
- org.openrewrite.csharp.recipes.roslynator.analyzers.InitializerRCS1035
- [deprecated] Remove redundant comma in initializer
- org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolatedStringRCS1214
- Unnecessary interpolated string
- org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolatedStringRCS1217
- Convert interpolated string to concatenation
- org.openrewrite.csharp.recipes.roslynator.analyzers.InterpolationRCS1105
- Unnecessary interpolation
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvalidArgumentNullCheckRCS1256
- Invalid argument null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1080
- Use 'Count/Length' property instead of 'Any' method
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1097
- Remove redundant 'ToString' call
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1107
- Remove redundant 'ToCharArray' call
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1112
- Combine 'Enumerable.Where' method chain
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1196
- Call extension method as instance method
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1200
- Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'
- org.openrewrite.csharp.recipes.roslynator.analyzers.InvocationExpressionRCS1267
- Use string interpolation instead of 'string.Concat'
- org.openrewrite.csharp.recipes.roslynator.analyzers.LocalDeclarationStatementRCS1124
- Inline local variable
- org.openrewrite.csharp.recipes.roslynator.analyzers.LockStatementRCS1059
- Avoid locking on publicly accessible instance
- org.openrewrite.csharp.recipes.roslynator.analyzers.MarkLocalVariableAsConstRCS1118
- Mark local variable as const
- org.openrewrite.csharp.recipes.roslynator.analyzers.MarkTypeWithDebuggerDisplayAttributeRCS1223
- Mark publicly visible type with DebuggerDisplay attribute
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1018
- Add/remove accessibility modifiers
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1019
- Order modifiers
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1034
- Remove redundant 'sealed' modifier
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1055
- Unnecessary semicolon at the end of declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1132
- Remove redundant overriding member
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1169
- Make field read-only
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1170
- Use read-only auto-implemented property
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1181
- Convert comment to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1187
- Use constant instead of field
- org.openrewrite.csharp.recipes.roslynator.analyzers.MemberDeclarationRCS1224
- Make method an extension method
- org.openrewrite.csharp.recipes.roslynator.analyzers.NamespaceDeclarationRCS1072
- [deprecated] Remove empty namespace declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.NamespaceDeclarationRCS1094
- Declare using directive on top level
- org.openrewrite.csharp.recipes.roslynator.analyzers.NormalizeNullCheckProviderRCS1248
- Normalize null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.NormalizeUsageOfInfiniteLoopRCS1252
- Normalize usage of infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.ObjectCreationExpressionRCS1204
- Use EventArgs.Empty
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeLinqMethodCallRCS1077
- Optimize LINQ method call
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeLinqMethodCallRCS1246
- Use element access
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeMethodCallRCS1235
- Optimize method call
- org.openrewrite.csharp.recipes.roslynator.analyzers.OptimizeStringBuilderAppendCallRCS1197
- Optimize StringBuilder.Append/AppendLine call
- org.openrewrite.csharp.recipes.roslynator.analyzers.OrderElementsInDocumentationCommentRCS1232
- Order elements in documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.OrderTypeParameterConstraintsRCS1209
- Order type parameter constraints
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterNameDiffersFromBaseRCS1168
- Parameter name differs from base name
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1193
- Overriding member should not change 'params' modifier
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1231
- Make parameter ref read-only
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParameterRCS1242
- Do not pass non-read-only struct by read-only reference
- org.openrewrite.csharp.recipes.roslynator.analyzers.ParenthesizedExpressionRCS1032
- Remove redundant parentheses
- org.openrewrite.csharp.recipes.roslynator.analyzers.PropertyDeclarationRCS1188
- Remove redundant auto-property initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.RawStringLiteralRCS1262
- Unnecessary raw string literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.RawStringLiteralRCS1266
- Use raw string literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.RegionDirectiveTriviaRCS1091
- [deprecated] Remove empty region
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveBracesFromIfElseRCS1004
- Remove braces from if-else
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveBracesRCS1002
- Remove braces
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveElementInDocumentationCommentRCS1228
- Unused element in a documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveElementInDocumentationCommentRCS1263
- Invalid reference in a documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEmptyInitializerRCS1041
- [deprecated] Remove empty initializer
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEmptySyntaxRCS1259
- Remove empty syntax
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveEnumDefaultBaseTypeRCS1042
- Remove enum default underlying type
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveOriginalExceptionRCS1044
- Remove original exception from throw statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemovePartialModifierFromTypeWithSinglePartRCS1043
- Remove 'partial' modifier from type with a single part
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantAssignmentRCS1212
- Remove redundant assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantAsyncAwaitRCS1174
- Remove redundant async/await
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantBooleanLiteralRCS1033
- Remove redundant boolean literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantCastRCS1151
- Remove redundant cast
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveRedundantCatchBlockRCS1265
- Remove redundant catch block
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveUnnecessaryBracesRCS1251
- Remove unnecessary braces from record declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.RemoveUnnecessaryElseRCS1211
- Remove unnecessary 'else'
- org.openrewrite.csharp.recipes.roslynator.analyzers.ReturnCompletedTaskInsteadOfNullRCS1210
- Return completed task instead of returning null
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyBooleanComparisonRCS1049
- Simplify boolean comparison
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyCodeBranchingRCS1218
- Simplify code branching
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyLogicalNegationRCS1068
- Simplify logical negation
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyNestedUsingStatementRCS1005
- Simplify nested using statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.SimplifyNullableOfTRCS1020
- Simplify Nullable<T> to T?
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1100
- [deprecated] Format documentation summary on a single line
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1101
- [deprecated] Format documentation summary on multiple lines
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1141
- Add 'param' element to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1142
- Add 'typeparam' element to documentation comment
- org.openrewrite.csharp.recipes.roslynator.analyzers.SingleLineDocumentationCommentTriviaRCS1253
- Format documentation comment summary
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1133
- Remove redundant Dispose/Close call
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1134
- Remove redundant statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1180
- Inline lazy initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.StatementRCS1201
- Use method chaining
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1070
- Remove redundant default switch section
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1099
- Default label should be the last label in a switch section
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1111
- Add braces to switch section with multiple statements
- org.openrewrite.csharp.recipes.roslynator.analyzers.SwitchSectionRCS1136
- Merge switch sections with equivalent content
- org.openrewrite.csharp.recipes.roslynator.analyzers.TokenRCS1249
- Unnecessary null-forgiving operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.TypeParameterRCS1164
- Unused type parameter
- org.openrewrite.csharp.recipes.roslynator.analyzers.TypeRCS1159
- Use EventHandler<T>
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryAssignmentRCS1179
- Unnecessary assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryEnumFlagRCS1258
- Unnecessary enum flag
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryExplicitUseOfEnumeratorRCS1230
- Unnecessary explicit use of enumerator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryUnsafeContextRCS1216
- Unnecessary unsafe context
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnnecessaryUsageOfVerbatimStringLiteralRCS1192
- Unnecessary usage of verbatim string literal
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnusedMemberRCS1213
- Remove unused member declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.UnusedParameterRCS1163
- Unused parameter
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseAnonymousFunctionOrMethodGroupRCS1207
- Use anonymous function or method group
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseAsyncAwaitRCS1229
- Use async/await when necessary
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseAutoPropertyRCS1085
- Use auto-implemented property
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseBlockBodyOrExpressionBodyRCS1016
- Use block body or expression body
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseCoalesceExpressionRCS1128
- Use coalesce expression
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseCompoundAssignmentRCS1058
- Use compound assignment
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseConditionalAccessRCS1146
- Use conditional access
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseEmptyStringLiteralOrStringEmptyRCS1078
- Use "" or 'string.Empty'
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarInForEachRCS1009
- [deprecated] Use explicit type instead of 'var' (foreach variable)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarRCS1008
- [deprecated] Use explicit type instead of 'var' (when the type is not obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitTypeInsteadOfVarRCS1012
- [deprecated] Use explicit type instead of 'var' (when the type is obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseExplicitlyOrImplicitlyTypedArrayRCS1014
- Use explicitly/implicitly typed array
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseHasFlagMethodOrBitwiseOperatorRCS1096
- Use 'HasFlag' method or bitwise operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseImplicitOrExplicitObjectCreationRCS1250
- Use implicit/explicit object creation
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseIsOperatorInsteadOfAsOperatorRCS1172
- Use 'is' operator instead of 'as' operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseNameOfOperatorRCS1015
- Use nameof operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsePatternMatchingInsteadOfAsAndNullCheckRCS1221
- Use pattern matching instead of combination of 'as' operator and null check
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsePatternMatchingInsteadOfIsAndCastRCS1220
- Use pattern matching instead of combination of 'is' operator and cast operator
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsePredefinedTypeRCS1013
- Use predefined type
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseRegexInstanceInsteadOfStaticMethodRCS1186
- Use Regex instance instead of static method
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseStringComparisonRCS1155
- Use StringComparison when comparing strings
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1010
- [deprecated] Use 'var' instead of explicit type (when the type is obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1176
- [deprecated] Use 'var' instead of explicit type (when the type is not obvious)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarInsteadOfExplicitTypeRCS1177
- [deprecated] Use 'var' instead of explicit type (in foreach)
- org.openrewrite.csharp.recipes.roslynator.analyzers.UseVarOrExplicitTypeRCS1264
- Use 'var' or explicit type
- org.openrewrite.csharp.recipes.roslynator.analyzers.UsingDirectiveRCS1056
- Avoid usage of using alias directive
- org.openrewrite.csharp.recipes.roslynator.analyzers.ValidateArgumentsCorrectlyRCS1227
- Validate arguments correctly
- org.openrewrite.csharp.recipes.roslynator.analyzers.VariableDeclarationRCS1081
- Split variable declaration
- org.openrewrite.csharp.recipes.roslynator.analyzers.VariableDeclaratorRCS1129
- Remove redundant field initialization
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhileStatementRCS1065
- [deprecated] Avoid usage of while statement to create an infinite loop
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhileStatementRCS1239
- Use 'for' statement instead of 'while' statement
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhitespaceTriviaRCS1036
- [deprecated] Remove unnecessary blank line
- org.openrewrite.csharp.recipes.roslynator.analyzers.WhitespaceTriviaRCS1037
- Remove trailing white-space
- org.openrewrite.csharp.recipes.roslynator.analyzers.XmlNodeRCS1247
- Fix documentation comment tag
- org.openrewrite.csharp.recipes.stylecop.analyzers.IndentationSA1137
- Elements should have the same indentation
- Elements at the same level in the syntax tree should have the same indentation.
- org.openrewrite.csharp.recipes.stylecop.analyzers.PropertySummaryDocumentationSA1623
- Property summary documentation should match accessors
- The documentation text within a C# property’s <summary> tag does not match the accessors within the property.
- org.openrewrite.csharp.recipes.stylecop.analyzers.PropertySummaryDocumentationSA1624
- Property summary documentation should omit accessor with restricted access
- The documentation text within a C# property’s <summary> tag takes into account all of the accessors within the property, but one of the accessors has limited access.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RemoveRegionSA1123
- Do not place regions within elements
- The C# code contains a region within the body of a code element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RemoveRegionSA1124
- Do not use regions
- The C# code contains a region.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1306
- Field names should begin with lower-case letter
- The name of a field in C# does not begin with a lower-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1312
- Variable names should begin with lower-case letter
- The name of a variable in C# does not begin with a lower-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToLowerCaseSA1313
- Parameter names should begin with lower-case letter
- The name of a parameter in C# does not begin with a lower-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1300
- Element should begin with upper-case letter
- The name of a C# element does not begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1303
- Const field names should begin with upper-case letter
- The name of a constant C# field should begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1304
- Non-private readonly fields should begin with upper-case letter
- The name of a non-private readonly C# field should being with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1307
- Accessible fields should begin with upper-case letter
- The name of a public or internal field in C# does not begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.RenameToUpperCaseSA1311
- Static readonly fields should begin with upper-case letter
- The name of a static readonly field does not begin with an upper-case letter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1003SA1003
- Symbols should be spaced correctly
- The spacing around an operator symbol is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1004SA1004
- Documentation lines should begin with single space
- A line within a documentation header above a C# element does not begin with a single space.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1005SA1005
- Single line comments should begin with single space
- A single-line comment within a C# code file does not begin with a single space.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1018SA1018
- Nullable type symbols should be spaced correctly
- A nullable type symbol within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1025SA1025
- Code should not contain multiple whitespace in a row
- The code contains multiple whitespace characters in a row.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1027SA1027
- Use tabs correctly
- The code contains a tab or space character which is not consistent with the current project settings.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1028SA1028
- Code should not contain trailing whitespace
- There should not be any whitespace at the end of a line of code.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1100SA1100
- Do not prefix calls with base unless local implementation exists
- A call to a member from an inherited class begins with 'base.', and the local class does not contain an override or implementation of the member.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1101SA1101
- Prefix local calls with this
- A call to an instance member of the local class or a base class is not prefixed with 'this.', within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1102SA1102
- Query clause should follow previous clause
- A C# query clause does not begin on the same line as the previous clause, or on the next line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1103SA1103
- Query clauses should be on separate lines or all on one line
- The clauses within a C# query expression are not all placed on the same line, and each clause is not placed on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1104SA1105SA1104
- Query clause should begin on new line when previous clause spans multiple lines
- A clause within a C# query expression begins on the same line as the previous clause, when the previous clause spans across multiple lines.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1104SA1105SA1105
- Query clauses spanning multiple lines should begin on own line
- A clause within a C# query expression spans across multiple lines, and does not begin on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1106SA1106
- Code should not contain empty statements
- The C# code contains an extra semicolon.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1107SA1107
- Code should not contain multiple statements on one line
- The C# code contains more than one statement on a single line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1116SA1116
- Split parameters should start on line after declaration
- The parameters to a C# method or indexer call or declaration span across multiple lines, but the first parameter does not start on the line after the opening bracket.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1119SA1119
- Statement should not use unnecessary parenthesis
- A C# statement contains parenthesis which are unnecessary and should be removed.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1119SA1119_p
- Statement should not use unnecessary parenthesis
- A C# statement contains parenthesis which are unnecessary and should be removed.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1120SA1120
- Comments should contain text
- The C# comment does not contain any comment text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1121SA1121
- Use built-in type alias
- The code uses one of the basic C# types, but does not use the built-in alias for the type.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1122SA1122
- Use string.Empty for empty strings
- The C# code includes an empty string, written as "".
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1127SA1127
- Generic type constraints should be on their own line
- Each type constraint clause for a generic type parameter should be listed on a line of code by itself.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1128SA1128
- Put constructor initializers on their own line
- A constructor initializer, including the colon character, should be on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1129SA1129
- Do not use default value type constructor
- When creating a new instance of a value type T, the syntax 'default(T)' is functionally equivalent to the syntax 'new T()'. To avoid confusion regarding the behavior of the resulting instance, the first form is preferred.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1130SA1130
- Use lambda syntax
- Lambda expressions are more succinct and easier to read than anonymous methods, so they should are preferred whenever the two are functionally equivalent.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1131SA1131
- Use readable conditions
- When a comparison is made between a variable and a literal, the variable should be placed on the left-hand-side to maximize readability.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1132SA1132
- Do not combine fields
- Each field should be declared on its own line, in order to clearly see each field of a type and allow for proper documentation of the behavior of each field.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1133SA1133
- Do not combine attributes
- Each attribute usage should be placed in its own set of square brackets for maximum readability.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1134SA1134
- Attributes should not share line
- Each attribute should be placed on its own line of code.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1135SA1135
- Using directives should be qualified
- All using directives should be qualified.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1136SA1136
- Enum values should be on separate lines
- Enum values should be placed on their own lines for maximum readability.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1139SA1139
- Use literal suffix notation instead of casting
- Use literal suffix notation instead of casting, in order to improve readability, avoid bugs related to illegal casts and ensure that optimal IL is produced.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1205SA1205
- Partial elements should declare access
- The partial element does not have an access modifier defined.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1206SA1206
- Declaration keywords should follow order
- The keywords within the declaration of an element do not follow a standard ordering scheme.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1207SA1207
- Protected should come before internal
- The keyword '0' is positioned after the keyword '1' within the declaration of a 0 1 C# element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1212SA1213SA1212
- Property accessors should follow order
- A get accessor appears after a set accessor within a property or indexer.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1212SA1213SA1213
- Event accessors should follow order
- An add accessor appears after a remove accessor within an event.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1302SA1302
- Interface names should begin with I
- The name of a C# interface does not begin with the capital letter I.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1308SA1308
- Variable names should not be prefixed
- A field name in C# is prefixed with 'm_', 's_', or 't_'.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1309SA1309
- Field names should not begin with underscore
- A field name in C# begins with an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1310SA1310
- Field names should not contain underscore
- A field name in C# contains an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1314SA1314
- Type parameter names should begin with T
- The name of a C# type parameter does not begin with the capital letter T.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1400SA1400
- Access modifier should be declared
- The access modifier for a C# element has not been explicitly defined.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1402SA1402
- File may only contain a single type
- A C# code file contains more than one unique type.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1404SA1404
- Code analysis suppression should have justification
- A Code Analysis SuppressMessage attribute does not include a justification.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1407SA1408SA1407
- Arithmetic expressions should declare precedence
- A C# statement contains a complex arithmetic expression which omits parenthesis around operators.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1407SA1408SA1408
- Conditional expressions should declare precedence
- A C# statement contains a complex conditional expression which omits parenthesis around operators.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1410SA1411SA1410
- Remove delegate parenthesis when possible
- A call to a C# anonymous method does not contain any method parameters, yet the statement still includes parenthesis.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1410SA1411SA1411
- Attribute constructor should not use unnecessary parenthesis
- TODO.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1412SA1412
- Store files as UTF-8 with byte order mark
- Source files should be saved using the UTF-8 encoding with a byte order mark
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1413SA1413
- Use trailing comma in multi-line initializers
- A multi-line initializer in a C# code file should use a comma on the last line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1500SA1500
- Braces for multi-line statements should not share line
- The opening or closing brace within a C# statement, element, or expression is not placed on its own line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1501SA1501
- Statement should not be on a single line
- A C# statement containing opening and closing braces is written completely on a single line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1502SA1502
- Element should not be on a single line
- A C# element containing opening and closing braces is written completely on a single line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1503
- Braces should not be omitted
- The opening and closing braces for a C# statement have been omitted.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1519
- Braces should not be omitted from multi-line child statement
- The opening and closing braces for a multi-line C# statement have been omitted.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1503SA1520
- Use braces consistently
- The opening and closing braces of a chained if/else if/else construct were included for some clauses, but omitted for others.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1504SA1504
- All accessors should be single-line or multi-line
- Within a C# property, indexer or event, at least one of the child accessors is written on a single line, and at least one of the child accessors is written across multiple lines.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1505SA1505
- Opening braces should not be followed by blank line
- An opening brace within a C# element, statement, or expression is followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1506SA1506
- Element documentation headers should not be followed by blank line
- An element documentation header above a C# element is followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1507SA1507
- Code should not contain multiple blank lines in a row
- The C# code contains multiple blank lines in a row.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1508SA1508
- Closing braces should not be preceded by blank line
- A closing brace within a C# element, statement, or expression is preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1509SA1509
- Opening braces should not be preceded by blank line
- An opening brace within a C# element, statement, or expression is preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1510SA1510
- Chained statement blocks should not be preceded by blank line
- Chained C# statements are separated by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1511SA1511
- While-do footer should not be preceded by blank line
- The while footer at the bottom of a do-while statement is separated from the statement by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1512SA1512
- Single-line comments should not be followed by blank line
- A single-line comment within C# code is followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1513SA1513
- Closing brace should be followed by blank line
- A closing brace within a C# element, statement, or expression is not followed by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1514SA1514
- Element documentation header should be preceded by blank line
- An element documentation header above a C# element is not preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1515SA1515
- Single-line comment should be preceded by blank line
- A single-line comment within C# code is not preceded by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1516SA1516
- Elements should be separated by blank line
- Adjacent C# elements are not separated by a blank line.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1517SA1517
- Code should not contain blank lines at start of file
- The code file has blank lines at the start.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1518SA1518
- Use line endings correctly at end of file
- Code should not contain blank lines at the end of the file
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1609SA1610SA1609
- Property documentation should have value
- The XML header documentation for a C# property does not contain a <value> tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1609SA1610SA1610
- Property documentation should have value text
- The XML header documentation for a C# property contains an empty <value> tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1615SA1616SA1615
- Element return value should be documented
- A C# element is missing documentation for its return value.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1615SA1616SA1616
- Element return value documentation should have text
- The <returns> tag within a C# element's documentation header is empty.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1617SA1617
- Void return value should not be documented
- A C# code element does not contain a return value, or returns void, but the documentation header for the element contains a <returns> tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1626SA1626
- Single-line comments should not use documentation style slashes
- The C# code contains a single-line comment which begins with three forward slashes in a row.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1629SA1629
- Documentation text should end with a period
- A section of the XML header documentation for a C# element does not end with a period.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1642SA1643SA1642
- Constructor summary documentation should begin with standard text
- The XML documentation header for a C# constructor does not contain the appropriate summary text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1642SA1643SA1643
- Destructor summary documentation should begin with standard text
- The XML documentation header for a C# finalizer does not contain the appropriate summary text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SA1651SA1651
- Do not use placeholder elements
- The element documentation contains a <placeholder> element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SX1101SX1101
- Do not prefix local calls with 'this.'
- A call to an instance member of the local class or a base class is prefixed with
this..
- org.openrewrite.csharp.recipes.stylecop.analyzers.SX1309SX1309
- Field names should begin with underscore
- A field name in C# does not begin with an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SX1309SX1309S
- Static field names should begin with underscore
- A static field name in C# does not begin with an underscore.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1600
- Elements should be documented
- A C# code element is missing a documentation header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1601
- Partial elements should be documented
- A C# partial element is missing a documentation header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1602
- Enumeration items should be documented
- An item within a C# enumeration is missing an Xml documentation header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1633
- File should have header
- A C# code file is missing a standard file header.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1634
- File header should show copyright
- The file header at the top of a C# code file is missing a copyright tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1635
- File header should have copyright text
- The file header at the top of a C# code file is missing copyright text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1636
- File header copyright text should match
- The file header at the top of a C# code file does not contain the appropriate copyright text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1637
- File header should contain file name
- The file header at the top of a C# code file is missing the file name.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1638
- File header file name documentation should match file name
- The file attribute within copyright tag of the file header at the top of a C# code file does not contain the name of the file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1639
- File header should have summary
- The file header at the top of a C# code file does not contain a filled-in summary tag.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1640
- File header should have valid company text
- The file header at the top of a C# code file does not contain company name text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1641
- File header company name text should match
- The file header at the top of a C# code file does not contain the appropriate company name text.
- org.openrewrite.csharp.recipes.stylecop.analyzers.SettingsFileSA1649
- File name should match first type name
- The file name of a C# code file does not match the first type declared in the file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1000
- Keywords should be spaced correctly
- The spacing around a C# keyword is incorrect.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1001
- Commas should be spaced correctly
- The spacing around a comma is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1002
- Semicolons should be spaced correctly
- The spacing around a semicolon is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1006
- Preprocessor keywords should not be preceded by space
- A C# preprocessor-type keyword is preceded by space.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1007
- Operator keyword should be followed by space
- The operator keyword within a C# operator overload method is not followed by any whitespace.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1008
- Opening parenthesis should be spaced correctly
- An opening parenthesis within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1009
- Closing parenthesis should be spaced correctly
- A closing parenthesis within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1010
- Opening square brackets should be spaced correctly
- An opening square bracket within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1011
- Closing square brackets should be spaced correctly
- A closing square bracket within a C# statement is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1012
- Opening braces should be spaced correctly
- An opening brace within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1013
- Closing braces should be spaced correctly
- A closing brace within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1014
- Opening generic brackets should be spaced correctly
- An opening generic bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1015
- Closing generic brackets should be spaced correctly
- A closing generic bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1016
- Opening attribute brackets should be spaced correctly
- An opening attribute bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1017
- Closing attribute brackets should be spaced correctly
- A closing attribute bracket within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1019
- Member access symbols should be spaced correctly
- The spacing around a member access symbol is incorrect, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1020
- Increment decrement symbols should be spaced correctly
- An increment or decrement symbol within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1021
- Negative signs should be spaced correctly
- A negative sign within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1022
- Positive signs should be spaced correctly
- A positive sign within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1023
- Dereference and access of symbols should be spaced correctly
- A dereference symbol or an access-of symbol within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1024
- Colons Should Be Spaced Correctly
- A colon within a C# element is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1026
- Code should not contain space after new or stackalloc keyword in implicitly typed array allocation
- An implicitly typed array allocation within a C# code file is not spaced correctly.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1110
- Opening parenthesis or bracket should be on declaration line
- The opening parenthesis or bracket is not placed on the same line as the method/indexer/attribute/array name.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1111
- Closing parenthesis should be on line of last parameter
- The closing parenthesis or bracket in a call to or declaration of a C# method/indexer/attribute/array/constructor/delegate is not placed on the same line as the last parameter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1112
- Closing parenthesis should be on line of opening parenthesis
- The closing parenthesis or bracket in a call to a C# method or indexer, or the declaration of a method or indexer, is not placed on the same line as the opening bracket when the element does not take any parameters.
- org.openrewrite.csharp.recipes.stylecop.analyzers.TokenSpacingSA1113
- Comma should be on the same line as previous parameter
- A comma between two parameters in a call to a C# method or indexer, or in the declaration of a method or indexer, is not placed on the same line as the previous parameter.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1200
- Using directives should be placed correctly
- A C# using directive is placed outside of a namespace element.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1208
- System using directives should be placed before other using directives
- A using directive which declares a member of the 'System' namespace appears after a using directive which declares a member of a different namespace, within a C# code file.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1209
- Using alias directives should be placed after other using directives
- A using-alias directive is positioned before a regular using directive.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1210
- Using directives should be ordered alphabetically by namespace
- The using directives within a C# code file are not sorted alphabetically by namespace.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1211
- Using alias directives should be ordered alphabetically by alias name
- The using-alias directives within a C# code file are not sorted alphabetically by alias name.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1216
- Using static directives should be placed at the correct location.
- A using static directive is positioned before a regular or after an alias using directive.
- org.openrewrite.csharp.recipes.stylecop.analyzers.UsingSA1217
- Using static directives should be ordered alphabetically
- All using static directives should be ordered alphabetically.
- org.openrewrite.csharp.recipes.wpfanalyzers.AddAttributeListFixWPF0130
- Add [TemplatePart] to the type
- Add [TemplatePart] to the type.
- org.openrewrite.csharp.recipes.wpfanalyzers.AddAttributeListFixWPF0176
- StyleTypedProperty is missing
- StyleTypedProperty is missing.
- org.openrewrite.csharp.recipes.wpfanalyzers.AddDefaultMemberFixWPF0070
- Add default field to converter
- Add default field to converter.
- org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeArgumentFixWPF0034
- Use correct argument for [AttachedPropertyBrowsableForType]
- Use correct argument for [AttachedPropertyBrowsableForType].
- org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeAttributeFixWPF0033
- Add [AttachedPropertyBrowsableForType]
- Add [AttachedPropertyBrowsableForType].
- org.openrewrite.csharp.recipes.wpfanalyzers.AttachedPropertyBrowsableForTypeAttributeFixWPF0071
- Add ValueConversion attribute
- Add ValueConversion attribute.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0019
- Cast sender to correct type
- Cast sender to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0020
- Cast value to correct type
- Cast value to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0021
- Cast sender to containing type
- Cast sender to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.CastFixWPF0022
- Cast value to correct type
- Cast value to correct type.
- org.openrewrite.csharp.recipes.wpfanalyzers.ChangeTypeofFixWPF0081
- MarkupExtensionReturnType must use correct return type
- MarkupExtensionReturnType must use correct return type.
- org.openrewrite.csharp.recipes.wpfanalyzers.ComponentResourceKeyFixWPF0140
- Use containing type when creating a ComponentResourceKey
- Use containing type when creating a ComponentResourceKey.
- org.openrewrite.csharp.recipes.wpfanalyzers.ComponentResourceKeyFixWPF0141
- Use containing member as key when creating a ComponentResourceKey
- Use containing member as key when creating a ComponentResourceKey.
- org.openrewrite.csharp.recipes.wpfanalyzers.ConstructorArgumentAttributeArgumentFixWPF0082
- [ConstructorArgument] must match
- [ConstructorArgument] must match the name of the constructor parameter.
- org.openrewrite.csharp.recipes.wpfanalyzers.ConstructorArgumentAttributeFixWPF0083
- Add [ConstructorArgument]
- Add [ConstructorArgument] for the property.
- org.openrewrite.csharp.recipes.wpfanalyzers.ConvertToLambdaFixWPF0023
- The callback is trivial, convert to lambda
- The callback is trivial, convert to lambda for better locality.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0060
- Backing member for DependencyProperty should have standard documentation text
- Backing member for DependencyProperty should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0061
- Accessor method for attached property should have standard documentation text
- Accessor method for attached property should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0062
- Property changed callback should have standard documentation text
- Property changed callback should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.DocumentationFixWPF0108
- Backing member for RoutedEvent should have standard documentation text
- Backing member for RoutedEvent should have standard documentation text.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0030
- Backing field for a DependencyProperty should be static and readonly
- Backing field for a DependencyProperty should be static and readonly.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0107
- Backing member for a RoutedEvent should be static and readonly
- Backing member for a RoutedEvent should be static and readonly.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeFieldStaticReadonlyFixWPF0123
- Backing field for a RoutedCommand should be static and readonly
- Backing field for a RoutedCommand should be static and readonly.
- org.openrewrite.csharp.recipes.wpfanalyzers.MakeNullableFixWPF0024
- Parameter type should be nullable
- Parameter type should be nullable.
- org.openrewrite.csharp.recipes.wpfanalyzers.MarkupExtensionReturnTypeAttributeFixWPF0080
- Add MarkupExtensionReturnType attribute
- Add MarkupExtensionReturnType attribute.
- org.openrewrite.csharp.recipes.wpfanalyzers.MoveFixWPF0031
- DependencyPropertyKey member must be declared before DependencyProperty member
- DependencyPropertyKey member must be declared before DependencyProperty member.
- org.openrewrite.csharp.recipes.wpfanalyzers.RegisterRoutedCommandFixWPF0122
- Register name and owning type for routed command
- Register containing type as owner for routed command.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0001
- Backing field for a DependencyProperty should match registered name
- A dependency property's backing field should be named with the name it is registered with suffixed by 'Property'. This is the convention in the framework.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0002
- Backing field for a DependencyPropertyKey should match registered name
- A DependencyPropertyKey's backing field must be named with the name it is registered with suffixed by 'PropertyKey'.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0003
- CLR property for a DependencyProperty should match registered name
- A CLR property accessor for a DependencyProperty must have the same name as the DependencyProperty is registered with.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0004
- CLR method for a DependencyProperty must match registered name
- CLR methods for accessing a DependencyProperty must have names matching the name the DependencyProperty is registered with.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0005
- Name of PropertyChangedCallback should match registered name
- Name of PropertyChangedCallback should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0006
- Name of CoerceValueCallback should match registered name
- Name of CoerceValueCallback should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0007
- Name of ValidateValueCallback should match registered name
- Name of ValidateValueCallback should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0090
- Name the invoked method OnEventName
- Name the invoked method OnEventName.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0091
- Name the invoked method OnEventName
- Name the invoked method OnEventName.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0100
- Backing field for a RoutedEvent should match registered name
- A routed event's backing field should be named with the name it is registered with suffixed by 'Event'.
- org.openrewrite.csharp.recipes.wpfanalyzers.RenameMemberFixWPF0102
- Name of the event should match registered name
- Name of the event should match registered name.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0011
- Containing type should be used as registered owner
- When registering a DependencyProperty register containing type as owner type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0101
- Containing type should be used as registered owner
- When registering a RoutedEvent register containing type as owner type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseContainingTypeFixWPF0121
- Register containing type as owner for routed command
- Register containing type as owner for routed command.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseCorrectDelegateFixWPF0092
- Use correct handler type
- Use correct handler type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseDependencyPropertyKeyFixWPF0040
- A readonly DependencyProperty must be set with DependencyPropertyKey
- A readonly DependencyProperty must be set with DependencyPropertyKey.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0120
- Register containing member name as name for routed command
- Register containing member name as name for routed command.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0150
- Use nameof() instead of literal
- Use nameof() as it is less fragile than string literal.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseNameofFixWPF0151
- Use nameof() instead of constant
- Use nameof() as it is less fragile than constant.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseRegisteredTypeFixWPF0012
- CLR property type should match registered type
- CLR property type should match registered type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseRegisteredTypeFixWPF0013
- CLR accessor for attached property must match registered type
- CLR accessor for attached property must match registered type.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseSetCurrentValueFixWPF0041
- Set mutable dependency properties using SetCurrentValue
- Prefer setting mutable dependency properties using SetCurrentValue.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseSetValueFixWPF0035
- Use SetValue in setter
- Use SetValue in setter.
- org.openrewrite.csharp.recipes.wpfanalyzers.UseSetValueFixWPF0043
- Don't set DataContext and Style using SetCurrentValue
- Set DataContext and Style using SetValue.
- org.openrewrite.csharp.recipes.wpfanalyzers.ValueConversionAttributeArgumentFixWPF0072
- ValueConversion must use correct types
- ValueConversion must use correct types.
- org.openrewrite.csharp.recipes.wpfanalyzers.ValueConversionAttributeFixWPF0073
- Add ValueConversion attribute (unknown types)
- Add ValueConversion attribute (unknown types).
- org.openrewrite.csharp.recipes.wpfanalyzers.XmlnsDefinitionFixWPF0052
- XmlnsDefinitions does not map all namespaces with public types
- XmlnsDefinitions does not map all namespaces with public types.
org.openrewrite:rewrite-gradle
License: Apache License Version 2.0
52 recipes
- org.openrewrite.gradle.AddDependency
- Add Gradle dependency
- Add a gradle dependency to a
build.gradlefile in the correct configuration based on where it is used.
- org.openrewrite.gradle.AddPlatformDependency
- Add Gradle platform dependency
- Add a gradle platform dependency to a
build.gradlefile in the correct configuration based on where it is used.
- org.openrewrite.gradle.AddProperty
- Add Gradle property
- Add a property to the
gradle.propertiesfile.
- org.openrewrite.gradle.ChangeDependency
- Change Gradle dependency
- Change a Gradle dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before.
- org.openrewrite.gradle.ChangeDependencyArtifactId
- Change Gradle dependency artifact
- Change the artifact of a specified Gradle dependency.
- org.openrewrite.gradle.ChangeDependencyClassifier
- Change a Gradle dependency classifier
- Changes classifier of an existing dependency declared in
build.gradlefiles.
- org.openrewrite.gradle.ChangeDependencyConfiguration
- Change a Gradle dependency configuration
- A common example is the need to change
compiletoapi/implementationas part of the move to Gradle 7.x and later.
- org.openrewrite.gradle.ChangeDependencyExtension
- Change a Gradle dependency extension
- Changes extension of an existing dependency declared in
build.gradlefiles.
- org.openrewrite.gradle.ChangeDependencyGroupId
- Change Gradle dependency group
- Change the group of a specified Gradle dependency.
- org.openrewrite.gradle.ChangeExtraProperty
- Change Extra Property
- Gradle's ExtraPropertiesExtension is a commonly used mechanism for setting arbitrary key/value pairs on a project. This recipe will change the value of a property with the given key name if that key can be found. It assumes that the value being set is a String literal. Does not add the value if it does not already exist.
- org.openrewrite.gradle.ChangeManagedDependency
- Change Gradle managed dependency
- Change a Gradle managed dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before. For now, only Spring Dependency Management Plugin entries are supported and no other forms of managed dependencies (yet).
- org.openrewrite.gradle.DependencyConstraintToRule
- Dependency constraint to resolution rule
- Gradle dependency constraints are useful for managing the versions of transitive dependencies. Some plugins, such as the Spring Dependency Management plugin, do not respect these constraints. This recipe converts constraints into resolution rules, which can achieve similar effects to constraints but are harder for plugins to ignore.
- org.openrewrite.gradle.DependencyUseMapNotation
- Use
Mapnotation for Gradle dependency declarations - In Gradle, dependencies can be expressed as a
Stringlike"groupId:artifactId:version", or equivalently as aMaplikegroup: 'groupId', name: 'artifactId', version: 'version'(groovy) orgroup = "groupId", name = "artifactId", version = "version"(kotlin). This recipe replaces dependencies represented asStringswith an equivalent dependency represented as aMap.
- Use
- org.openrewrite.gradle.DependencyUseStringNotation
- Use
Stringnotation for Gradle dependency declarations - In Gradle, dependencies can be expressed as a
Stringlike"groupId:artifactId:version", or equivalently as aMaplikegroup: 'groupId', name: 'artifactId', version: 'version'. This recipe replaces dependencies represented asMapswith an equivalent dependency represented as aString, as recommended per the Gradle best practices for dependencies to use a single GAV.
- Use
- org.openrewrite.gradle.EnableDevelocityBuildCache
- Enable Develocity build cache
- Adds
buildCacheconfiguration todevelocitywhere not yet present.
- org.openrewrite.gradle.MigrateDependenciesToVersionCatalog
- Migrate Gradle project dependencies to version catalog
- Migrates Gradle project dependencies to use the version catalog feature. Supports migrating dependency declarations of various forms: *
Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'* Property references:"group:artifact:$version"or"group:artifact:${version}"The recipe will: * Create agradle/libs.versions.tomlfile with version declarations * Replace dependency declarations with catalog references (e.g.,libs.springCore) * Migrate version properties fromgradle.propertiesto the version catalog * Preserve project dependencies unchanged Note: If a version catalog already exists, the recipe will not modify it.
- org.openrewrite.gradle.RemoveDependency
- Remove a Gradle dependency
- Removes a single dependency from the dependencies section of the
build.gradle.
- org.openrewrite.gradle.RemoveEnableFeaturePreview
- Remove an enabled Gradle preview feature
- Remove an enabled Gradle preview feature from
settings.gradle.
- org.openrewrite.gradle.RemoveExtension
- Remove build extension by name
- Remove a Gradle build extension from
settings.gradle(.kts)orbuild.gradle(.kts)files.
- org.openrewrite.gradle.RemoveRedundantDependencyVersions
- Remove redundant explicit dependencies and versions
- Remove explicitly-specified dependency versions that are managed by a Gradle
platform,enforcedPlatformor theio.spring.dependency-managementplugin. Also removes redundant direct dependencies and dependency constraints that are already satisfied by transitive dependencies.
- org.openrewrite.gradle.RemoveRedundantSecurityResolutionRules
- Remove redundant security resolution rules
- Remove
resolutionStrategy.eachDependencyrules that pin dependencies to versions that are already being managed by a platform/BOM to equal or newer versions. Only removes rules that have a security advisory identifier (CVE or GHSA) in thebecauseclause, unless a custom pattern is specified.
- org.openrewrite.gradle.RemoveRepository
- Remove repository
- Removes a repository from Gradle build scripts. Named repositories include "jcenter", "mavenCentral", "mavenLocal", and "google".
- org.openrewrite.gradle.UpdateGradleWrapper
- Update Gradle wrapper
- Update the version of Gradle used in an existing Gradle wrapper. Queries services.gradle.org to determine the available releases, but prefers the artifact repository URL which already exists within the wrapper properties file. If your artifact repository does not contain the same Gradle distributions as services.gradle.org, then the recipe may suggest a version which is not available in your artifact repository.
- org.openrewrite.gradle.UpdateJavaCompatibility
- Update Gradle project Java compatibility
- Find and updates the Java compatibility for the Gradle project.
- org.openrewrite.gradle.UpgradeDependencyVersion
- Upgrade Gradle dependency versions
- Upgrade the version of a dependency in a build.gradle file. Supports updating dependency declarations of various forms: *
Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'Can update version numbers which are defined earlier in the same file in variable declarations.
- org.openrewrite.gradle.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle dependencies
- Upgrades the version of a transitive dependency in a Gradle build file. There are many ways to do this in Gradle, so the mechanism for upgrading a transitive dependency must be considered carefully depending on your style of dependency management.
- org.openrewrite.gradle.gradle8.JacocoReportDeprecations
- Replace Gradle 8 introduced deprecations in JaCoCo report task
- Set the
enabledtorequiredand thedestinationtooutputLocationfor Reports deprecations that were removed in gradle 8. See the gradle docs on this topic.
- org.openrewrite.gradle.plugins.AddBuildPlugin
- Add Gradle plugin
- Add a build plugin to a Gradle build file's
pluginsblock.
- org.openrewrite.gradle.plugins.AddDevelocityGradlePlugin
- Add the Develocity Gradle plugin
- Add the Develocity Gradle plugin to settings.gradle files.
- org.openrewrite.gradle.plugins.AddSettingsPlugin
- Add Gradle settings plugin
- Add plugin to Gradle settings file
pluginsblock by id.
- org.openrewrite.gradle.plugins.AddSettingsPluginRepository
- Add a Gradle settings repository
- Add a Gradle settings repository to
settings.gradle(.kts).
- org.openrewrite.gradle.plugins.ChangePlugin
- Change a Gradle plugin
- Changes the selected Gradle plugin to the new plugin.
- org.openrewrite.gradle.plugins.ChangePluginVersion
- Change a Gradle plugin version by id
- Change a Gradle plugin by id to a later version.
- org.openrewrite.gradle.plugins.MigrateGradleEnterpriseToDevelocity
- Migrate from Gradle Enterprise to Develocity
- Migrate from the Gradle Enterprise Gradle plugin to the Develocity Gradle plugin.
- org.openrewrite.gradle.plugins.RemoveBuildPlugin
- Remove Gradle plugin
- Remove plugin from Gradle
pluginsblock by its id. Does not remove plugins from thebuildscriptblock.
- org.openrewrite.gradle.plugins.RemoveDevelocityConfiguration
- Remove Develocity configuration
- Remove the Develocity Gradle plugin and associated configuration.
- org.openrewrite.gradle.plugins.RemoveSettingsPlugin
- Remove Gradle settings plugin
- Remove plugin from Gradle settings file
pluginsblock by id.
- org.openrewrite.gradle.plugins.UpgradePluginVersion
- Update a Gradle plugin by id
- Update a Gradle plugin by id to a later version defined by the plugins DSL. To upgrade a plugin dependency defined by
buildscript.dependencies, use theUpgradeDependencyVersionrecipe instead.
- org.openrewrite.gradle.search.DependencyInsight
- Gradle dependency insight
- Find direct and transitive dependencies matching a group, artifact, resolved version, and optionally a configuration name. Results include dependencies that either directly match or transitively include a matching dependency.
- org.openrewrite.gradle.search.DoesNotIncludeDependency
- Does not include Gradle dependency
- A precondition which returns false if visiting a Gradle file which includes the specified dependency in the classpath of some scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.gradle.search.EffectiveGradlePluginRepositories
- List effective Gradle plugin repositories
- Lists the Gradle plugin repositories that would be used for plugin resolution, in order of precedence. This includes Maven repositories defined in the settings.gradle pluginManagement section and build.gradle buildscript repositories as determined when the LST was produced.
- org.openrewrite.gradle.search.EffectiveGradleRepositories
- List effective Gradle project repositories
- Lists the Gradle project repositories that would be used for dependency resolution, in order of precedence. This includes Maven repositories defined in the Gradle build files and settings as determined when the LST was produced.
- org.openrewrite.gradle.search.FindDependency
- Find Gradle dependency
- Finds dependencies declared in gradle build files. See the reference on Gradle configurations or the diagram below for a description of what configuration to use. A project's compile and runtime classpath is based on these configurations. <img alt="Gradle compile classpath" src="https://docs.gradle.org/current/userguide/img/java-library-ignore-deprecated-main.png" width="200px"/> A project's test classpath is based on these configurations. <img alt="Gradle test classpath" src="https://docs.gradle.org/current/userguide/img/java-library-ignore-deprecated-test.png" width="200px"/>.
- org.openrewrite.gradle.search.FindDependencyHandler
- Find Gradle
dependenciesblocks - Find the dependency handler containing any number of dependency definitions.
- Find Gradle
- org.openrewrite.gradle.search.FindGradleProject
- Find Gradle projects
- Gradle projects are those with
build.gradleorbuild.gradle.ktsfiles.
- org.openrewrite.gradle.search.FindGradleWrapper
- Find Gradle wrappers
- Find Gradle wrappers.
- org.openrewrite.gradle.search.FindJVMTestSuites
- Find Gradle JVMTestSuite plugin configuration
- Find Gradle JVMTestSuite plugin configurations and produce a data table.
- org.openrewrite.gradle.search.FindPlugins
- Find Gradle plugin
- Find a Gradle plugin by id and/or class name. For best results both should be specified, as one cannot automatically be used to infer the other.
- org.openrewrite.gradle.search.FindRepository
- Find Gradle repository
- Find a Gradle repository by url.
- org.openrewrite.gradle.search.ModuleHasDependency
- Module has dependency
- Searches for Gradle Projects (modules) that have a dependency matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file that use the dependency, use theFindDependencyrecipe instead.
- org.openrewrite.gradle.search.ModuleHasPlugin
- Module has plugin
- Searches for Gradle Projects (modules) that have a plugin matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project with a matching plugin. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that apply the spring dependency management plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindPluginsrecipe instead.
- org.openrewrite.gradle.security.UseHttpsForRepositories
- Use HTTPS for repositories
- Use HTTPS for repository URLs.
org.openrewrite:rewrite-groovy
License: Apache License Version 2.0
4 recipes
- org.openrewrite.groovy.format.AutoFormat
- Format Groovy code
- Format Groovy code using a standard comprehensive set of Groovy formatting recipes.
- org.openrewrite.groovy.format.GStringCurlyBraces
- Groovy GString curly braces
- In Groovy GStrings, curly braces are optional for single variable expressions. This recipe adds them, so that the expression is always surrounded by curly braces.
- org.openrewrite.groovy.format.OmitParenthesesForLastArgumentLambda
- Move a closure which is the last argument of a method invocation out of parentheses
- Groovy allows a shorthand syntax that allows a closure to be placed outside of parentheses.
- org.openrewrite.groovy.format.OmitParenthesesFormat
- Stylize Groovy code to omit parentheses
- Omit parentheses for last argument lambdas in Groovy code.
org.openrewrite:rewrite-hcl
License: Apache License Version 2.0
11 recipes
- org.openrewrite.hcl.DeleteContent
- Delete content
- Delete HCL content by path.
- org.openrewrite.hcl.MoveContentToFile
- Move content to another file
- Move content to another HCL file, deleting it in the original file.
- org.openrewrite.hcl.ReplaceLegacyAttributeIndexSyntax
- Replace legacy attribute index syntax
- Replace legacy attribute index syntax (
.0) with the new syntax ([0]).
- org.openrewrite.hcl.format.AutoFormat
- Format HCL code
- Format HCL code using a standard comprehensive set of HCL formatting recipes.
- org.openrewrite.hcl.format.BlankLines
- Blank lines
- Add and/or remove blank lines.
- org.openrewrite.hcl.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.hcl.format.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove any extra trailing whitespace from the end of each line.
- org.openrewrite.hcl.format.Spaces
- Spaces
- Format whitespace in HCL code.
- org.openrewrite.hcl.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in HCL code.
- org.openrewrite.hcl.search.FindAndReplaceLiteral
- Find and replace literals in HCL files
- Find and replace literal values in HCL files. This recipe parses the source files on which it runs as HCL, meaning you can execute HCL language-specific recipes before and after this recipe in a single recipe run.
- org.openrewrite.hcl.search.FindContent
- Find content
- Find HCL content by path.
org.openrewrite:rewrite-java
License: Apache License Version 2.0
96 recipes
- org.openrewrite.java.AddCommentToImport
- Add comment to import statement
- Add a comment to an import statement in a Java source file.
- org.openrewrite.java.AddCommentToMethod
- Add comment to method declarations
- Add a comment to method declarations in a Java source file.
- org.openrewrite.java.AddCommentToMethodInvocations
- Add comment to method invocations
- Add a comment to method invocations in a Java source file.
- org.openrewrite.java.AddLicenseHeader
- Add license header
- Adds license headers to Java source files when missing. Does not override existing license headers.
- org.openrewrite.java.AddLiteralMethodArgument
- Add a literal method argument
- Add a literal
Stringor primitive argument to method invocations.
- org.openrewrite.java.AddMethodParameter
- Add method parameter to a method declaration
- Adds a new method parameter to an existing method declaration.
- org.openrewrite.java.AddNullMethodArgument
- Add a
nullmethod argument - Add a
nullargument to method invocations.
- Add a
- org.openrewrite.java.AddOrUpdateAnnotationAttribute
- Add or update annotation attribute
- Some annotations accept arguments. This recipe sets an existing argument to the specified value, or adds the argument if it is not already set.
- org.openrewrite.java.ChangeAnnotationAttributeName
- Change annotation attribute name
- Some annotations accept arguments. This recipe renames an existing attribute.
- org.openrewrite.java.ChangeMethodAccessLevel
- Change method access level
- Change the access level (public, protected, private, package private) of a method.
- org.openrewrite.java.ChangeMethodInvocationReturnType
- Change method invocation return type
- Changes the return type of a method invocation.
- org.openrewrite.java.ChangeMethodName
- Change method name
- Rename a method.
- org.openrewrite.java.ChangeMethodTargetToStatic
- Change method target to static
- Change method invocations to static method calls.
- org.openrewrite.java.ChangeMethodTargetToVariable
- Change method target to variable
- Change method invocations to method calls on a variable.
- org.openrewrite.java.ChangePackage
- Rename package name
- A recipe that will rename a package name in package statements, imports, and fully-qualified types.
- org.openrewrite.java.ChangePackageInStringLiteral
- Rename package name in String literals
- A recipe that will rename a package name in String literals.
- org.openrewrite.java.ChangeStaticFieldToMethod
- Change static field access to static method access
- Migrate accesses to a static field to invocations of a static method.
- org.openrewrite.java.ChangeType
- Change type
- Change a given type to another.
- org.openrewrite.java.ChangeTypeInStringLiteral
- Change type in String literals
- Change a given type to another when used in a String literal.
- org.openrewrite.java.CreateEmptyJavaClass
- Create Java class
- Create a new, empty Java class.
- org.openrewrite.java.DeleteMethodArgument
- Delete method argument
- Delete an argument from method invocations.
- org.openrewrite.java.InlineMethodCalls
- Inline method calls
- Inline method calls using a template replacement pattern. Supports both method invocations and constructor calls, with optional imports.
- org.openrewrite.java.NoStaticImport
- Remove static import
- Removes static imports and replaces them with qualified references. For example,
emptyList()becomesCollections.emptyList().
- org.openrewrite.java.OrderImports
- Order imports
- Groups and orders import statements. If a style has been defined, this recipe will order the imports according to that style. If no style is detected, this recipe will default to ordering imports in the same way that IntelliJ IDEA does.
- org.openrewrite.java.RandomizeId
- Randomize tree IDs
- Scramble the IDs. This was intended as a utility to test en masse different techniques for UUID generation and compare their relative performance outside a microbenchmark.
- org.openrewrite.java.RecipeMarkupDemonstration
- Demonstrate rendering of
Markupmarkers - Tooling may decide to elide or display differently markup of different levels.
- Demonstrate rendering of
- org.openrewrite.java.RemoveAnnotation
- Remove annotation
- Remove matching annotations wherever they occur.
- org.openrewrite.java.RemoveAnnotationAttribute
- Remove annotation attribute
- Some annotations accept arguments. This recipe removes an existing attribute.
- org.openrewrite.java.RemoveImplements
- Remove interface implementations
- Removes
implementsclauses from classes implementing the specified interface. Removes@Overridesannotations from methods which no longer override anything.
- org.openrewrite.java.RemoveMethodInvocations
- Remove method invocations
- Remove method invocations if syntactically safe.
- org.openrewrite.java.RemoveMethodThrows
- Remove elements from a method declaration
throwsclause - Remove specific, or all exceptions from a method declaration
throwsclause.
- Remove elements from a method declaration
- org.openrewrite.java.RemoveObjectsIsNull
- Transform calls to
Objects.isNull(..)andObjects.nonNull(..) - Replace calls to
Objects.isNull(..)andObjects.nonNull(..)with a simple null check. Using these methods outside of stream predicates is not idiomatic.
- Transform calls to
- 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.ReorderMethodArguments
- Reorder method arguments
- Reorder method arguments into the specified order.
- org.openrewrite.java.ReplaceAnnotation
- Replace annotation
- Replace an Annotation with another one if the annotation pattern matches. Only fixed parameters can be set in the replacement.
- org.openrewrite.java.ReplaceConstant
- Replace constant with literal value
- Replace a named constant with a literal value when you wish to remove the old constant. A
Stringliteral must include escaped quotes.
- org.openrewrite.java.ReplaceConstantWithAnotherConstant
- Replace constant with another constant
- Replace a constant with another constant, adding/removing import on class if needed.
- org.openrewrite.java.ReplaceMethodInvocationWithConstant
- Replace method invocation with constant
- Replace all method invocations matching the method pattern with the specified constant.
- org.openrewrite.java.ReplaceStringLiteralValue
- Replace
Stringliteral - Replace the value of a complete
Stringliteral.
- Replace
- org.openrewrite.java.ReplaceStringLiteralWithConstant
- Replace String literal with constant
- Replace String literal with constant, adding import on class if needed.
- org.openrewrite.java.ShortenFullyQualifiedTypeReferences
- Add imports for fully qualified references to types
- Any fully qualified references to Java types will be replaced with corresponding simple names and import statements, provided that it doesn't result in any conflicts with other imports or types declared in the local compilation unit.
- org.openrewrite.java.SimplifyMethodChain
- Simplify a call chain
- Simplify
a.b().c()toa.d().
- org.openrewrite.java.SimplifySingleElementAnnotation
- Simplify single-element annotation
- This recipe will remove the attribute
valueon single-element annotations. According to JLS, a single-element annotation, is a shorthand designed for use with single-element annotation types.
- org.openrewrite.java.UpdateSourcePositions
- Update source positions
- Calculate start position and length for every LST element.
- org.openrewrite.java.UseStaticImport
- Use static import
- Removes unnecessary receiver types from static method invocations. For example,
Collections.emptyList()becomesemptyList().
- org.openrewrite.java.ai.ClassDefinitionLength
- Calculate token length of classes
- Locates class definitions and predicts the number of token in each.
- org.openrewrite.java.ai.MethodDefinitionLength
- Calculate token length of method definitions
- Locates method definitions and predicts the number of token in each.
- org.openrewrite.java.format.AutoFormat
- Format Java code
- Format Java code using a standard comprehensive set of Java formatting recipes.
- org.openrewrite.java.format.BlankLines
- Blank lines
- Add and/or remove blank lines.
- 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.MethodParamPad
- Method parameter padding
- Fixes whitespace padding between the identifier of a method definition or method invocation and the left parenthesis of the parameter list. For example, when configured to remove spacing,
someMethodInvocation (x);becomessomeMethodInvocation(x).
- org.openrewrite.java.format.NoWhitespaceAfter
- No whitespace after
- Removes unnecessary whitespace appearing after a token. A linebreak after a token is allowed unless
allowLineBreaksis set tofalse, in which case it will be removed.
- org.openrewrite.java.format.NoWhitespaceBefore
- No whitespace before
- Removes unnecessary whitespace preceding a token. A linebreak before a token will be removed unless
allowLineBreaksis set totrue.
- org.openrewrite.java.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.java.format.NormalizeLineBreaks
- Normalize line breaks
- Consistently use either Windows style (CRLF) or Linux style (LF) line breaks. If no
GeneralFormatStyleis specified this will use whichever style of line endings are more common.
- org.openrewrite.java.format.NormalizeTabsOrSpaces
- Normalize to tabs or spaces
- Consistently use either tabs or spaces in indentation.
- org.openrewrite.java.format.PadEmptyForLoopComponents
- Pad empty
forloop components - Fixes padding on empty
forloop iterators and initializers to match Checkstyle policies.
- Pad empty
- org.openrewrite.java.format.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove any extra trailing whitespace from the end of each line.
- org.openrewrite.java.format.SingleLineComments
- Single line comments begin with a whitespace
- Write
// hiinstead of//hi.
- org.openrewrite.java.format.Spaces
- Spaces
- Format whitespace in Java code.
- org.openrewrite.java.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in Java code.
- org.openrewrite.java.format.TypecastParenPad
- Typecast parentheses padding
- Fixes whitespace padding between a typecast type identifier and the enclosing left and right parenthesis. For example, when configured to remove spacing,
( int ) 0L;becomes(int) 0L;.
- org.openrewrite.java.format.WrappingAndBraces
- Wrapping and braces
- Format line wraps and braces in Java code.
- org.openrewrite.java.search.ClasspathTypeCounts
- Study the size of the classpath by source set
- Emit one data table row per source set in a project, with the number of types in the source set.
- org.openrewrite.java.search.DoesNotUseType
- Check whether a type is not in use
- Useful as a precondition to skip over compilation units using the argument type.
- org.openrewrite.java.search.FindAnnotations
- Find annotations
- Find all annotations matching the annotation pattern.
- org.openrewrite.java.search.FindClassHierarchy
- Find class hierarchy
- Discovers all class declarations within a project, recording which files they appear in, their superclasses, and interfaces. That information is then recorded in a data table.
- org.openrewrite.java.search.FindComments
- Find within comments and literals
- Find regular expression matches within comments and literals. "Literals" includes string literals, character literals, and numeric literals.
- org.openrewrite.java.search.FindCompileErrors
- Find compile errors
- Compile errors result in a particular LST structure that can be searched for.
- org.openrewrite.java.search.FindDeprecatedClasses
- Find uses of deprecated classes
- Find uses of deprecated classes, optionally ignoring those classes that are inside deprecated scopes.
- org.openrewrite.java.search.FindDeprecatedFields
- Find uses of deprecated fields
- Find uses of deprecated fields in any API.
- org.openrewrite.java.search.FindDeprecatedMethods
- Find uses of deprecated methods
- Find uses of deprecated methods in any API.
- org.openrewrite.java.search.FindDeprecatedUses
- Find uses of deprecated classes, methods, and fields
- Find deprecated uses of methods, fields, and types. Optionally ignore those classes that are inside deprecated scopes.
- org.openrewrite.java.search.FindDistinctMethods
- Find distinct methods in use
- A sample of every distinct method in use in a repository. The code sample in the method calls data table will be a representative use of the method, though there may be many other such uses of the method.
- 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.search.FindFields
- Find fields
- Find uses of a field.
- org.openrewrite.java.search.FindFieldsOfType
- Find fields of type
- Finds declared fields matching a particular class name.
- org.openrewrite.java.search.FindImplementations
- Find implementing classes
- Find class declarations which implement the specified type. If the specified type is a class, its subclasses will be matched. If the specified type is an interface, classes which implement it will be matched.
- org.openrewrite.java.search.FindImports
- Find source files with imports
- Locates source files that have imports matching the given type pattern, regardless of whether that import is used in the code.
- org.openrewrite.java.search.FindLiterals
- Find literals
- Find literals matching a pattern.
- org.openrewrite.java.search.FindMethodDeclaration
- Find method declaration
- Locates the declaration of a method.
- org.openrewrite.java.search.FindMethods
- Find method usages
- Find method calls by pattern.
- org.openrewrite.java.search.FindMissingTypes
- Find missing type information on Java LSTs
- This is a diagnostic recipe to highlight where LSTs are missing type attribution information.
- org.openrewrite.java.search.FindRepeatableAnnotations
- Find uses of
@Repeatableannotations - Java 8 introduced the concept of
@Repeatableannotations.
- Find uses of
- org.openrewrite.java.search.FindTypeMappings
- Find type mappings
- Study the frequency of
Jtypes and theirJavaTypetype attribution.
- org.openrewrite.java.search.FindTypes
- Find types
- Find type references by name.
- org.openrewrite.java.search.HasBuildToolVersion
- Find files with a particular build tool version
- Finds Java source files built with a particular build tool. This is useful especially as a precondition for other recipes.
- org.openrewrite.java.search.HasJavaVersion
- Find files compiled at a specific Java version
- Finds Java source files matching a particular language level. This is useful especially as a precondition for other recipes.
- org.openrewrite.java.search.HasMethod
- Find files that have at least one use of a method
- Marks files that have at least one occurrence of a method matching a pattern.
- org.openrewrite.java.search.HasMinimumJavaVersion
- Find the oldest Java version in use
- The oldest Java version in use is the lowest Java version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Java 8, but a test source set uses Java 17. In this case, the oldest Java version in use is Java 8.
- org.openrewrite.java.search.HasSourceSet
- Find files in a source set
- Source sets are a way to organize your source code into logical groups. For example, Java projects commonly have a
mainsource set for application code and atestsource set for test code. This recipe will find all files in a given source set.
- org.openrewrite.java.search.HasType
- Find files that have at least one use of a type
- Marks files that have at least one occurrence of a type, even if the name of that type doesn't appear in the source code.
- org.openrewrite.java.search.IsLikelyNotTest
- Find files that are likely not tests
- Sources that do not contain indicators of being, or being exclusively for the use in tests. This recipe is simply a negation of the
org.openrewrite.java.search.IsLikelyTestrecipe.
- org.openrewrite.java.search.IsLikelyTest
- Find sources that are likely tests
- Sources that contain indicators of being, or being exclusively for the use in tests. This recipe is not exhaustive, but is intended to be a good starting point for finding test sources. Looks at the source set name, and types in use; for example looks for uses of JUnit & TestNG annotations/assertions.
- org.openrewrite.java.search.ResultOfMethodCallIgnored
- Result of method call ignored
- Find locations where the result of the method call is being ignored.
org.openrewrite:rewrite-javascript
License: Moderne Source Available License
1 recipe
- org.openrewrite.javascript.search.DependencyInsight
- Node.js dependency insight
- Find direct and transitive npm dependencies matching a package name pattern. Results include dependencies that either directly match or transitively include a matching dependency.
org.openrewrite:rewrite-json
License: Apache License Version 2.0
10 recipes
- org.openrewrite.json.AddKeyValue
- Add value to JSON Object
- Adds a
valueat the specifiedkeyPathwith the specifiedkey, if the key doesn't already exist.
- org.openrewrite.json.ChangeKey
- Change key
- Change a JSON mapping entry key, while leaving the value intact.
- org.openrewrite.json.ChangeValue
- Change value
- Change a JSON mapping entry value leaving the key intact.
- org.openrewrite.json.CopyValue
- Copy JSON value
- Copies a JSON value from one key to another. The existing key/value pair remains unaffected by this change. Attempts to create the new key if it does not exist.
- org.openrewrite.json.CreateJsonFile
- Create JSON file
- Create a new JSON file.
- org.openrewrite.json.DeleteKey
- Delete key
- Delete a JSON mapping entry key.
- org.openrewrite.json.format.AutoFormat
- Format JSON
- Format JSON code using a standard comprehensive set of JSON formatting recipes.
- org.openrewrite.json.format.Indents
- JSON indent
- Format tabs and indents in JSON.
- org.openrewrite.json.format.WrappingAndBraces
- JSON new lines
- Split members into separate lines in JSON.
- org.openrewrite.json.search.FindKey
- Find JSON object members
- Find JSON object members by JsonPath expression.
org.openrewrite:rewrite-kotlin
License: Apache License Version 2.0
11 recipes
- org.openrewrite.kotlin.FindKotlinSources
- Find Kotlin sources and collect data metrics
- Use data table to collect source files types and counts of files with extensions
.kt.
- org.openrewrite.kotlin.OrderImports
- Order Kotlin imports
- Groups and orders import statements. If a style has been defined, this recipe will order the imports according to that style. If no style is detected, this recipe will default to ordering imports in the same way that IntelliJ IDEA does.
- org.openrewrite.kotlin.RenameTypeAlias
- Rename type alias
- Change the name of a given type alias.
- 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’sequals()function. It is, therefore, redundant to callequals()as a function. Also,==and!=are more general thanequals()and!equals()because it allows either of both operands to benull. Developers usingequals()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.
- Structural equality tests should use
- org.openrewrite.kotlin.cleanup.ImplicitParameterInLambda
itshouldn't be used as a lambda parameter nameitis 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.kotlin.cleanup.RemoveLambdaArgumentParentheses
- Remove method invocation parentheses around single lambda argument
- For example, convert
1.let({ it + 1 })to1.let { it + 1 }.
- org.openrewrite.kotlin.cleanup.RemoveTrailingComma
- Remove trailing comma in Kotlin
- Remove trailing commas in variable, parameter, and class property lists.
- org.openrewrite.kotlin.cleanup.RemoveTrailingSemicolon
- Remove unnecessary trailing semicolon
- Some Java programmers may mistakenly add semicolons at the end when writing Kotlin code, but in reality, they are not necessary.
- org.openrewrite.kotlin.cleanup.ReplaceCharToIntWithCode
- Replace
Char#toInt()withChar#code - Replace the usage of the deprecated
Char#toInt()withChar#code. Please ensure that your Kotlin version is 1.5 or later to support theChar#codeproperty. Note that the current implementation does not perform a Kotlin version check.
- Replace
- org.openrewrite.kotlin.cleanup.UnnecessaryTypeParentheses
- Remove unnecessary parentheses on Kotlin types
- In Kotlin, it's possible to add redundant nested parentheses in type definitions. This recipe is designed to remove those unnecessary parentheses.
- org.openrewrite.kotlin.format.AutoFormat
- Format Kotlin code
- Format Kotlin code using a standard comprehensive set of Kotlin formatting recipes.
org.openrewrite:rewrite-maven
License: Apache License Version 2.0
76 recipes
- org.openrewrite.maven.AddAnnotationProcessor
- Add an annotation processor to
maven-compiler-plugin - Add an annotation processor to the maven compiler plugin. Will not do anything if it already exists. Also doesn't add anything when no other annotation processors are defined yet. (Perhaps
ChangePluginConfigurationcan be used).
- Add an annotation processor to
- org.openrewrite.maven.AddCommentToMavenDependency
- Add a comment to a
Mavendependency - Adds a comment as the first element in a
Mavendependency.
- Add a comment to a
- org.openrewrite.maven.AddDependency
- Add Maven dependency
- Add a Maven dependency to a
pom.xmlfile in the correct scope based on where it is used.
- org.openrewrite.maven.AddDevelocityMavenExtension
- Add the Develocity Maven extension
- To integrate the Develocity Maven extension into Maven projects, ensure that the
develocity-maven-extensionis added to the.mvn/extensions.xmlfile if not already present. Additionally, configure the extension by adding the.mvn/develocity.xmlconfiguration file.
- org.openrewrite.maven.AddManagedDependency
- Add managed Maven dependency
- Add a managed Maven dependency to a
pom.xmlfile.
- org.openrewrite.maven.AddParentPom
- Add Maven parent
- Add a parent pom to a Maven pom.xml. Does nothing if a parent pom is already present.
- org.openrewrite.maven.AddPlugin
- Add Maven plugin
- Add the specified Maven plugin to the pom.xml.
- org.openrewrite.maven.AddPluginDependency
- Add Maven plugin dependencies
- Adds the specified dependencies to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.AddProfile
- Add Maven profile
- Add a maven profile to a
pom.xmlfile.
- org.openrewrite.maven.AddProperty
- Add Maven project property
- Add a new property to the Maven project property. Prefers to add the property to the parent if the project has multiple modules.
- org.openrewrite.maven.AddRepository
- Add repository
- Adds a new Maven Repository or updates a matching repository.
- org.openrewrite.maven.AddRuntimeConfig
- Add a configuration option for the Maven runtime
- Add a new configuration option for the Maven runtime if not already present.
- org.openrewrite.maven.ChangeDependencyClassifier
- Change Maven dependency classifier
- Add or alter the classifier of the specified dependency.
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId
- Change Maven dependency
- Change a Maven dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before. Matching<dependencyManagement>coordinates are also updated if anewVersionorversionPatternis provided.
- org.openrewrite.maven.ChangeDependencyScope
- Change Maven dependency scope
- Add or alter the scope of the specified dependency.
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId
- Change Maven managed dependency groupId, artifactId and optionally the version
- Change the groupId, artifactId and optionally the version of a specified Maven managed dependency.
- org.openrewrite.maven.ChangePackaging
- Set Maven project packaging
- Sets the packaging type of Maven projects. Either adds the packaging tag if it is missing or changes its context if present.
- org.openrewrite.maven.ChangeParentPom
- Change Maven parent
- Change the parent pom of a Maven pom.xml by matching the existing parent via groupId and artifactId, and updating it to a new groupId, artifactId, version, and optional relativePath. Also updates the project to retain dependency management and properties previously inherited from the old parent that are no longer provided by the new parent. Removes redundant dependency versions already managed by the new parent.
- org.openrewrite.maven.ChangePluginConfiguration
- Change Maven plugin configuration
- Apply the specified configuration to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.ChangePluginDependencies
- Change Maven plugin dependencies
- Applies the specified dependencies to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.ChangePluginExecutions
- Change Maven plugin executions
- Apply the specified executions to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.ChangePluginGroupIdAndArtifactId
- Change Maven plugin group and artifact ID
- Change the groupId and/or the artifactId of a specified Maven plugin. Optionally update the plugin version. This recipe does not perform any validation and assumes all values passed are valid.
- org.openrewrite.maven.ChangeProjectVersion
- Change Maven Project Version
- Change the project version of a Maven pom.xml. Identifies the project to be changed by its groupId and artifactId. If the version is defined as a property, this recipe will only change the property value if the property exists within the same pom.
- org.openrewrite.maven.ChangePropertyValue
- Change Maven project property value
- Changes the specified Maven project property value leaving the key intact.
- org.openrewrite.maven.EnableDevelocityBuildCache
- Enable Develocity build cache
- Add Develocity build cache configuration to any
.mvn/Develocity configuration file that lack existing configuration.
- org.openrewrite.maven.ExcludeDependency
- Exclude Maven dependency
- Exclude specified dependency from any dependency that transitively includes it.
- org.openrewrite.maven.IncrementProjectVersion
- Increment Maven project version
- Increase Maven project version by incrementing either the major, minor, or patch version as defined by semver. Other versioning schemes are not supported.
- org.openrewrite.maven.ManageDependencies
- Manage dependencies
- Make existing dependencies managed by moving their version to be specified in the dependencyManagement section of the POM.
- org.openrewrite.maven.ManagedToRuntimeDependencies
- Convert managed dependencies to runtime dependencies
- This recipe processes Maven POMs, converting all
<dependencyManagement>entries into runtime scoped<dependencies>entries. Import scoped BOMs (like jackson-bom) are left unmodified in<dependencyManagement>. Some style guidelines prefer that<dependencyManagement>be used only for BOMs. This maintain that style while avoiding introducing new symbols onto the compile classpath unintentionally.
- org.openrewrite.maven.ModernizeObsoletePoms
- Modernize obsolete Maven poms
- Very old Maven poms are no longer supported by current versions of Maven. This recipe updates poms with
<pomVersion>3</pomVersion>to<modelVersion>4.0.0</modelVersion>of the Maven pom schema. This does not attempt to upgrade old dependencies or plugins and is best regarded as the starting point of a migration rather than an end-point.
- org.openrewrite.maven.OrderPomElements
- Order POM elements
- Order POM elements according to the recommended order.
- org.openrewrite.maven.RemoveDependency
- Remove Maven dependency
- Removes a single dependency from the <dependencies> section of the pom.xml.
- org.openrewrite.maven.RemoveDuplicateDependencies
- Remove duplicate Maven dependencies
- Removes duplicated dependencies in the
<dependencies>and<dependencyManagement>sections of thepom.xml.
- org.openrewrite.maven.RemoveDuplicatePluginDeclarations
- Remove duplicate plugin declarations
- Maven 4 rejects duplicate plugin declarations (same groupId and artifactId) with an error. This recipe removes duplicate plugin declarations, keeping only the first occurrence.
- org.openrewrite.maven.RemoveExclusion
- Remove exclusion
- Remove any matching exclusion from any matching dependency.
- org.openrewrite.maven.RemoveManagedDependency
- Remove Maven managed dependency
- Removes a single managed dependency from the <dependencyManagement><dependencies> section of the pom.xml.
- org.openrewrite.maven.RemovePlugin
- Remove Maven plugin
- Remove the specified Maven plugin from the POM.
- org.openrewrite.maven.RemovePluginDependency
- Remove Maven plugin dependency
- Removes a dependency from the <dependencies> section of a plugin in the pom.xml.
- org.openrewrite.maven.RemoveProperty
- Remove Maven project property
- Removes the specified Maven project property from the pom.xml.
- org.openrewrite.maven.RemoveRedundantDependencyVersions
- Remove redundant explicit dependency and plugin versions
- Remove explicitly-specified dependency/plugin versions when a parent POM's
dependencyManagement/pluginManagementspecifies the version.
- org.openrewrite.maven.RemoveRedundantProperties
- Remove redundant properties
- Remove properties when a parent POM specifies the same property.
- org.openrewrite.maven.RemoveRepository
- Remove repository
- Removes a matching Maven repository.
- org.openrewrite.maven.RemoveUnusedProperties
- Remove unused properties
- Detect and remove Maven property declarations which do not have any usage within the project.
- org.openrewrite.maven.RenamePropertyKey
- Rename Maven property key
- Rename the specified Maven project property key leaving the value unchanged.
- org.openrewrite.maven.UpdateMavenProjectPropertyJavaVersion
- Update Maven Java project properties
- The Java version is determined by several project properties, including: *
java.version*jdk.version*javaVersion*jdkVersion*maven.compiler.source*maven.compiler.target*maven.compiler.release*release.versionIf none of these properties are in use and the maven compiler plugin is not otherwise configured, adds themaven.compiler.releaseproperty.
- org.openrewrite.maven.UpdateMavenWrapper
- Update Maven wrapper
- Update the version of Maven used in an existing Maven wrapper.
- org.openrewrite.maven.UpdateScmFromGitOrigin
- Update SCM with Git origin
- Updates or adds the Maven
<scm>tag based on the Git remote origin. By default, only existing Source Control Management (SCM) sections are updated. SetaddIfMissingtotrueto also add missing SCM sections.
- org.openrewrite.maven.UpgradeDependencyVersion
- Upgrade Maven dependency version
- Upgrade the version of a dependency by specifying a group and (optionally) an artifact using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
- org.openrewrite.maven.UpgradeParentVersion
- Upgrade Maven parent project version
- Set the parent pom version number according to a version selector or to a specific version number.
- org.openrewrite.maven.UpgradePluginVersion
- Upgrade Maven plugin version
- Upgrade the version of a plugin using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
- org.openrewrite.maven.UpgradeTransitiveDependencyVersion
- Upgrade transitive Maven dependencies
- Upgrades the version of a transitive dependency in a Maven pom file. Leaves direct dependencies unmodified. Can be paired with the regular Upgrade Dependency Version recipe to upgrade a dependency everywhere, regardless of whether it is direct or transitive.
- org.openrewrite.maven.UseMavenCompilerPluginReleaseConfiguration
- Use Maven compiler plugin release configuration
- Replaces any explicit
sourceortargetconfiguration (if present) on themaven-compiler-pluginwithrelease, and updates thereleasevalue if needed. Will not downgrade the Java version if the current version is higher.
- org.openrewrite.maven.UseParentInference
- Use Maven 4 parent inference
- Maven 4.1.0 supports automatic parent version inference when using a relative path. This recipe simplifies parent declarations by using the shorthand
<parent/>form when the parent is in the default location (..), removing the explicit<relativePath>,<groupId>,<artifactId>, and<version>elements. Maven automatically infers these values from the parent POM.
- org.openrewrite.maven.cleanup.DependencyManagementDependencyRequiresVersion
- Dependency management dependencies should have a version
- If they don't have a version, they can't possibly affect dependency resolution anywhere, and can be safely removed.
- org.openrewrite.maven.cleanup.ExplicitDependencyVersion
- Add explicit dependency versions
- Add explicit dependency versions to POMs for reproducibility, as the
LATESTandRELEASEversion keywords are deprecated.
- org.openrewrite.maven.cleanup.ExplicitPluginGroupId
- Add explicit
groupIdto Maven plugins - Add the default
<groupId>org.apache.maven.plugins</groupId>to plugins for clarity.
- Add explicit
- org.openrewrite.maven.cleanup.ExplicitPluginVersion
- Add explicit plugin versions
- Add explicit plugin versions to POMs for reproducibility, as MNG-4173 removes automatic version resolution for POM plugins.
- org.openrewrite.maven.plugin.DependencyPluginGoalResolveSources
- Migrate to
maven-dependency-plugingoalresolve-sources - Migrate from
sourcestoresolve-sourcesfor themaven-dependency-plugin.
- Migrate to
- org.openrewrite.maven.search.DependencyInsight
- Maven dependency insight
- Find direct and transitive dependencies matching a group, artifact, and scope. Results include dependencies that either directly match or transitively include a matching dependency.
- org.openrewrite.maven.search.DoesNotIncludeDependency
- Does not include Maven dependency
- A precondition which returns false if visiting a Maven pom which includes the specified dependency in the classpath of some scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.maven.search.EffectiveDependencies
- Effective dependencies
- Emit the data of binary dependency relationships.
- org.openrewrite.maven.search.EffectiveManagedDependencies
- Effective managed dependencies
- Emit the data of binary dependency relationships.
- org.openrewrite.maven.search.EffectiveMavenRepositories
- List effective Maven repositories
- Lists the Maven repositories that would be used for dependency resolution, in order of precedence. This includes Maven repositories defined in the Maven settings file (and those contributed by active profiles) as determined when the LST was produced.
- org.openrewrite.maven.search.FindDependency
- Find Maven dependency
- Finds first-order dependency uses, i.e. dependencies that are defined directly in a project.
- org.openrewrite.maven.search.FindManagedDependency
- Find Maven dependency management entry
- Finds first-order dependency management entries, i.e. dependencies that are defined directly in a project.
- org.openrewrite.maven.search.FindMavenProject
- Find Maven projects
- Maven projects are
pom.xmlfiles with aMavenResolutionResultmarker.
- org.openrewrite.maven.search.FindMavenSettings
- Find effective maven settings
- List the effective maven settings file for the current project.
- org.openrewrite.maven.search.FindPlugin
- Find Maven plugin
- Finds a Maven plugin within a pom.xml.
- org.openrewrite.maven.search.FindProperties
- Find Maven project properties
- Finds the specified Maven project properties within a pom.xml.
- org.openrewrite.maven.search.FindRepositoryOrder
- Maven repository order
- Determine the order in which dependencies will be resolved for each
pom.xmlbased on its defined repositories and effectivesettings.xml.
- org.openrewrite.maven.search.FindScm
- Find SCM tag
- Finds any
<scm>tag directly inside the<project>root of a Maven pom.xml file.
- org.openrewrite.maven.search.ModuleHasDependency
- Module has dependency
- Searches for Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindDependencyrecipe instead.
- org.openrewrite.maven.search.ModuleHasPlugin
- Module has plugin
- Searches for Maven modules that have a plugin matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching plugin. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that apply the spring boot plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindPluginsrecipe instead.
- org.openrewrite.maven.search.ParentPomInsight
- Maven parent insight
- Find Maven parents matching a
groupIdandartifactId.
- org.openrewrite.maven.security.UseHttpsForRepositories
- Use HTTPS for repositories
- Use HTTPS for repository URLs.
- org.openrewrite.maven.utilities.PrintMavenAsDot
- Print Maven dependency hierarchy in DOT format
- The DOT language format is specified here.
org.openrewrite:rewrite-properties
License: Apache License Version 2.0
7 recipes
- org.openrewrite.properties.AddProperty
- Add a new property
- Adds a new property to a property file. Attempts to place the new property in alphabetical order by the property keys. Whitespace before and after the
=must be included in the property and value.
- org.openrewrite.properties.AddPropertyComment
- Add comment before property key
- Add a new comment before a property key if not already present, optionally commenting out the property.
- org.openrewrite.properties.ChangePropertyKey
- Change property key
- Change a property key leaving the value intact.
- org.openrewrite.properties.ChangePropertyValue
- Change property value
- Change a property value leaving the key intact.
- org.openrewrite.properties.CreatePropertiesFile
- Create Properties file
- Create a new Properties file.
- org.openrewrite.properties.DeleteProperty
- Delete property by key
- Deletes key/value pairs from properties files, as well as any comments that immediately precede the key/value pair. Comments separated by two or more newlines from the deleted key/value pair are preserved.
- org.openrewrite.properties.search.FindProperties
- Find property
- Finds occurrences of a property key.
org.openrewrite:rewrite-toml
License: Apache License Version 2.0
10 recipes
- org.openrewrite.toml.ChangeKey
- Change TOML key
- Change a TOML key, while leaving the value intact.
- org.openrewrite.toml.ChangeTableRowValue
- Change TOML table row value
- Change a value in a TOML table row when the identifying property matches the specified matcher.
- org.openrewrite.toml.ChangeValue
- Change TOML value
- Change the value of a TOML key.
- org.openrewrite.toml.CreateTomlFile
- Create TOML file
- Create a new TOML file.
- org.openrewrite.toml.DeleteKey
- Delete TOML key
- Delete a TOML key-value pair.
- org.openrewrite.toml.DeleteTable
- Delete TOML table
- Delete a TOML table.
- org.openrewrite.toml.DeleteTableRow
- Delete TOML table row
- Delete a TOML table row when one of its values matches the specified matcher.
- org.openrewrite.toml.FindKey
- Find TOML keys
- Find TOML keys matching a path expression.
- org.openrewrite.toml.MergeTableRow
- Merge TOML table row
- Merge a TOML row into an array table. If a row with the same identifying property exists, merge the values. Otherwise, insert a new row.
- org.openrewrite.toml.ReplaceTableRow
- Replace TOML table row
- Replace a TOML table row with new content. If a row with the same identifying property exists, replace it entirely.
org.openrewrite:rewrite-xml
License: Apache License Version 2.0
27 recipes
- org.openrewrite.xml.AddCommentToXmlTag
- Add a comment to an XML tag
- Adds a comment as the first element in an XML tag.
- org.openrewrite.xml.AddOrUpdateChildTag
- Add or update child tag
- Adds or updates a child element below the parent(s) matching the provided
parentXPathexpression. If a child with the same name already exists, it will be replaced by default. Otherwise, a new child will be added. This ensures idempotent behaviour.
- org.openrewrite.xml.AddTagAttribute
- Add new XML attribute for an Element
- Add new XML attribute with value on a specified element.
- org.openrewrite.xml.ChangeNamespaceValue
- Change XML attribute of a specific resource version
- Alters XML Attribute value within specified element of a specific resource versions.
- org.openrewrite.xml.ChangeTagAttribute
- Change XML attribute
- Alters XML attribute value on a specified element.
- org.openrewrite.xml.ChangeTagName
- Change XML tag name
- Alters the name of XML tags matching the provided expression.
- org.openrewrite.xml.ChangeTagValue
- Change XML tag value
- Alters the value of XML tags matching the provided expression. When regex is enabled the replacement happens only for text nodes provided the pattern matches.
- org.openrewrite.xml.CreateXmlFile
- Create XML file
- Create a new XML file.
- org.openrewrite.xml.RemoveEmptyXmlTags
- Remove empty XML Tag
- Removes XML tags that do not have attributes or children, including self closing tags.
- org.openrewrite.xml.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove any extra trailing whitespace from the end of each line.
- org.openrewrite.xml.RemoveXmlTag
- Remove XML tag
- Removes XML tags matching the provided expression.
- org.openrewrite.xml.XsltTransformation
- XSLT transformation
- Apply the specified XSLT transformation on matching files. Note that there are no format matching guarantees when running this recipe.
- org.openrewrite.xml.format.AutoFormat
- Format XML
- Indents XML using the most common indentation size and tabs or space choice in use in the file.
- org.openrewrite.xml.format.LineBreaks
- Blank lines
- Add line breaks at appropriate places between XML syntax elements.
- org.openrewrite.xml.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.xml.format.NormalizeLineBreaks
- Normalize line breaks
- Consistently use either Windows style (CRLF) or Linux style (LF) line breaks. If no
GeneralFormatStyleis specified this will use whichever style of line endings are more common.
- org.openrewrite.xml.format.NormalizeTabsOrSpaces
- Normalize to tabs or spaces
- Consistently use either tabs or spaces in indentation.
- org.openrewrite.xml.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in XML code.
- org.openrewrite.xml.search.DoesNotUseNamespaceUri
- Find files without Namespace URI
- Find XML root elements that do not have a specific Namespace URI, optionally restricting the search by an XPath expression.
- org.openrewrite.xml.search.FindNamespacePrefix
- Find XML namespace prefixes
- Find XML namespace prefixes, optionally restricting the search by a XPath expression.
- org.openrewrite.xml.search.FindTags
- Find XML tags
- Find XML tags by XPath expression.
- org.openrewrite.xml.search.HasNamespaceUri
- Find XML namespace URIs
- Find XML namespace URIs, optionally restricting the search by a XPath expression.
- org.openrewrite.xml.security.AddOwaspDateBoundSuppressions
- Add date bounds to OWASP suppressions
- Adds an expiration date to all OWASP suppressions in order to ensure that they are periodically reviewed. For use with the OWASP
dependency-checktool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
- org.openrewrite.xml.security.IsOwaspSuppressionsFile
- Find OWASP vulnerability suppression XML files
- These files are used to suppress false positives in OWASP Dependency Check.
- org.openrewrite.xml.security.RemoveOwaspSuppressions
- Remove out-of-date OWASP suppressions
- Remove all OWASP suppressions with a suppression end date in the past, as these are no longer valid. For use with the OWASP
dependency-checktool. More details on OWASP suppression files can be found here.
- org.openrewrite.xml.security.UpdateOwaspSuppressionDate
- Update OWASP suppression date bounds
- Updates the expiration date for OWASP suppressions having a matching cve tag. For use with the OWASP
dependency-checktool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
- org.openrewrite.xml.style.AutodetectDebug
- XML style Auto-detection debug
- Runs XML Autodetect and records the results in data tables and search markers. A debugging tool for figuring out why XML documents get styled the way they do.
org.openrewrite:rewrite-yaml
License: Apache License Version 2.0
17 recipes
- org.openrewrite.yaml.AppendToSequence
- Append to sequence
- Append item to YAML sequence.
- org.openrewrite.yaml.ChangeKey
- Change key
- Change a YAML mapping entry key while leaving the value intact.
- org.openrewrite.yaml.ChangePropertyKey
- Change property key
- Change a YAML property key while leaving the value intact. Expects dot notation for nested YAML mappings, similar to how Spring Boot interprets
application.ymlfiles.
- org.openrewrite.yaml.ChangePropertyValue
- Change YAML property
- Change a YAML property. Expects dot notation for nested YAML mappings, similar to how Spring Boot interprets
application.ymlfiles.
- org.openrewrite.yaml.ChangeValue
- Change value
- Change a YAML mapping entry value while leaving the key intact.
- org.openrewrite.yaml.CoalesceProperties
- Coalesce YAML properties
- Simplify nested map hierarchies into their simplest dot separated property form, similar to how Spring Boot interprets
application.ymlfiles.
- org.openrewrite.yaml.CommentOutProperty
- Comment out property
- Comment out a YAML property and add a comment in front.
- org.openrewrite.yaml.CopyValue
- Copy YAML value
- Copies a YAML value from one key to another. The existing key/value pair remains unaffected by this change. Attempts to merge the copied value into the new key if it already exists. Attempts to create the new key if it does not exist.
- org.openrewrite.yaml.CreateYamlFile
- Create YAML file
- Create a new YAML file.
- org.openrewrite.yaml.DeleteKey
- Delete key
- Delete a YAML mapping entry key.
- org.openrewrite.yaml.DeleteProperty
- Delete property
- Delete a YAML property. Nested YAML mappings are interpreted as dot separated property names, i.e. as Spring Boot interprets application.yml files like
a.b.c.dora.b.c:d.
- org.openrewrite.yaml.MergeYaml
- Merge YAML snippet
- Merge a YAML snippet with an existing YAML document.
- org.openrewrite.yaml.UnfoldProperties
- Unfold YAML properties
- Transforms dot-separated property keys in YAML files into nested map hierarchies to enhance clarity and readability, or for compatibility with tools expecting structured YAML.
- org.openrewrite.yaml.cleanup.RemoveUnused
- Remove unused YAML
- Remove YAML mappings and sequence keys that have no value.
- org.openrewrite.yaml.format.Indents
- YAML indent
- Format tabs and indents in YAML.
- org.openrewrite.yaml.search.FindKey
- Find YAML entries
- Find YAML entries that match the specified JsonPath expression.
- org.openrewrite.yaml.search.FindProperty
- Find YAML properties
- Find YAML properties that match the specified
propertyKey. Expects dot notation for nested YAML mappings, similar to how Spring Boot interpretsapplication.ymlfiles.
other
License: Unknown
1513 recipes
- ai.timefold.solver.migration.ChangeVersion
- Change the Timefold version
- Replaces the version of Timefold
- ai.timefold.solver.migration.FromOptaPlannerToTimefoldSolver
- Migrate from OptaPlanner to Timefold Solver
- Replaces your method/field calls, GAVs, etc. To replace deprecated methods too, use the recipe ToLatest
- ai.timefold.solver.migration.ToLatest
- Upgrade to the latest Timefold Solver
- Replace all your calls to deleted/deprecated types and methods of Timefold Solver with their proper alternatives.
- com.google.guava.InlineGuavaMethods
- Inline
guavamethods annotated with@InlineMe - Automatically generated recipes to inline method calls based on
@InlineMeannotations discovered in the type table.
- Inline
- io.moderne.ai.FindAgentsInUse
- Find AI agents configuration files
- Scans codebases to identify usage of AI agents by looking at the agent configuration files present in the repository.
- io.moderne.ai.FindLibrariesInUse
- Find AI libraries in use
- Scans codebases to identify usage of AI services. Detects AI libraries across Java dependencies. Useful for auditing and understanding AI integration patterns.
- io.moderne.ai.FindModelsInUse
- Find AI models in use
- Scans codebases to identify usage of Large Language Models (LLMs). Detects model references and configuration patterns across Java classes, properties files, YAML configs... Useful for identifying model usage.
- 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.
- io.moderne.cryptography.PostQuantumCryptography
- Post quantum cryptography
- This recipe searches for instances in code that may be impacted by post quantum cryptography. Applications may need to support larger key sizes, different algorithms, or use crypto agility to handle the migration. The recipe includes detection of hardcoded values that affect behavior in a post-quantum world, programmatic configuration that may prevent algorithm changes, and general cryptographic usage patterns that should be reviewed.
- io.moderne.devcenter.ApacheDevCenter
- DevCenter for Apache
- A DevCenter that tracks the latest Apache Maven parent POM versions and applies best practices.
- io.moderne.devcenter.ApacheMavenBestPractices
- Apache Maven best practices
- A collection of recipes that apply best practices to Maven POMs. Some of these recipes affect build stability, so they are reported as security issues in the DevCenter card.
- io.moderne.devcenter.ApacheMavenDevCenter
- DevCenter for Apache Maven
- A DevCenter that tracks the latest Apache Maven parent POM versions and applies best practices. This DevCenter includes recipes to upgrade the parent POMs of Apache Maven, as well as a collection of best practices for Maven POMs.
- io.moderne.devcenter.DevCenterStarter
- DevCenter
- This is a default DevCenter configuration that can be used as a starting point for your own DevCenter configuration. It includes a combination of upgrades, migrations, and security fixes. You can customize this configuration to suit your needs. For more information on how to customize your DevCenter configuration, see the DevCenter documentation.
- io.moderne.devcenter.QuarkusDevCenter
- DevCenter for Quarkus
- A DevCenter that tracks the latest Quarkus framework versions and applies best practices. This DevCenter includes recipes to upgrade Quarkus versions, migrate from deprecated APIs, and ensure compatibility with the latest Java versions and testing frameworks.
- io.moderne.devcenter.SecurityStarter
- OWASP top ten
- This recipe is a starter card to reveal common OWASP Top 10 issues in your source code. You can customize this configuration to suit your needs. For more information on how to customize your DevCenter configuration, see the DevCenter documentation.
- io.moderne.devcenter.UpgradeApacheParent
- Upgrade Apache Parent POM
- Upgrades the Apache parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenParent
- Upgrade Apache Maven Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenPluginsParent
- Upgrade Maven Plugins Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenSharedParent
- Upgrade Maven Shared Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeQuarkus3_x
- Upgrade to Quarkus 3.26
- Upgrades Quarkus dependencies to version 3.26.x, including core, extensions, and tooling.
- io.moderne.devcenter.UpgradeQuarkusUniverseBom
- Upgrade Quarkus Universe BOM
- Upgrades the Quarkus Universe BOM parent to the latest version.
- io.moderne.elastic.elastic9.ChangeApiNumericFieldTypes
- Change numeric field types for Elasticsearch 9
- Handles changes between different numeric types (
LongtoInteger,inttoLong...) in Elasticsearch 9 API responses by adding appropriate conversion methods with null checks.
- 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.RenameApiFields
- Rename API fields for Elasticsearch 9
- Renames various API response fields from
valueBodyto align with Elasticsearch 9 specifications.
- io.moderne.hibernate.MigrateToHibernate66
- Migrate to Hibernate 6.6.x (Moderne Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.6.x.
- io.moderne.hibernate.MigrateToHibernate70
- Migrate to Hibernate 7.0.x (Moderne Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 7.0.x.
- io.moderne.hibernate.MigrateToHibernate71
- Migrate to Hibernate 7.1.x (Moderne Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 7.0.x.
- io.moderne.hibernate.MigrateToHibernate72
- Migrate to Hibernate 7.2.x (Moderne Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 7.2.x.
- io.moderne.hibernate.update66.MigrateCascadeTypes
- Migrate Hibernate CascadeType constants (Moderne Edition)
- Moving away from deprecated Hibernate CascadeType constants. CascadeType.SAVE_UPDATE -> CascadeType.PERSIST and/or CascadeType.MERGE, CascadeType.DELETE -> CascadeType.REMOVE.
- io.moderne.hibernate.update70.MigrateToHibernate7JFR
- Migrate to Hibernate 7 JFR APIs (Moderne Edition)
- Migrates deprecated JFR integration APIs to their Hibernate 7 replacements.
EventManagerbecomesEventMonitorandHibernateMonitoringEventbecomesDiagnosticEvent.
- 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
JRXlsExporterto the newJRXlsxExporterclass 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.
- io.moderne.java.spring.boot.SpringToSpringBoot
- Migrate Spring Framework to Spring Boot
- Migrate non Spring Boot applications to the latest compatible Spring Boot release. This recipe will modify an application's build files introducing Maven dependency management for Spring Boot, or adding the Gradle Spring Boot build plugin.
- io.moderne.java.spring.boot2.UpgradeSpringBoot_2_0
- Migrate to Spring Boot 2.0
- Migrate applications to the latest Spring Boot 2.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.0.
- io.moderne.java.spring.boot3.CommentDeprecations
- Comment deprecated methods in Spring 3.4
- Spring Boot 3.4 deprecates methods that are not commonly used or need manual interaction.
- io.moderne.java.spring.boot3.ReplaceTaskExecutorNameByApplicationTaskExecutorName
- Use bean name
applicationTaskExecutorinstead oftaskExecutor - Spring Boot 3.5 removed the bean name
taskExecutor. Where this bean name is used, the recipe replaces the bean name toapplicationTaskExecutor. This also includes instances where the developer provided their own bean namedtaskExecutor. This also includes scenarios where JSR-250's@Resourceannotation is used.
- Use bean name
- io.moderne.java.spring.boot3.ResolveDeprecationsSpringBoot_3_3
- Resolve Deprecations in Spring Boot 3.3
- Migrates Deprecations in the Spring Boot 3.3 Release. Contains the removal of
DefaultJmsListenerContainerFactoryConfigurer.setObservationRegistryand adds new parameter ofWebEndpointDiscovererconstructor.
- io.moderne.java.spring.boot3.SpringBoot34Deprecations
- Migrate Spring Boot 3.4 deprecated classes and methods
- Migrate deprecated classes and methods that have been marked for removal in Spring Boot 4.0. This includes constructor changes for
EntityManagerFactoryBuilder,HikariCheckpointRestoreLifecycle, and various actuator endpoint discovery classes.
- io.moderne.java.spring.boot3.SpringBoot35Deprecations
- Migrate Spring Boot 3.5 deprecated classes and methods
- Migrate deprecated classes and methods that have been marked for removal in Spring Boot 3.5.
- io.moderne.java.spring.boot3.SpringBoot3BestPractices
- Spring Boot 3.5 best practices
- Applies best practices to Spring Boot 3.5+ applications.
- io.moderne.java.spring.boot3.SpringBootProperties_3_4
- Migrate
@EndpointSecurity properties to 3.4 - Migrate the settings for Spring Boot Management Endpoint Security from
true|falsetoread-only|none.
- Migrate
- io.moderne.java.spring.boot3.UpdateOpenTelemetryResourceAttributes
- Update OpenTelemetry resource attributes
- The
service.groupresource attribute has been deprecated for OpenTelemetry in Spring Boot 3.5. Consider using alternative attributes or remove the deprecated attribute.
- io.moderne.java.spring.boot3.UpgradeGradle7Spring34
- Upgrade Gradle to 7.6.4+ for Spring Boot 3.4
- Spring Boot 3.4 requires Gradle 7.6.4.
- io.moderne.java.spring.boot3.UpgradeGradle8Spring34
- Upgrade Gradle 8 to 8.4+ for Spring Boot 3.4
- Spring Boot 3.4 requires Gradle 8.4+.
- io.moderne.java.spring.boot3.UpgradeMyBatisToSpringBoot_3_4
- Upgrade MyBatis to Spring Boot 3.4
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 3.4.
- io.moderne.java.spring.boot3.UpgradeSpringBoot_3_4
- Migrate to Spring Boot 3.4 (Moderne Edition)
- Migrate applications to the latest Spring Boot 3.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.4.
- io.moderne.java.spring.boot3.UpgradeSpringBoot_3_5
- Migrate to Spring Boot 3.5 (Moderne Edition)
- Migrate applications to the latest Spring Boot 3.5 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.5.
- io.moderne.java.spring.boot3.UpgradeSpringCloudAWSToSpringBoot_3_4
- Upgrade Spring Cloud AWS to Spring Boot 3.4 compatible version
- Upgrade the Spring Cloud AWS dependency to a version compatible with Spring Boot 3.4.
- io.moderne.java.spring.boot3.UpgradeSpringKafka_3_3
- Migrate to Spring Kafka 3.3
- Migrate applications to the latest Spring Kafka 3.3 release.
- io.moderne.java.spring.boot4.AddJackson2ForJerseyJson
- Add Jackson2 for Jersey using JSON
- Check whether a module uses Jersey on combination with JSON and adds the needed
spring-boot-jacksondependency and conditionallyspring-boot-jackson2dependency.
- io.moderne.java.spring.boot4.AddModularStarters
- Add Spring Boot 4.0 modular starters
- Add Spring Boot 4.0 starter dependencies based on package usage. Note: Higher-level starters (like data-jpa) include lower-level ones (like jdbc) transitively, so only the highest-level detected starter is added for each technology.
- io.moderne.java.spring.boot4.AddMongoDbRepresentationProperties
- Add MongoDB representation properties for UUID and BigDecimal
- Adds the 'spring.mongodb.representation.uuid' property with value 'standard' and the 'spring.data.mongodb.representation.big-decimal' property with the value 'decimal128' to Spring configuration files when a MongoDB dependency is detected.
- io.moderne.java.spring.boot4.AdoptJackson3
- Adopt jackson 3
- Adopt Jackson 3 which is supported by Spring Boot 4 and Jackson 2 support is deprecated.
- io.moderne.java.spring.boot4.MigrateSpringRetry
- Migrate Spring Retry to Spring Resilience
- Handle spring-retry not longer managed by Spring Boot and the possible migration to Spring Core Resilience.
- io.moderne.java.spring.boot4.MigrateToModularStarters
- Migrate to Spring Boot 4.0 modular starters
- Remove monolithic starters and adds the necessary Spring Boot 4.0 starter dependencies based on package usage, where any spring-boot-starter was used previously.
- io.moderne.java.spring.boot4.ModuleStarterRelocations
- Spring Boot 4.0 Module Starter Relocations
- Relocate types and packages for Spring Boot 4.0 modular starters.
- io.moderne.java.spring.boot4.UpgradeSpringBoot_4_0
- Migrate to Spring Boot 4.0 (Moderne Edition)
- Migrate applications to the latest Spring Boot 4.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 4.0.
- io.moderne.java.spring.cloud2020.SpringCloudProperties_2020
- Migrate Spring Cloud properties to 2020
- Migrate properties found in
application.propertiesandapplication.yml.
- io.moderne.java.spring.cloud2021.SpringCloudProperties_2021
- Migrate Spring Cloud properties to 2021
- Migrate properties found in
application.propertiesandapplication.yml.
- io.moderne.java.spring.cloud2022.SpringCloudProperties_2022
- Migrate Spring Cloud properties to 2022
- Migrate properties found in
application.propertiesandapplication.yml.
- io.moderne.java.spring.cloud2023.SpringCloudProperties_2023
- Migrate Spring Cloud properties to 2023
- Migrate properties found in
application.propertiesandapplication.yml.
- io.moderne.java.spring.cloud2024.SpringCloudProperties_2024
- Migrate Spring Cloud properties to 2024
- Migrate properties found in
application.propertiesandapplication.yml.
- io.moderne.java.spring.cloud2025.SpringCloudProperties_2025
- Migrate Spring Cloud properties to 2025
- Migrate properties found in
application.propertiesandapplication.yml.
- io.moderne.java.spring.cloud20251.SpringCloudProperties_2025_1
- Migrate Spring Cloud properties to 2025.1
- Migrate properties found in
application.propertiesandapplication.ymlfor Spring Cloud 2025.1 (Oakwood). This includes the stubrunner property prefix migration fromstubrunner.tospring.cloud.contract.stubrunner..
- io.moderne.java.spring.cloud20251.UpgradeSpringCloud_2025_1
- Upgrade to Spring Cloud 2025.1
- Upgrade to Spring Cloud 2025.1 (Oakwood). This release is based on Spring Framework 7 and Spring Boot 4. Each Spring Cloud project has been updated to version 5.0.0.
- io.moderne.java.spring.framework.MigrateDefaultResponseErrorHandler
- Migrate
DefaultResponseErrorHandler.handleErrormethod signature - Migrates overridden
handleError(ClientHttpResponse response)methods to the new signaturehandleError(URI url, HttpMethod method, ClientHttpResponse response)in classes extendingDefaultResponseErrorHandler. The old single-argument method was removed in Spring Framework 7.0.
- Migrate
- io.moderne.java.spring.framework.ModularSpringFrameworkDependencies
- Add Spring Framework modular dependencies
- Adds Spring Framework modular dependencies based on package usage, replacing legacy monolithic
org.springframework:spring.
- io.moderne.java.spring.orm.SpringORM5
- Migrate to Spring ORM to 5
- Migrate applications using Spring ORM Hibernate Support to Hibernate 5 compatible version. This will enable a further migration by the Spring Framework migration past 5.
- io.moderne.java.spring.security6.UpgradeSpringSecurity_6_5
- Migrate to Spring Security 6.5
- Migrate applications to the latest Spring Security 6.5 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- io.moderne.java.spring.security7.ModularizeSpringSecurity7
- Spring Security 7 modularization
- Spring Security Core was modularized in version 7, deprecated classes that are still a crucial part of some applications are moved to
spring-security-access.
- io.moderne.kafka.MigrateAdminListConsumerGroups
- Migrate
Admin.listConsumerGroups()tolistGroups() - Migrates the deprecated
Admin.listConsumerGroups()method tolistGroups()and updates related types for Kafka 4.1 compatibility.
- Migrate
- io.moderne.kafka.MigrateConsumerGroupStateToGroupState
- Migrate
ConsumerGroupStatetoGroupState - Migrates from the deprecated
ConsumerGroupStatetoGroupStatefor Kafka 4.0 compatibility.ConsumerGroupStatewas deprecated in favor ofGroupStatewhich supports both consumer groups and share groups.
- Migrate
- io.moderne.kafka.MigrateToKafka23
- Migrate to Kafka 2.3
- Migrate applications to the latest Kafka 2.3 release.
- io.moderne.kafka.MigrateToKafka24
- Migrate to Kafka 2.4
- Migrate applications to the latest Kafka 2.4 release.
- io.moderne.kafka.MigrateToKafka25
- Migrate to Kafka 2.5
- Migrate applications to the latest Kafka 2.5 release.
- io.moderne.kafka.MigrateToKafka26
- Migrate to Kafka 2.6
- Migrate applications to the latest Kafka 2.6 release.
- io.moderne.kafka.MigrateToKafka27
- Migrate to Kafka 2.7
- Migrate applications to the latest Kafka 2.7 release.
- io.moderne.kafka.MigrateToKafka28
- Migrate to Kafka 2.8
- Migrate applications to the latest Kafka 2.8 release.
- io.moderne.kafka.MigrateToKafka30
- Migrate to Kafka 3.0
- Migrate applications to the latest Kafka 3.0 release.
- io.moderne.kafka.MigrateToKafka31
- Migrate to Kafka 3.1
- Migrate applications to the latest Kafka 3.1 release.
- io.moderne.kafka.MigrateToKafka32
- Migrate to Kafka 3.2
- Migrate applications to the latest Kafka 3.2 release.
- io.moderne.kafka.MigrateToKafka33
- Migrate to Kafka 3.3
- Migrate applications to the latest Kafka 3.3 release.
- io.moderne.kafka.MigrateToKafka40
- Migrate to Kafka 4.0
- Migrate applications to the latest Kafka 4.0 release. This includes updating dependencies to 4.0.x, ensuring Java 11+ for clients and Java 17+ for brokers/tools, and handling changes.
- io.moderne.kafka.MigrateToKafka41
- Migrate to Kafka 4.1
- Migrate applications to the latest Kafka 4.1 release. This includes updating dependencies to 4.1.x, migrating deprecated Admin API methods, updating Streams configuration properties, and removing deprecated broker properties.
- io.moderne.kafka.UpgradeJavaForKafkaBroker
- Upgrade Java to 17+ for Kafka broker/tools
- Ensures Java 17 or higher is used when Kafka broker or tools dependencies are present.
- io.moderne.kafka.UpgradeJavaForKafkaClients
- Upgrade Java to 11+ for Kafka clients
- Ensures Java 11 or higher is used when Kafka client libraries are present.
- io.moderne.kafka.streams.MigrateJoinedNameMethod
- Migrate
Joined.named()toJoined.as() - In Kafka Streams 2.3,
Joined.named()was deprecated in favor ofJoined.as(). Additionally, thename()method was deprecated for removal and should not be used.
- Migrate
- io.moderne.kafka.streams.MigrateTaskAndThreadMetadata
- Migrate TaskMetadata and ThreadMetadata
- Migrates TaskMetadata and ThreadMetadata from org.apache.kafka.streams.processor package to org.apache.kafka.streams package, and updates TaskMetadata.taskId() calls to include .toString() for String compatibility.
- io.moderne.kafka.streams.ProcessingGuaranteeExactlyOnceToBeta
- Migrate
exactly_oncetoexactly_once_beta - Kafka Streams 2.6 introduces the exactly-once semantics v2, which is a more efficient implementation with improved internal handling. Though it is beta, it’s fully backward-compatible from the API standpoint, but internally it uses a different transaction/commit protocol. Starting from 3.0, it becomes the default "exactly_once_v2".
- Migrate
- io.moderne.kafka.streams.ProcessingGuaranteeExactlyOnceToV2
- Migrate
exactly_onceandexactly_once_betatoexactly_once_v2 - Kafka Streams 2.6 introduces the exactly-once semantics v2, which is a more efficient implementation with improved internal handling. Starting from 3.0, it becomes the default "exactly_once_v2".
- Migrate
- org.apache.logging.log4j.InlineLog4jApiMethods
- Inline
log4j-api-2methods annotated with@InlineMe - Automatically generated recipes to inline method calls based on
@InlineMeannotations discovered in the type table.
- Inline
- org.apache.wicket.BestPractices
- Wicket best practices
- Applies Wicket best practices such as minimizing anonymous inner classes and upgrading to the latest version.
- org.apache.wicket.MigrateToWicket10
- Migrate to Wicket 10.x
- Migrates Wicket 9.x to Wicket 10.x, as well as Java 17 and Jakarta.
- org.axonframework.migration.UpgradeAxonFramework_4_Jakarta
- Upgrade to Axonframework 4.x Jakarta
- Migration file to upgrade from an Axon Framework Javax-specific project to Jakarta.
- org.axonframework.migration.UpgradeAxonFramework_4_Javax
- Upgrade to Axonframework 4.x Javax
- Migration file to upgrade an Axon Framework Javax-specific project and remain on Javax.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_7_2
- Migrate to Android Gradle Plugin 7.2
- Recipes to migrate to Android Gradle Plugin version 7.2.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_7_3
- Migrate to Android Gradle Plugin 7.3
- Recipes to migrate to Android Gradle Plugin version 7.3.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_7_4
- Migrate to Android Gradle Plugin 7.4
- Recipes to migrate to Android Gradle Plugin version 7.4.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_0
- Migrate to Android Gradle Plugin 8.0
- Recipes to migrate to Android Gradle Plugin version 8.0.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_1
- Migrate to Android Gradle Plugin 8.1
- Recipes to migrate to Android Gradle Plugin version 8.1.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_2
- Migrate to Android Gradle Plugin 8.2
- Recipes to migrate to Android Gradle Plugin version 8.2.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_3
- Migrate to Android Gradle Plugin 8.3
- Recipes to migrate to Android Gradle Plugin version 8.3.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_4
- Migrate to Android Gradle Plugin 8.4
- Recipes to migrate to Android Gradle Plugin version 8.4.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_5
- Migrate to Android Gradle Plugin 8.5
- Recipes to migrate to Android Gradle Plugin version 8.5.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_6
- Migrate to Android Gradle Plugin 8.6
- Recipes to migrate to Android Gradle Plugin version 8.6.
- org.openrewrite.android.MigrateToAndroidGradlePlugin_8_7
- Migrate to Android Gradle Plugin 8.7
- Recipes to migrate to Android Gradle Plugin version 8.7.
- org.openrewrite.android.UpgradeToAndroidSDK33
- Upgrade to Android SDK 33
- Recipes to upgrade to Android SDK version 33.
- org.openrewrite.android.UpgradeToAndroidSDK34
- Upgrade to Android SDK 34
- Recipes to upgrade to Android SDK version 34.
- org.openrewrite.android.UpgradeToAndroidSDK35
- Upgrade to Android SDK 35
- Recipes to upgrade to Android SDK version 35.
- org.openrewrite.apache.commons.collections.UpgradeApacheCommonsCollections_3_4
- Migrates to Apache Commons Collections 4.x
- Migrate applications to the latest Apache Commons Collections 4.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.
- org.openrewrite.apache.commons.io.RelocateApacheCommonsIo
- Relocate
org.apache.commons:commons-iotocommons-io:commons-io - The deployment of
org.apache.commons:commons-iowas a publishing mistake around 2012 which was corrected by changing the deployment GAV to be located undercommons-io:commons-io.
- Relocate
- org.openrewrite.apache.commons.io.UseStandardCharsets
- Prefer
java.nio.charset.StandardCharsets - Prefer the Java standard library's
java.nio.charset.StandardCharsetsover third-party usage of apache'sorg.apache.commons.io.Charsets.
- Prefer
- org.openrewrite.apache.commons.io.UseSystemLineSeparator
- Prefer
System.lineSeparator() - Prefer the Java standard library's
System.lineSeparator()over third-party usage of apache'sIOUtils.LINE_SEPARATOR.
- Prefer
- org.openrewrite.apache.commons.lang.UpgradeApacheCommonsLang_2_3
- Migrates to Apache Commons Lang 3.x
- Migrate applications to the latest Apache Commons Lang 3.x release. This recipe modifies application's build files, and changes the package as per the migration release notes.
- org.openrewrite.apache.commons.lang.WordUtilsToCommonsText
- Migrate
WordUtilsto Apache Commons Text - Migrate
org.apache.commons.lang.WordUtilstoorg.apache.commons.text.WordUtilsand add the Commons Text dependency.
- Migrate
- org.openrewrite.apache.commons.lang3.UseStandardCharsets
- Prefer
java.nio.charset.StandardCharsets - Prefer the Java standard library's
java.nio.charset.StandardCharsetsoverorg.apache.commons.lang3.CharEncoding.
- Prefer
- 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.
- org.openrewrite.apache.httpclient4.MappingDeprecatedClasses
- Maps deprecated classes from Apache HttpClient 4.5.x to suggested replacements
- Uses new classes/methods instead of the deprecated ones.
- org.openrewrite.apache.httpclient4.UpgradeApacheHttpClient_4_5
- Migrates to ApacheHttpClient 4.5.x
- Migrate applications to the latest Apache HttpClient 4.5.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.
- org.openrewrite.apache.httpclient5.CredentialsStoreClear
- Migrate
clearto ApacheHttpClient 5.xCredentialsStore - Migrates
BasicCredentialsProvidermethodsclearto the newCredentialsStoreinterface.
- Migrate
- org.openrewrite.apache.httpclient5.CredentialsStoreSetCredentials
- Migrate
setCredentialsto ApacheHttpClient 5.xCredentialsStore - Migrates
BasicCredentialsProvidermethodssetCredentialsto the newCredentialsStoreinterface.
- Migrate
- org.openrewrite.apache.httpclient5.StatusLine
- Migrate to ApacheHttpClient 5.x deprecated methods from 4.x
- Migrates deprecated methods to their equivalent ones in 5.x.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpClientDependencies
- Migrate from org.apache.httpcomponents to ApacheHttpClient 5.x dependencies
- Adopt
org.apache.httpcomponents.client5:httpclient5fromorg.apache.httpcomponents.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5
- Migrate to ApacheHttpClient 5.x
- Migrate applications to the latest Apache HttpClient 5.x release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping
- Migrate to ApacheHttpClient 5.x Classes Namespace from 4.x
- Mapping of all the compatible classes of ApacheHttpClient 5.x from 4.x.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_DeprecatedMethods
- Migrate to ApacheHttpClient 5.x deprecated methods from 4.x
- Migrates deprecated methods to their equivalent ones in 5.x.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_TimeUnit
- Adds
TimeUnitto timeouts and duration methods - Apache HttpClient 5.x Timeout and duration methods need an extra the TimeUnit argument. This recipe uses milliseconds as a default unit.
- Adds
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpCoreNioDependencies
- Migrate from httpcore-nio to ApacheHttpClient 5.x core dependency
- Adopt
org.apache.httpcomponents.core5:httpcore5fromorg.apache.httpcomponents:httpcore-nio.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpCore_5_NioClassMapping
- Migrate to Apache HttpCore Nio Classes to Apache HttpCore 5.x
- Mapping of all the compatible classes of Apache HttpCore 5.x from Apache HttpCore Nio 4.4.x.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpCore_5_NioInputBuffers
- Migrate Apache HttpCore Nio Input Buffer classes to Apache HttpCore 5.x
- Mapping of specifically
*InputBufferclasses of Apache HttpCore 5.x from Apache HttpCore Nio 4.4.x.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpCore_5_NioOutputBuffers
- Migrate Apache HttpCore Nio Output Buffer classes to Apache HttpCore 5.x
- Mapping of specifically
*OutputBufferclasses of Apache HttpCore 5.x from Apache HttpCore Nio 4.4.x.
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpCore_5_NioUtilMapping
- Migrate to Apache HttpCore Nio Util Classes to Apache HttpCore 5.x
- Mapping of all the compatible utility classes of Apache HttpCore 5.x from Apache HttpCore Nio 4.4.x.
- org.openrewrite.apache.poi.UpgradeApachePoi_3_17
- Migrates to Apache POI 3.17
- Migrates to the last Apache POI 3.x release. This recipe modifies build files and makes changes to deprecated/preferred APIs that have changed between versions.
- org.openrewrite.codemods.cleanup.javascript.ArrowBodyStyle
- Require braces around arrow function bodies
- Require braces around arrow function bodies See rule details.
- org.openrewrite.codemods.cleanup.javascript.BetterRegex
- Improve regexes by making them shorter, consistent, and safer
- Improve regexes by making them shorter, consistent, and safer. See rule details.
- org.openrewrite.codemods.cleanup.javascript.CapitalizedComments
- Enforce or disallow capitalization of the first letter of a comment
- Enforce or disallow capitalization of the first letter of a comment See rule details.
- org.openrewrite.codemods.cleanup.javascript.CatchErrorName
- Enforce a specific parameter name in catch clauses
- Enforce a specific parameter name in catch clauses. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ConsistentDestructuring
- Use destructured variables over properties
- Use destructured variables over properties. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ConsistentTypeSpecifierStyle
- Enforce or ban the use of inline type-only markers for named imports
- Enforce or ban the use of inline type-only markers for named imports See rule details for import/consistent-type-specifier-style.
- org.openrewrite.codemods.cleanup.javascript.Curly
- Enforce consistent brace style for all control statements
- Enforce consistent brace style for all control statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.CustomErrorDefinition
- Enforce correct
Errorsubclassing - Enforce correct
Errorsubclassing. See rule details.
- Enforce correct
- org.openrewrite.codemods.cleanup.javascript.DotNotation
- Enforce dot notation whenever possible
- Enforce dot notation whenever possible See rule details.
- org.openrewrite.codemods.cleanup.javascript.EmptyBraceSpaces
- Enforce no spaces between braces
- Enforce no spaces between braces. See rule details.
- org.openrewrite.codemods.cleanup.javascript.Eqeqeq
- Require the use of
===and!== - Require the use of
===and!==See rule details.
- Require the use of
- org.openrewrite.codemods.cleanup.javascript.EscapeCase
- Require escape sequences to use uppercase values
- Require escape sequences to use uppercase values. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ExplicitLengthCheck
- Enforce explicitly comparing the length or size property of a value
- Enforce explicitly comparing the length or size property of a value. See rule details.
- org.openrewrite.codemods.cleanup.javascript.First
- Ensure all imports appear before other statements
- Ensure all imports appear before other statements See rule details for import/first.
- org.openrewrite.codemods.cleanup.javascript.LogicalAssignmentOperators
- Require or disallow logical assignment operator shorthand
- Require or disallow logical assignment operator shorthand See rule details.
- org.openrewrite.codemods.cleanup.javascript.MultilineCommentStyle
- Enforce a particular style for multiline comments
- Enforce a particular style for multiline comments See rule details.
- org.openrewrite.codemods.cleanup.javascript.NewForBuiltins
- Enforce the use of
newfor all builtins, exceptString,Number,Boolean,Symbol, andBigInt - Enforce the use of
newfor all builtins, exceptString,Number,Boolean,Symbol, andBigInt. See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.NewlineAfterImport
- Enforce a newline after import statements
- Enforce a newline after import statements See rule details for import/newline-after-import.
- org.openrewrite.codemods.cleanup.javascript.NoAbsolutePath
- Forbid import of modules using absolute paths
- Forbid import of modules using absolute paths See rule details for import/no-absolute-path.
- org.openrewrite.codemods.cleanup.javascript.NoArrayForEach
- Prefer
for…ofover theforEachmethod - Prefer
for…ofover theforEachmethod. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.NoArrayMethodThisArgument
- Disallow using the
thisargument in array methods - Disallow using the
thisargument in array methods. See rule details.
- Disallow using the
- org.openrewrite.codemods.cleanup.javascript.NoArrayPushPush
- Enforce combining multiple
Array#push()into one call - Enforce combining multiple
Array#push()into one call. See rule details.
- Enforce combining multiple
- org.openrewrite.codemods.cleanup.javascript.NoAwaitExpressionMember
- Disallow member access from
awaitexpression - Disallow member access from
awaitexpression. See rule details.
- Disallow member access from
- org.openrewrite.codemods.cleanup.javascript.NoConsoleSpaces
- Do not use leading/trailing space between
console.logparameters - Do not use leading/trailing space between
console.logparameters. See rule details.
- Do not use leading/trailing space between
- org.openrewrite.codemods.cleanup.javascript.NoDivRegex
- Disallow equal signs explicitly at the beginning of regular expressions
- Disallow equal signs explicitly at the beginning of regular expressions See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoDuplicates
- Forbid repeated import of the same module in multiple places
- Forbid repeated import of the same module in multiple places See rule details for import/no-duplicates.
- org.openrewrite.codemods.cleanup.javascript.NoElseReturn
- Disallow else blocks after return statements in if statements
- Disallow else blocks after return statements in if statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoEmptyNamedBlocks
- Forbid empty named import
- Forbid empty named import See rule details for import/no-empty-named-blocks.
- org.openrewrite.codemods.cleanup.javascript.NoExtraBind
- Disallow unnecessary calls to
.bind() - Disallow unnecessary calls to
.bind()See rule details.
- Disallow unnecessary calls to
- org.openrewrite.codemods.cleanup.javascript.NoExtraLabel
- Disallow unnecessary labels
- Disallow unnecessary labels See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoForLoop
- Do not use a
forloop that can be replaced with afor-ofloop - Do not use a
forloop that can be replaced with afor-ofloop. See rule details.
- Do not use a
- org.openrewrite.codemods.cleanup.javascript.NoHexEscape
- Enforce the use of Unicode escapes instead of hexadecimal escapes
- Enforce the use of Unicode escapes instead of hexadecimal escapes. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoImplicitCoercion
- Disallow shorthand type conversions
- Disallow shorthand type conversions See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoImportModuleExports
- Forbid import statements with CommonJS module.exports
- Forbid import statements with CommonJS module.exports See rule details for import/no-import-module-exports.
- org.openrewrite.codemods.cleanup.javascript.NoInstanceofArray
- Require
Array.isArray()instead ofinstanceof Array - Require
Array.isArray()instead ofinstanceof Array. See rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.NoLonelyIf
- Disallow if statements as the only statement in else blocks
- Disallow if statements as the only statement in else blocks See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNamespace
- Forbid namespace (a.k.a. "wildcard"
*) imports - Forbid namespace (a.k.a. "wildcard"
*) imports. See rule details for import/no-namespace.
- Forbid namespace (a.k.a. "wildcard"
- org.openrewrite.codemods.cleanup.javascript.NoNegatedCondition
- Disallow negated conditions
- Disallow negated conditions. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNestedTernary
- Disallow nested ternary expressions
- Disallow nested ternary expressions. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNewArray
- Disallow
new Array() - Disallow
new Array(). See rule details.
- Disallow
- org.openrewrite.codemods.cleanup.javascript.NoNewBuffer
- Enforce the use of
Buffer.from()andBuffer.alloc()instead of the deprecatednew Buffer() - Enforce the use of
Buffer.from()andBuffer.alloc()instead of the deprecatednew Buffer(). See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.NoNull
- Disallow the use of the
nullliteral - Disallow the use of the
nullliteral. See rule details.
- Disallow the use of the
- org.openrewrite.codemods.cleanup.javascript.NoRelativePackages
- Forbid importing packages through relative paths
- Forbid importing packages through relative paths See rule details for import/no-relative-packages.
- org.openrewrite.codemods.cleanup.javascript.NoStaticOnlyClass
- Disallow classes that only have static members
- Disallow classes that only have static members. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoTypeofUndefined
- Disallow comparing
undefinedusingtypeof - Disallow comparing
undefinedusingtypeof. See rule details.
- Disallow comparing
- org.openrewrite.codemods.cleanup.javascript.NoUndefInit
- Disallow initializing variables to undefined
- Disallow initializing variables to undefined See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnnecessaryAwait
- Disallow awaiting non-promise values
- Disallow awaiting non-promise values. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnneededTernary
- Disallow ternary operators when simpler alternatives exist
- Disallow ternary operators when simpler alternatives exist See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnreadableArrayDestructuring
- Disallow unreadable array destructuring
- Disallow unreadable array destructuring. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessComputedKey
- Disallow unnecessary computed property keys in objects and classes
- Disallow unnecessary computed property keys in objects and classes See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessFallbackInSpread
- Disallow useless fallback when spreading in object literals
- Disallow useless fallback when spreading in object literals. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessLengthCheck
- Disallow useless array
lengthcheck - Disallow useless array
lengthcheck. See rule details.
- Disallow useless array
- org.openrewrite.codemods.cleanup.javascript.NoUselessPathSegments
- Forbid unnecessary path segments in import and require statements
- Forbid unnecessary path segments in import and require statements See rule details for import/no-useless-path-segments.
- org.openrewrite.codemods.cleanup.javascript.NoUselessPromiseResolveReject
- Disallow returning/yielding
Promise.resolve()/reject()inasyncfunctions or promise callbacks - Disallow returning/yielding
Promise.resolve()/reject()inasyncfunctions or promise callbacks. See rule details.
- Disallow returning/yielding
- org.openrewrite.codemods.cleanup.javascript.NoUselessRename
- Disallow renaming import, export, and destructured assignments to the same name
- Disallow renaming import, export, and destructured assignments to the same name See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessReturn
- Disallow redundant return statements
- Disallow redundant return statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessSpread
- Disallow unnecessary spread
- Disallow unnecessary spread. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessUndefined
- Disallow useless
undefined - Disallow useless
undefined. See rule details.
- Disallow useless
- org.openrewrite.codemods.cleanup.javascript.NoVar
- Require
letorconstinstead ofvar - Require
letorconstinstead ofvarSee rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.NoZeroFractions
- Disallow number literals with zero fractions or dangling dots
- Disallow number literals with zero fractions or dangling dots. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NumberLiteralCase
- Enforce proper case for numeric literals
- Enforce proper case for numeric literals. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NumericSeparatorsStyle
- Enforce the style of numeric separators by correctly grouping digits
- Enforce the style of numeric separators by correctly grouping digits. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ObjectShorthand
- Require or disallow method and property shorthand syntax for object literals
- Require or disallow method and property shorthand syntax for object literals See rule details.
- org.openrewrite.codemods.cleanup.javascript.OneVar
- Enforce variables to be declared either together or separately in functions
- Enforce variables to be declared either together or separately in functions See rule details.
- org.openrewrite.codemods.cleanup.javascript.OperatorAssignment
- Require or disallow assignment operator shorthand where possible
- Require or disallow assignment operator shorthand where possible See rule details.
- org.openrewrite.codemods.cleanup.javascript.Order
- Enforce a convention in module import order
- Enforce a convention in module import order See rule details for import/order.
- org.openrewrite.codemods.cleanup.javascript.PreferAddEventListener
- Prefer
.addEventListener()and.removeEventListener()over on-functions - Prefer
.addEventListener()and.removeEventListener()over on-functions. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFind
- Prefer
.find()and.findLast()over the first or last element from.filter() - Prefer
.find()and.findLast()over the first or last element from.filter(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFlat
- Prefer
Array#flat()over legacy techniques to flatten arrays - Prefer
Array#flat()over legacy techniques to flatten arrays. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFlatMap
- Prefer
.flatMap()over.map().flat() - Prefer
.flatMap()over.map().flat(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayIndexOf
- Prefer
Array#{indexOf,lastIndexOf}()overArray#{findIndex,findLastIndex}()when looking for the index of an item - Prefer
Array#{indexOf,lastIndexOf}()overArray#{findIndex,findLastIndex}()when looking for the index of an item. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArraySome
- Prefer
.some()over.filter().lengthcheck and.{find,findLast}() - Prefer
.some()over.filter().lengthcheck and.{find,findLast}(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrowCallback
- Require using arrow functions for callbacks
- Require using arrow functions for callbacks See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferAt
- Prefer
.at()method for index access andString#charAt() - Prefer
.at()method for index access andString#charAt(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferConst
- Require const declarations for variables that are never reassigned after declared
- Require const declarations for variables that are never reassigned after declared See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDateNow
- Prefer
Date.now()to get the number of milliseconds since the Unix Epoch - Prefer
Date.now()to get the number of milliseconds since the Unix Epoch. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferDefaultParameters
- Prefer default parameters over reassignment
- Prefer default parameters over reassignment. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDestructuring
- Require destructuring from arrays and/or objects
- Require destructuring from arrays and/or objects See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeAppend
- Prefer
Node#append()overNode#appendChild() - Prefer
Node#append()overNode#appendChild(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeDataset
- Prefer using
.dataseton DOM elements over calling attribute methods - Prefer using
.dataseton DOM elements over calling attribute methods. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeRemove
- Prefer
childNode.remove()overparentNode.removeChild(childNode) - Prefer
childNode.remove()overparentNode.removeChild(childNode). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferExponentiationOperator
- Disallow the use of
Math.powin favor of the ** operator - Disallow the use of
Math.powin favor of the ** operator See rule details.
- Disallow the use of
- org.openrewrite.codemods.cleanup.javascript.PreferExportFrom
- Prefer
export…fromwhen re-exporting - Prefer
export…fromwhen re-exporting. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferIncludes
- Prefer
.includes()over.indexOf()andArray#some()when checking for existence or non-existence - Prefer
.includes()over.indexOf()andArray#some()when checking for existence or non-existence. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferJsonParseBuffer
- Prefer reading a JSON file as a buffer
- Prefer reading a JSON file as a buffer. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferKeyboardEventKey
- Prefer
KeyboardEvent#keyoverKeyboardEvent#keyCode - Prefer
KeyboardEvent#keyoverKeyboardEvent#keyCode. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferMathTrunc
- Enforce the use of
Math.trunc()instead of bitwise operators - Enforce the use of
Math.trunc()instead of bitwise operators. See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.PreferModernDomApis
- Prefer
.before()over.insertBefore(),.replaceWith()over.replaceChild(), prefer one of.before(),.after(),.append()or.prepend()overinsertAdjacentText()andinsertAdjacentElement() - Prefer
.before()over.insertBefore(),.replaceWith()over.replaceChild(), prefer one of.before(),.after(),.append()or.prepend()overinsertAdjacentText()andinsertAdjacentElement(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferModernMathApis
- Prefer modern Math APIs over legacy patterns
- Prefer modern Math APIs over legacy patterns. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferModule
- Prefer JavaScript modules (ESM) over CommonJS
- Prefer JavaScript modules (ESM) over CommonJS. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferNativeCoercionFunctions
- Prefer using
String,Number,BigInt,Boolean, andSymboldirectly - Prefer using
String,Number,BigInt,Boolean, andSymboldirectly. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferNegativeIndex
- Prefer negative index over
.length - indexwhen possible - Prefer negative index over
.length - indexwhen possible. See rule details.
- Prefer negative index over
- org.openrewrite.codemods.cleanup.javascript.PreferNodeProtocol
- Prefer using the
node:protocol when importing Node.js builtin modules - Prefer using the
node:protocol when importing Node.js builtin modules. See rule details.
- Prefer using the
- org.openrewrite.codemods.cleanup.javascript.PreferNumberProperties
- Prefer
Numberstatic properties over global ones - Prefer
Numberstatic properties over global ones. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferNumericLiterals
- Disallow
parseInt()andNumber.parseInt()in favor of binary, octal, and hexadecimal literals - Disallow
parseInt()andNumber.parseInt()in favor of binary, octal, and hexadecimal literals See rule details.
- Disallow
- org.openrewrite.codemods.cleanup.javascript.PreferObjectFromEntries
- Prefer using
Object.fromEntries()to transform a list of key-value pairs into an object - Prefer using
Object.fromEntries()to transform a list of key-value pairs into an object. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferObjectHasOwn
- Disallow use of
Object.prototype.hasOwnProperty.call()and prefer use ofObject.hasOwn() - Disallow use of
Object.prototype.hasOwnProperty.call()and prefer use ofObject.hasOwn() See rule details.
- Disallow use of
- org.openrewrite.codemods.cleanup.javascript.PreferObjectSpread
- Disallow using
Object.assignwith an object literal as the first argument and prefer the use of object spread instead - Disallow using
Object.assignwith an object literal as the first argument and prefer the use of object spread instead See rule details.
- Disallow using
- org.openrewrite.codemods.cleanup.javascript.PreferOptionalCatchBinding
- Prefer omitting the catch binding parameter
- Prefer omitting the catch binding parameter. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferPrototypeMethods
- Prefer borrowing methods from the prototype instead of the instance
- Prefer borrowing methods from the prototype instead of the instance. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferQuerySelector
- Prefer
.querySelector()over.getElementById(),.querySelectorAll()over.getElementsByClassName()and.getElementsByTagName() - Prefer
.querySelector()over.getElementById(),.querySelectorAll()over.getElementsByClassName()and.getElementsByTagName(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferReflectApply
- Prefer
Reflect.apply()overFunction#apply() - Prefer
Reflect.apply()overFunction#apply(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferRegexpTest
- Prefer
RegExp#test()overString#match()andRegExp#exec() - Prefer
RegExp#test()overString#match()andRegExp#exec(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSetHas
- Prefer
Set#has()overArray#includes()when checking for existence or non-existence - Prefer
Set#has()overArray#includes()when checking for existence or non-existence. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSetSize
- Prefer using
Set#sizeinstead ofArray#length - Prefer using
Set#sizeinstead ofArray#length. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferSpread
- Prefer the spread operator over
Array.from(),Array#concat(),Array#{slice,toSpliced}()andString#split('') - Prefer the spread operator over
Array.from(),Array#concat(),Array#{slice,toSpliced}()andString#split(''). See rule details.
- Prefer the spread operator over
- org.openrewrite.codemods.cleanup.javascript.PreferStringReplaceAll
- Prefer
String#replaceAll()over regex searches with the global flag - Prefer
String#replaceAll()over regex searches with the global flag. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringSlice
- Prefer
String#slice()overString#substr()andString#substring() - Prefer
String#slice()overString#substr()andString#substring(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringStartsEndsWith
- Prefer
String#startsWith()&String#endsWith()overRegExp#test() - Prefer
String#startsWith()&String#endsWith()overRegExp#test(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringTrimStartEnd
- Prefer
String#trimStart()/String#trimEnd()overString#trimLeft()/String#trimRight() - Prefer
String#trimStart()/String#trimEnd()overString#trimLeft()/String#trimRight(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSwitch
- Prefer
switchover multipleelse-if - Prefer
switchover multipleelse-if. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferTemplate
- Require template literals instead of string concatenation
- Require template literals instead of string concatenation See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferTernary
- Prefer ternary expressions over simple
if-elsestatements - Prefer ternary expressions over simple
if-elsestatements. See rule details.
- Prefer ternary expressions over simple
- org.openrewrite.codemods.cleanup.javascript.PreferTypeError
- Enforce throwing
TypeErrorin type checking conditions - Enforce throwing
TypeErrorin type checking conditions. See rule details.
- Enforce throwing
- org.openrewrite.codemods.cleanup.javascript.PreventAbbreviations
- Prevent abbreviations
- Prevent abbreviations. See rule details.
- org.openrewrite.codemods.cleanup.javascript.RelativeUrlStyle
- Enforce consistent relative URL style
- Enforce consistent relative URL style. See rule details.
- org.openrewrite.codemods.cleanup.javascript.RequireArrayJoinSeparator
- Enforce using the separator argument with
Array#join() - Enforce using the separator argument with
Array#join(). See rule details.
- Enforce using the separator argument with
- org.openrewrite.codemods.cleanup.javascript.RequireNumberToFixedDigitsArgument
- Enforce using the digits argument with
Number#toFixed() - Enforce using the digits argument with
Number#toFixed(). See rule details.
- Enforce using the digits argument with
- org.openrewrite.codemods.cleanup.javascript.SortImports
- Enforce sorted import declarations within modules
- Enforce sorted import declarations within modules See rule details.
- org.openrewrite.codemods.cleanup.javascript.SortVars
- Require variables within the same declaration block to be sorted
- Require variables within the same declaration block to be sorted See rule details.
- org.openrewrite.codemods.cleanup.javascript.Strict
- Require or disallow strict mode directives
- Require or disallow strict mode directives See rule details.
- org.openrewrite.codemods.cleanup.javascript.StringContent
- Enforce better string content
- Enforce better string content. See rule details.
- org.openrewrite.codemods.cleanup.javascript.SwitchCaseBraces
- Enforce consistent brace style for case clauses
- Enforce consistent brace style for case clauses. See rule details.
- org.openrewrite.codemods.cleanup.javascript.TemplateIndent
- Fix whitespace-insensitive template indentation
- Fix whitespace-insensitive template indentation. See rule details.
- org.openrewrite.codemods.cleanup.javascript.TextEncodingIdentifierCase
- Enforce consistent case for text encoding identifiers
- Enforce consistent case for text encoding identifiers. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ThrowNewError
- Require
newwhen throwing an error - Require
newwhen throwing an error. See rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.UnicodeBom
- Require or disallow Unicode byte order mark (BOM)
- Require or disallow Unicode byte order mark (BOM) See rule details.
- org.openrewrite.codemods.cleanup.javascript.Yoda
- Require or disallow "Yoda" conditions
- Require or disallow "Yoda" conditions See rule details.
- org.openrewrite.codemods.cleanup.jest.ConsistentTestIt
- Enforce test and it usage conventions
- Enforce test and it usage conventions See rule details for jest/consistent-test-it.
- org.openrewrite.codemods.cleanup.jest.NoAliasMethods
- Disallow alias methods
- Disallow alias methods See rule details for jest/no-alias-methods.
- org.openrewrite.codemods.cleanup.jest.NoDeprecatedFunctions27
- Disallow use of deprecated functions from before version 27
- Disallow use of deprecated functions from before version 27 See rule details for jest/no-deprecated-functions.
- org.openrewrite.codemods.cleanup.jest.NoJasmineGlobals
- Disallow Jasmine globals
- Disallow Jasmine globals See rule details for jest/no-jasmine-globals.
- org.openrewrite.codemods.cleanup.jest.NoTestPrefixes
- Require using .only and .skip over f and x
- Require using .only and .skip over f and x See rule details for jest/no-test-prefixes.
- org.openrewrite.codemods.cleanup.jest.NoUntypedMockFactory
- Disallow using jest.mock() factories without an explicit type parameter
- Disallow using jest.mock() factories without an explicit type parameter See rule details for jest/no-untyped-mock-factory.
- org.openrewrite.codemods.cleanup.jest.PreferComparisonMatcher
- Suggest using the built-in comparison matchers
- Suggest using the built-in comparison matchers See rule details for jest/prefer-comparison-matcher.
- org.openrewrite.codemods.cleanup.jest.PreferExpectResolves
- Prefer await expect(...).resolves over expect(await ...) syntax
- Prefer await expect(...).resolves over expect(await ...) syntax See rule details for jest/prefer-expect-resolves.
- org.openrewrite.codemods.cleanup.jest.PreferLowercaseTitle
- Enforce lowercase test names
- Enforce lowercase test names See rule details for jest/prefer-lowercase-title.
- org.openrewrite.codemods.cleanup.jest.PreferMockPromiseShorthand
- Prefer mock resolved/rejected shorthands for promises
- Prefer mock resolved/rejected shorthands for promises See rule details for jest/prefer-mock-promise-shorthand.
- org.openrewrite.codemods.cleanup.jest.PreferSpyOn
- Suggest using jest.spyOn()
- Suggest using jest.spyOn() See rule details for jest/prefer-spy-on.
- org.openrewrite.codemods.cleanup.jest.PreferToBe
- Suggest using toBe() for primitive literals
- Suggest using toBe() for primitive literals See rule details for jest/prefer-to-be.
- org.openrewrite.codemods.cleanup.jest.PreferToContain
- Suggest using toContain()
- Suggest using toContain() See rule details for jest/prefer-to-contain.
- org.openrewrite.codemods.cleanup.jest.PreferToHaveLength
- Suggest using toHaveLength()
- Suggest using toHaveLength() See rule details for jest/prefer-to-have-length.
- org.openrewrite.codemods.cleanup.jest.PreferTodo
- Suggest using test.todo
- Suggest using test.todo See rule details for jest/prefer-todo.
- org.openrewrite.codemods.cleanup.jest.RecommendedJestCodeCleanup
- Recommended Jest code cleanup
- Collection of cleanup ESLint rules that are recommended by eslint-plugin-jest.
- org.openrewrite.codemods.cleanup.jest.ValidTitle
- Enforce valid titles
- Enforce valid titles See rule details for jest/valid-title.
- org.openrewrite.codemods.cleanup.react.DestructuringAssignment
- Enforce consistent usage of destructuring assignment of props, state, and context
- Enforce consistent usage of destructuring assignment of props, state, and context See rule details for react/destructuring-assignment.
- org.openrewrite.codemods.cleanup.react.FunctionComponentDefinition
- Enforce a specific function type for function components
- Enforce a specific function type for function components See rule details for react/function-component-definition.
- org.openrewrite.codemods.cleanup.react.JsxBooleanValue
- Enforce boolean attributes notation in JSX
- Enforce boolean attributes notation in JSX See rule details for react/jsx-boolean-value.
- org.openrewrite.codemods.cleanup.react.JsxClosingBracketLocation
- Enforce closing bracket location in JSX
- Enforce closing bracket location in JSX See rule details for react/jsx-closing-bracket-location.
- org.openrewrite.codemods.cleanup.react.JsxClosingTagLocation
- Enforce closing tag location for multiline JSX
- Enforce closing tag location for multiline JSX See rule details for react/jsx-closing-tag-location.
- org.openrewrite.codemods.cleanup.react.JsxCurlyBracePresence
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes See rule details for react/jsx-curly-brace-presence.
- org.openrewrite.codemods.cleanup.react.JsxCurlyNewline
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions See rule details for react/jsx-curly-newline.
- org.openrewrite.codemods.cleanup.react.JsxCurlySpacing
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions See rule details for react/jsx-curly-spacing.
- org.openrewrite.codemods.cleanup.react.JsxEqualsSpacing
- Enforce or disallow spaces around equal signs in JSX attributes
- Enforce or disallow spaces around equal signs in JSX attributes See rule details for react/jsx-equals-spacing.
- org.openrewrite.codemods.cleanup.react.JsxFirstPropNewLine
- Enforce proper position of the first property in JSX
- Enforce proper position of the first property in JSX See rule details for react/jsx-first-prop-new-line.
- org.openrewrite.codemods.cleanup.react.JsxFragments
- Enforce shorthand or standard form for React fragments
- Enforce shorthand or standard form for React fragments See rule details for react/jsx-fragments.
- org.openrewrite.codemods.cleanup.react.JsxIndent
- Enforce JSX indentation
- Enforce JSX indentation See rule details for react/jsx-indent.
- org.openrewrite.codemods.cleanup.react.JsxIndentProps
- Enforce props indentation in JSX
- Enforce props indentation in JSX See rule details for react/jsx-indent-props.
- org.openrewrite.codemods.cleanup.react.JsxMaxPropsPerLine
- Enforce maximum of props on a single line in JSX
- Enforce maximum of props on a single line in JSX See rule details for react/jsx-max-props-per-line.
- org.openrewrite.codemods.cleanup.react.JsxNewline
- Require or prevent a new line after jsx elements and expressions
- Require or prevent a new line after jsx elements and expressions See rule details for react/jsx-newline.
- org.openrewrite.codemods.cleanup.react.JsxNoLeakedRender
- Disallow problematic leaked values from being rendered
- Disallow problematic leaked values from being rendered See rule details for react/jsx-no-leaked-render.
- org.openrewrite.codemods.cleanup.react.JsxNoTargetBlank
- Disallow target="_blank" attribute without rel="noreferrer"
- Disallow target="_blank" attribute without rel="noreferrer" See rule details for react/jsx-no-target-blank.
- org.openrewrite.codemods.cleanup.react.JsxNoUselessFragment
- Disallow unnecessary fragments
- Disallow unnecessary fragments See rule details for react/jsx-no-useless-fragment.
- org.openrewrite.codemods.cleanup.react.JsxOneExpressionPerLine
- Require one JSX element per line
- Require one JSX element per line See rule details for react/jsx-one-expression-per-line.
- org.openrewrite.codemods.cleanup.react.JsxPropsNoMultiSpaces
- Disallow multiple spaces between inline JSX props
- Disallow multiple spaces between inline JSX props See rule details for react/jsx-props-no-multi-spaces.
- org.openrewrite.codemods.cleanup.react.JsxSortProps
- Enforce props alphabetical sorting
- Enforce props alphabetical sorting See rule details for react/jsx-sort-props.
- org.openrewrite.codemods.cleanup.react.JsxSpaceBeforeClosing
- Enforce spacing before closing bracket in JSX
- Enforce spacing before closing bracket in JSX See rule details for react/jsx-space-before-closing.
- org.openrewrite.codemods.cleanup.react.JsxTagSpacing
- Enforce whitespace in and around the JSX opening and closing brackets
- Enforce whitespace in and around the JSX opening and closing brackets See rule details for react/jsx-tag-spacing.
- org.openrewrite.codemods.cleanup.react.JsxWrapMultilines
- Disallow missing parentheses around multiline JSX
- Disallow missing parentheses around multiline JSX See rule details for react/jsx-wrap-multilines.
- org.openrewrite.codemods.cleanup.react.NoArrowFunctionLifecycle
- Lifecycle methods should be methods on the prototype, not class fields
- Lifecycle methods should be methods on the prototype, not class fields See rule details for react/no-arrow-function-lifecycle.
- org.openrewrite.codemods.cleanup.react.NoUnknownProperty
- Disallow usage of unknown DOM property
- Disallow usage of unknown DOM property See rule details for react/no-unknown-property.
- org.openrewrite.codemods.cleanup.react.PreferReadOnlyProps
- Enforce that props are read-only
- Enforce that props are read-only See rule details for react/prefer-read-only-props.
- org.openrewrite.codemods.cleanup.react.SelfClosingComp
- Disallow extra closing tags for components without children
- Disallow extra closing tags for components without children See rule details for react/self-closing-comp.
- org.openrewrite.codemods.cleanup.react.SortPropTypes
- Enforce propTypes declarations alphabetical sorting
- Enforce propTypes declarations alphabetical sorting See rule details for react/sort-prop-types.
- org.openrewrite.codemods.cleanup.storybook.AwaitInteractions
- Interactions should be awaited
- Interactions should be awaited See rule details for storybook/await-interactions.
- org.openrewrite.codemods.cleanup.storybook.DefaultExports
- Story files should have a default export
- Story files should have a default export See rule details for storybook/default-exports.
- org.openrewrite.codemods.cleanup.storybook.HierarchySeparator
- Deprecated hierarchy separator in title property
- Deprecated hierarchy separator in title property See rule details for storybook/hierarchy-separator.
- org.openrewrite.codemods.cleanup.storybook.NoRedundantStoryName
- A story should not have a redundant name property
- A story should not have a redundant name property See rule details for storybook/no-redundant-story-name.
- org.openrewrite.codemods.cleanup.storybook.NoTitlePropertyInMeta
- Do not define a title in meta
- Do not define a title in meta See rule details for storybook/no-title-property-in-meta.
- org.openrewrite.codemods.cleanup.storybook.PreferPascalCase
- Stories should use PascalCase
- Stories should use PascalCase See rule details for storybook/prefer-pascal-case.
- org.openrewrite.codemods.cleanup.storybook.RecommendedStorybookCodeCleanup
- Recommended Storybook code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-storybook.
- org.openrewrite.codemods.cleanup.storybook.UseStorybookExpect
- Use expect from @storybook/jest
- Use expect from @storybook/jest See rule details for storybook/use-storybook-expect.
- org.openrewrite.codemods.cleanup.storybook.UseStorybookTestingLibrary
- Do not use testing-library directly on stories
- Do not use testing-library directly on stories See rule details for storybook/use-storybook-testing-library.
- org.openrewrite.codemods.cleanup.svelte.FirstAttributeLinebreak
- Enforce the location of first attribute
- Enforce the location of first attribute See rule details for svelte/first-attribute-linebreak.
- org.openrewrite.codemods.cleanup.svelte.HtmlClosingBracketSpacing
- Require or disallow a space before tag's closing brackets
- Require or disallow a space before tag's closing brackets See rule details for svelte/html-closing-bracket-spacing.
- org.openrewrite.codemods.cleanup.svelte.HtmlQuotes
- Enforce quotes style of HTML attributes
- Enforce quotes style of HTML attributes See rule details for svelte/html-quotes.
- org.openrewrite.codemods.cleanup.svelte.HtmlSelfClosing
- Enforce self-closing style
- Enforce self-closing style See rule details for svelte/html-self-closing.
- org.openrewrite.codemods.cleanup.svelte.Indent
- Enforce consistent indentation
- Enforce consistent indentation See rule details for svelte/indent.
- org.openrewrite.codemods.cleanup.svelte.MaxAttributesPerLine
- Enforce the maximum number of attributes per line
- Enforce the maximum number of attributes per line See rule details for svelte/max-attributes-per-line.
- org.openrewrite.codemods.cleanup.svelte.MustacheSpacing
- Enforce unified spacing in mustache
- Enforce unified spacing in mustache See rule details for svelte/mustache-spacing.
- org.openrewrite.codemods.cleanup.svelte.NoDynamicSlotName
- Disallow dynamic slot name
- Disallow dynamic slot name See rule details for svelte/no-dynamic-slot-name.
- org.openrewrite.codemods.cleanup.svelte.NoSpacesAroundEqualSignsInAttribute
- Disallow spaces around equal signs in attribute
- Disallow spaces around equal signs in attribute See rule details for svelte/no-spaces-around-equal-signs-in-attribute.
- org.openrewrite.codemods.cleanup.svelte.NoUselessMustaches
- Disallow unnecessary mustache interpolations
- Disallow unnecessary mustache interpolations See rule details for svelte/no-useless-mustaches.
- org.openrewrite.codemods.cleanup.svelte.PreferClassDirective
- Require class directives instead of ternary expressions
- Require class directives instead of ternary expressions See rule details for svelte/prefer-class-directive.
- org.openrewrite.codemods.cleanup.svelte.PreferStyleDirective
- Require style directives instead of style attribute
- Require style directives instead of style attribute See rule details for svelte/prefer-style-directive.
- org.openrewrite.codemods.cleanup.svelte.RecommendedsvelteCodeCleanup
- Recommended svelte code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-svelte.
- org.openrewrite.codemods.cleanup.svelte.RequireStoreReactiveAccess
- Disallow to use of the store itself as an operand. Need to use $ prefix or get function
- Disallow to use of the store itself as an operand. Need to use $ prefix or get function. See rule details for svelte/require-store-reactive-access.
- org.openrewrite.codemods.cleanup.svelte.ShorthandAttribute
- Enforce use of shorthand syntax in attribute
- Enforce use of shorthand syntax in attribute See rule details for svelte/shorthand-attribute.
- org.openrewrite.codemods.cleanup.svelte.ShorthandDirective
- Enforce use of shorthand syntax in directives
- Enforce use of shorthand syntax in directives See rule details for svelte/shorthand-directive.
- org.openrewrite.codemods.cleanup.svelte.SortAttributes
- Enforce order of attributes
- Enforce order of attributes See rule details for svelte/sort-attributes.
- org.openrewrite.codemods.cleanup.svelte.SpacedHtmlComment
- Enforce consistent spacing after the <!-- and before the --> in a HTML comment
- Enforce consistent spacing after the <!-- and before the --> in a HTML comment See rule details for svelte/spaced-html-comment.
- org.openrewrite.codemods.cleanup.vue.ArrayBracketNewline
- Enforce linebreaks after opening and before closing array brackets in
<template> - Enforce linebreaks after opening and before closing array brackets in
<template>See rule details for vue/array-bracket-newline.
- Enforce linebreaks after opening and before closing array brackets in
- org.openrewrite.codemods.cleanup.vue.ArrayBracketSpacing
- Enforce consistent spacing inside array brackets in
<template> - Enforce consistent spacing inside array brackets in
<template>See rule details for vue/array-bracket-spacing.
- Enforce consistent spacing inside array brackets in
- org.openrewrite.codemods.cleanup.vue.ArrayElementNewline
- Enforce line breaks after each array element in
<template> - Enforce line breaks after each array element in
<template>See rule details for vue/array-element-newline.
- Enforce line breaks after each array element in
- org.openrewrite.codemods.cleanup.vue.ArrowSpacing
- Enforce consistent spacing before and after the arrow in arrow functions in
<template> - Enforce consistent spacing before and after the arrow in arrow functions in
<template>See rule details for vue/arrow-spacing.
- Enforce consistent spacing before and after the arrow in arrow functions in
- org.openrewrite.codemods.cleanup.vue.AttributesOrder
- Enforce order of attributes
- Enforce order of attributes See rule details for vue/attributes-order.
- org.openrewrite.codemods.cleanup.vue.BlockOrder
- Enforce order of component top-level elements
- Enforce order of component top-level elements See rule details for vue/block-order.
- org.openrewrite.codemods.cleanup.vue.BlockSpacing
- Disallow or enforce spaces inside of blocks after opening block and before closing block in
<template> - Disallow or enforce spaces inside of blocks after opening block and before closing block in
<template>See rule details for vue/block-spacing.
- Disallow or enforce spaces inside of blocks after opening block and before closing block in
- org.openrewrite.codemods.cleanup.vue.BlockTagNewline
- Enforce line breaks after opening and before closing block-level tags
- Enforce line breaks after opening and before closing block-level tags See rule details for vue/block-tag-newline.
- org.openrewrite.codemods.cleanup.vue.BraceStyle
- Enforce consistent brace style for blocks in
<template> - Enforce consistent brace style for blocks in
<template>See rule details for vue/brace-style.
- Enforce consistent brace style for blocks in
- org.openrewrite.codemods.cleanup.vue.CommaDangle
- Require or disallow trailing commas in
<template> - Require or disallow trailing commas in
<template>See rule details for vue/comma-dangle.
- Require or disallow trailing commas in
- org.openrewrite.codemods.cleanup.vue.CommaSpacing
- Enforce consistent spacing before and after commas in
<template> - Enforce consistent spacing before and after commas in
<template>See rule details for vue/comma-spacing.
- Enforce consistent spacing before and after commas in
- org.openrewrite.codemods.cleanup.vue.CommaStyle
- Enforce consistent comma style in
<template> - Enforce consistent comma style in
<template>See rule details for vue/comma-style.
- Enforce consistent comma style in
- org.openrewrite.codemods.cleanup.vue.ComponentNameInTemplateCasing
- Enforce specific casing for the component naming style in template
- Enforce specific casing for the component naming style in template See rule details for vue/component-name-in-template-casing.
- org.openrewrite.codemods.cleanup.vue.ComponentOptionsNameCasing
- Enforce the casing of component name in components options
- Enforce the casing of component name in components options See rule details for vue/component-options-name-casing.
- org.openrewrite.codemods.cleanup.vue.ComponentTagsOrder
- Enforce order of component top-level elements
- Enforce order of component top-level elements See rule details for vue/component-tags-order.
- org.openrewrite.codemods.cleanup.vue.DefineMacrosOrder
- Enforce order of defineEmits and defineProps compiler macros
- Enforce order of defineEmits and defineProps compiler macros See rule details for vue/define-macros-order.
- org.openrewrite.codemods.cleanup.vue.DotLocation
- Enforce consistent newlines before and after dots in
<template> - Enforce consistent newlines before and after dots in
<template>See rule details for vue/dot-location.
- Enforce consistent newlines before and after dots in
- org.openrewrite.codemods.cleanup.vue.DotNotation
- Enforce dot notation whenever possible in
<template> - Enforce dot notation whenever possible in
<template>See rule details for vue/dot-notation.
- Enforce dot notation whenever possible in
- org.openrewrite.codemods.cleanup.vue.Eqeqeq
- Require the use of === and !== in
<template> - Require the use of === and !== in
<template>See rule details for vue/eqeqeq.
- Require the use of === and !== in
- org.openrewrite.codemods.cleanup.vue.FuncCallSpacing
- Require or disallow spacing between function identifiers and their invocations in
<template> - Require or disallow spacing between function identifiers and their invocations in
<template>See rule details for vue/func-call-spacing.
- Require or disallow spacing between function identifiers and their invocations in
- org.openrewrite.codemods.cleanup.vue.HtmlCommentContentNewline
- Enforce unified line brake in HTML comments
- Enforce unified line brake in HTML comments See rule details for vue/html-comment-content-newline.
- org.openrewrite.codemods.cleanup.vue.HtmlCommentContentSpacing
- Enforce unified spacing in HTML comments
- Enforce unified spacing in HTML comments See rule details for vue/html-comment-content-spacing.
- org.openrewrite.codemods.cleanup.vue.HtmlCommentIndent
- Enforce consistent indentation in HTML comments
- Enforce consistent indentation in HTML comments See rule details for vue/html-comment-indent.
- org.openrewrite.codemods.cleanup.vue.KeySpacing
- Enforce consistent spacing between keys and values in object literal properties in
<template> - Enforce consistent spacing between keys and values in object literal properties in
<template>See rule details for vue/key-spacing.
- Enforce consistent spacing between keys and values in object literal properties in
- org.openrewrite.codemods.cleanup.vue.KeywordSpacing
- Enforce consistent spacing before and after keywords in
<template> - Enforce consistent spacing before and after keywords in
<template>See rule details for vue/keyword-spacing.
- Enforce consistent spacing before and after keywords in
- org.openrewrite.codemods.cleanup.vue.MultilineTernary
- Enforce newlines between operands of ternary expressions in
<template> - Enforce newlines between operands of ternary expressions in
<template>See rule details for vue/multiline-ternary.
- Enforce newlines between operands of ternary expressions in
- org.openrewrite.codemods.cleanup.vue.NewLineBetweenMultiLineProperty
- Enforce new lines between multi-line properties in Vue components
- Enforce new lines between multi-line properties in Vue components See rule details for vue/new-line-between-multi-line-property.
- org.openrewrite.codemods.cleanup.vue.NextTickStyle
- Enforce Promise or callback style in nextTick
- Enforce Promise or callback style in nextTick See rule details for vue/next-tick-style.
- org.openrewrite.codemods.cleanup.vue.NoExtraParens
- Disallow unnecessary parentheses in
<template> - Disallow unnecessary parentheses in
<template>See rule details for vue/no-extra-parens.
- Disallow unnecessary parentheses in
- org.openrewrite.codemods.cleanup.vue.NoRequiredPropWithDefault
- Enforce props with default values to be optional
- Enforce props with default values to be optional See rule details for vue/no-required-prop-with-default.
- org.openrewrite.codemods.cleanup.vue.NoUnsupportedFeatures
- Disallow unsupported Vue.js syntax on the specified version
- Disallow unsupported Vue.js syntax on the specified version See rule details for vue/no-unsupported-features.
- org.openrewrite.codemods.cleanup.vue.NoUselessMustaches
- Disallow unnecessary mustache interpolations
- Disallow unnecessary mustache interpolations See rule details for vue/no-useless-mustaches.
- org.openrewrite.codemods.cleanup.vue.NoUselessVBind
- Disallow unnecessary v-bind directives
- Disallow unnecessary v-bind directives See rule details for vue/no-useless-v-bind.
- org.openrewrite.codemods.cleanup.vue.ObjectCurlyNewline
- Enforce consistent line breaks after opening and before closing braces in
<template> - Enforce consistent line breaks after opening and before closing braces in
<template>See rule details for vue/object-curly-newline.
- Enforce consistent line breaks after opening and before closing braces in
- org.openrewrite.codemods.cleanup.vue.ObjectCurlySpacing
- Enforce consistent spacing inside braces in
<template> - Enforce consistent spacing inside braces in
<template>See rule details for vue/object-curly-spacing.
- Enforce consistent spacing inside braces in
- org.openrewrite.codemods.cleanup.vue.ObjectPropertyNewline
- Enforce placing object properties on separate lines in
<template> - Enforce placing object properties on separate lines in
<template>See rule details for vue/object-property-newline.
- Enforce placing object properties on separate lines in
- org.openrewrite.codemods.cleanup.vue.ObjectShorthand
- Require or disallow method and property shorthand syntax for object literals in
<template> - Require or disallow method and property shorthand syntax for object literals in
<template>See rule details for vue/object-shorthand.
- Require or disallow method and property shorthand syntax for object literals in
- org.openrewrite.codemods.cleanup.vue.OperatorLinebreak
- Enforce consistent linebreak style for operators in
<template> - Enforce consistent linebreak style for operators in
<template>See rule details for vue/operator-linebreak.
- Enforce consistent linebreak style for operators in
- org.openrewrite.codemods.cleanup.vue.OrderInComponents
- Enforce order of properties in components
- Enforce order of properties in components See rule details for vue/order-in-components.
- org.openrewrite.codemods.cleanup.vue.PaddingLineBetweenBlocks
- Require or disallow padding lines between blocks
- Require or disallow padding lines between blocks See rule details for vue/padding-line-between-blocks.
- org.openrewrite.codemods.cleanup.vue.PaddingLineBetweenTags
- Require or disallow newlines between sibling tags in template
- Require or disallow newlines between sibling tags in template See rule details for vue/padding-line-between-tags.
- org.openrewrite.codemods.cleanup.vue.PaddingLinesInComponentDefinition
- Require or disallow padding lines in component definition
- Require or disallow padding lines in component definition See rule details for vue/padding-lines-in-component-definition.
- org.openrewrite.codemods.cleanup.vue.PreferDefineOptions
- Enforce use of defineOptions instead of default export
- Enforce use of defineOptions instead of default export. See rule details for vue/prefer-define-options.
- org.openrewrite.codemods.cleanup.vue.PreferSeparateStaticClass
- Require static class names in template to be in a separate class attribute
- Require static class names in template to be in a separate class attribute See rule details for vue/prefer-separate-static-class.
- org.openrewrite.codemods.cleanup.vue.PreferTemplate
- Require template literals instead of string concatenation in
<template> - Require template literals instead of string concatenation in
<template>See rule details for vue/prefer-template.
- Require template literals instead of string concatenation in
- org.openrewrite.codemods.cleanup.vue.QuoteProps
- Require quotes around object literal property names in
<template> - Require quotes around object literal property names in
<template>See rule details for vue/quote-props.
- Require quotes around object literal property names in
- org.openrewrite.codemods.cleanup.vue.RecommendedVueCodeCleanup
- Recommended vue code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-vue.
- org.openrewrite.codemods.cleanup.vue.ScriptIndent
- Enforce consistent indentation in
<script> - Enforce consistent indentation in
<script>See rule details for vue/script-indent.
- Enforce consistent indentation in
- org.openrewrite.codemods.cleanup.vue.SpaceInParens
- Enforce consistent spacing inside parentheses in
<template> - Enforce consistent spacing inside parentheses in
<template>See rule details for vue/space-in-parens.
- Enforce consistent spacing inside parentheses in
- org.openrewrite.codemods.cleanup.vue.SpaceInfixOps
- Require spacing around infix operators in
<template> - Require spacing around infix operators in
<template>See rule details for vue/space-infix-ops.
- Require spacing around infix operators in
- org.openrewrite.codemods.cleanup.vue.SpaceUnaryOps
- Enforce consistent spacing before or after unary operators in
<template> - Enforce consistent spacing before or after unary operators in
<template>See rule details for vue/space-unary-ops.
- Enforce consistent spacing before or after unary operators in
- org.openrewrite.codemods.cleanup.vue.StaticClassNamesOrder
- Enforce static class names order
- Enforce static class names order See rule details for vue/static-class-names-order.
- org.openrewrite.codemods.cleanup.vue.TemplateCurlySpacing
- Require or disallow spacing around embedded expressions of template strings in
<template> - Require or disallow spacing around embedded expressions of template strings in
<template>See rule details for vue/template-curly-spacing.
- Require or disallow spacing around embedded expressions of template strings in
- org.openrewrite.codemods.cleanup.vue.ThisInTemplate
- Disallow usage of this in template
- Disallow usage of this in template See rule details for vue/this-in-template.
- org.openrewrite.codemods.cleanup.vue.VForDelimiterStyle
- Enforce v-for directive's delimiter style
- Enforce v-for directive's delimiter style See rule details for vue/v-for-delimiter-style.
- org.openrewrite.codemods.cleanup.vue.VIfElseKey
- Require key attribute for conditionally rendered repeated components
- Require key attribute for conditionally rendered repeated components See rule details for vue/v-if-else-key.
- org.openrewrite.codemods.cleanup.vue.VOnHandlerStyle
- Enforce writing style for handlers in v-on directives
- Enforce writing style for handlers in v-on directives See rule details for vue/v-on-handler-style.
- org.openrewrite.codemods.ecmascript.5to6.ECMAScript6BestPractices
- Upgrade ECMAScript 5 to ECMAScript 6
- A collection of common ECMAScript 5 to ECMAScript 6 updates.
- org.openrewrite.codemods.ecmascript.5to6.amdToEsm
- Transform AMD style
define()calls to ES6importstatements - Transform AMD style
define()calls to ES6importstatements.
- Transform AMD style
- org.openrewrite.codemods.ecmascript.5to6.cjsToEsm
- Transform CommonJS style
require()calls to ES6importstatements - Transform CommonJS style
require()calls to ES6importstatements.
- Transform CommonJS style
- org.openrewrite.codemods.ecmascript.5to6.namedExportGeneration
- Generate named exports from CommonJS modules
- Generate named exports from CommonJS modules.
- org.openrewrite.codemods.ecmascript.5to6.noStrict
- Remove "use strict" directives
- Remove "use strict" directives.
- org.openrewrite.codemods.ecmascript.5to6.simpleArrow
- Replace all function expressions with only
returnstatement with simple arrow - Replace all function expressions with only
returnstatement with simple arrow function.
- Replace all function expressions with only
- org.openrewrite.codemods.ecmascript.5to6.varToLet
- Convert
vartolet - Convert
vartolet.
- Convert
- org.openrewrite.codemods.ecmascript.ESLintTypeScriptDefaults
- Lint TypeScript code using ESLint
- The default config includes the
@typescript-eslintplugin and the correspondingplugin:@typescript-eslint/recommendedextend.
- org.openrewrite.codemods.ecmascript.ESLintTypeScriptPrettier
- Format TypeScript using ESLint Prettier plugin
- Formats all TypeScript source code using the ESLint Prettier plugin.
- org.openrewrite.codemods.format.ArrayBracketNewline
- Enforce linebreaks after opening and before closing array brackets
- Enforce linebreaks after opening and before closing array brackets See rule details.
- org.openrewrite.codemods.format.ArrayBracketSpacing
- Enforce consistent spacing inside array brackets
- Enforce consistent spacing inside array brackets See rule details.
- org.openrewrite.codemods.format.ArrayElementNewline
- Enforce line breaks after each array element
- Enforce line breaks after each array element See rule details.
- org.openrewrite.codemods.format.ArrowParens
- Require parentheses around arrow function arguments
- Require parentheses around arrow function arguments See rule details.
- org.openrewrite.codemods.format.ArrowSpacing
- Enforce consistent spacing before and after the arrow in arrow functions
- Enforce consistent spacing before and after the arrow in arrow functions See rule details.
- org.openrewrite.codemods.format.BlockSpacing
- Disallow or enforce spaces inside of blocks after opening block and before closing block
- Disallow or enforce spaces inside of blocks after opening block and before closing block See rule details.
- org.openrewrite.codemods.format.BraceStyle
- Enforce consistent brace style for blocks
- Enforce consistent brace style for blocks See rule details.
- org.openrewrite.codemods.format.CommaDangle
- Require or disallow trailing commas
- Require or disallow trailing commas See rule details.
- org.openrewrite.codemods.format.CommaSpacing
- Enforce consistent spacing before and after commas
- Enforce consistent spacing before and after commas See rule details.
- org.openrewrite.codemods.format.CommaStyle
- Enforce consistent comma style
- Enforce consistent comma style See rule details.
- org.openrewrite.codemods.format.ComputedPropertySpacing
- Enforce consistent spacing inside computed property brackets
- Enforce consistent spacing inside computed property brackets See rule details.
- org.openrewrite.codemods.format.DotLocation
- Enforce consistent newlines before and after dots
- Enforce consistent newlines before and after dots See rule details.
- org.openrewrite.codemods.format.EolLast
- Require or disallow newline at the end of files
- Require or disallow newline at the end of files See rule details.
- org.openrewrite.codemods.format.FuncCallSpacing
- Require or disallow spacing between function identifiers and their invocations. Alias of `function-call-spacing`
- Require or disallow spacing between function identifiers and their invocations. Alias of `function-call-spacing`. See rule details.
- org.openrewrite.codemods.format.FunctionCallArgumentNewline
- Enforce line breaks between arguments of a function call
- Enforce line breaks between arguments of a function call See rule details.
- org.openrewrite.codemods.format.FunctionCallSpacing
- Require or disallow spacing between function identifiers and their invocations
- Require or disallow spacing between function identifiers and their invocations See rule details.
- org.openrewrite.codemods.format.FunctionParenNewline
- Enforce consistent line breaks inside function parentheses
- Enforce consistent line breaks inside function parentheses See rule details.
- org.openrewrite.codemods.format.GeneratorStarSpacing
- Enforce consistent spacing around `*` operators in generator functions
- Enforce consistent spacing around `*` operators in generator functions See rule details.
- org.openrewrite.codemods.format.ImplicitArrowLinebreak
- Enforce the location of arrow function bodies
- Enforce the location of arrow function bodies See rule details.
- org.openrewrite.codemods.format.Indent
- Enforce consistent indentation
- Enforce consistent indentation See rule details.
- org.openrewrite.codemods.format.IndentBinaryOps
- Indentation for binary operators
- Indentation for binary operators See rule details.
- org.openrewrite.codemods.format.JsxClosingBracketLocation
- Enforce closing bracket location in JSX
- Enforce closing bracket location in JSX See rule details.
- org.openrewrite.codemods.format.JsxClosingTagLocation
- Enforce closing tag location for multiline JSX
- Enforce closing tag location for multiline JSX See rule details.
- org.openrewrite.codemods.format.JsxCurlyBracePresence
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes See rule details.
- org.openrewrite.codemods.format.JsxCurlyNewline
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions See rule details.
- org.openrewrite.codemods.format.JsxCurlySpacing
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions See rule details.
- org.openrewrite.codemods.format.JsxEqualsSpacing
- Enforce or disallow spaces around equal signs in JSX attributes
- Enforce or disallow spaces around equal signs in JSX attributes See rule details.
- org.openrewrite.codemods.format.JsxFirstPropNewLine
- Enforce proper position of the first property in JSX
- Enforce proper position of the first property in JSX See rule details.
- org.openrewrite.codemods.format.JsxIndent
- Enforce JSX indentation
- Enforce JSX indentation See rule details.
- org.openrewrite.codemods.format.JsxIndentProps
- Enforce props indentation in JSX
- Enforce props indentation in JSX See rule details.
- org.openrewrite.codemods.format.JsxMaxPropsPerLine
- Enforce maximum of props on a single line in JSX
- Enforce maximum of props on a single line in JSX See rule details.
- org.openrewrite.codemods.format.JsxNewline
- Require or prevent a new line after jsx elements and expressions
- Require or prevent a new line after jsx elements and expressions. See rule details.
- org.openrewrite.codemods.format.JsxOneExpressionPerLine
- Require one JSX element per line
- Require one JSX element per line See rule details.
- org.openrewrite.codemods.format.JsxPascalCase
- Enforce PascalCase for user-defined JSX components
- Enforce PascalCase for user-defined JSX components See rule details.
- org.openrewrite.codemods.format.JsxPropsNoMultiSpaces
- Disallow multiple spaces between inline JSX props
- Disallow multiple spaces between inline JSX props See rule details.
- org.openrewrite.codemods.format.JsxQuotes
- Enforce the consistent use of either double or single quotes in JSX attributes
- Enforce the consistent use of either double or single quotes in JSX attributes See rule details.
- org.openrewrite.codemods.format.JsxSelfClosingComp
- Disallow extra closing tags for components without children
- Disallow extra closing tags for components without children See rule details.
- org.openrewrite.codemods.format.JsxSortProps
- Enforce props alphabetical sorting
- Enforce props alphabetical sorting See rule details.
- org.openrewrite.codemods.format.JsxTagSpacing
- Enforce whitespace in and around the JSX opening and closing brackets
- Enforce whitespace in and around the JSX opening and closing brackets See rule details.
- org.openrewrite.codemods.format.JsxWrapMultilines
- Disallow missing parentheses around multiline JSX
- Disallow missing parentheses around multiline JSX See rule details.
- org.openrewrite.codemods.format.KeySpacing
- Enforce consistent spacing between keys and values in object literal properties
- Enforce consistent spacing between keys and values in object literal properties See rule details.
- org.openrewrite.codemods.format.KeywordSpacing
- Enforce consistent spacing before and after keywords
- Enforce consistent spacing before and after keywords See rule details.
- org.openrewrite.codemods.format.LinebreakStyle
- Enforce consistent linebreak style
- Enforce consistent linebreak style See rule details.
- org.openrewrite.codemods.format.LinesAroundComment
- Require empty lines around comments
- Require empty lines around comments See rule details.
- org.openrewrite.codemods.format.LinesBetweenClassMembers
- Require or disallow an empty line between class members
- Require or disallow an empty line between class members See rule details.
- org.openrewrite.codemods.format.MemberDelimiterStyle
- Require a specific member delimiter style for interfaces and type literals
- Require a specific member delimiter style for interfaces and type literals See rule details.
- org.openrewrite.codemods.format.MultilineTernary
- Enforce newlines between operands of ternary expressions
- Enforce newlines between operands of ternary expressions See rule details.
- org.openrewrite.codemods.format.NewParens
- Enforce or disallow parentheses when invoking a constructor with no arguments
- Enforce or disallow parentheses when invoking a constructor with no arguments See rule details.
- org.openrewrite.codemods.format.NewlinePerChainedCall
- Require a newline after each call in a method chain
- Require a newline after each call in a method chain See rule details.
- org.openrewrite.codemods.format.NoConfusingArrow
- Disallow arrow functions where they could be confused with comparisons
- Disallow arrow functions where they could be confused with comparisons See rule details.
- org.openrewrite.codemods.format.NoExtraParens
- Disallow unnecessary parentheses
- Disallow unnecessary parentheses See rule details.
- org.openrewrite.codemods.format.NoExtraSemi
- Disallow unnecessary semicolons
- Disallow unnecessary semicolons See rule details.
- org.openrewrite.codemods.format.NoFloatingDecimal
- Disallow leading or trailing decimal points in numeric literals
- Disallow leading or trailing decimal points in numeric literals See rule details.
- org.openrewrite.codemods.format.NoMultiSpaces
- Disallow multiple spaces
- Disallow multiple spaces See rule details.
- org.openrewrite.codemods.format.NoMultipleEmptyLines
- Disallow multiple empty lines
- Disallow multiple empty lines See rule details.
- org.openrewrite.codemods.format.NoTrailingSpaces
- Disallow trailing whitespace at the end of lines
- Disallow trailing whitespace at the end of lines See rule details.
- org.openrewrite.codemods.format.NoWhitespaceBeforeProperty
- Disallow whitespace before properties
- Disallow whitespace before properties See rule details.
- org.openrewrite.codemods.format.NonblockStatementBodyPosition
- Enforce the location of single-line statements
- Enforce the location of single-line statements See rule details.
- org.openrewrite.codemods.format.ObjectCurlyNewline
- Enforce consistent line breaks after opening and before closing braces
- Enforce consistent line breaks after opening and before closing braces See rule details.
- org.openrewrite.codemods.format.ObjectCurlySpacing
- Enforce consistent spacing inside braces
- Enforce consistent spacing inside braces See rule details.
- org.openrewrite.codemods.format.ObjectPropertyNewline
- Enforce placing object properties on separate lines
- Enforce placing object properties on separate lines See rule details.
- org.openrewrite.codemods.format.OneVarDeclarationPerLine
- Require or disallow newlines around variable declarations
- Require or disallow newlines around variable declarations See rule details.
- org.openrewrite.codemods.format.OperatorLinebreak
- Enforce consistent linebreak style for operators
- Enforce consistent linebreak style for operators See rule details.
- org.openrewrite.codemods.format.PaddedBlocks
- Require or disallow padding within blocks
- Require or disallow padding within blocks See rule details.
- org.openrewrite.codemods.format.PaddingLineBetweenStatements
- Require or disallow padding lines between statements
- Require or disallow padding lines between statements See rule details.
- org.openrewrite.codemods.format.QuoteProps
- Require quotes around object literal property names
- Require quotes around object literal property names See rule details.
- org.openrewrite.codemods.format.Quotes
- Enforce the consistent use of either backticks, double, or single quotes
- Enforce the consistent use of either backticks, double, or single quotes See rule details.
- org.openrewrite.codemods.format.RecommendedESLintStyling
- Recommended ESLint Styling
- Collection of stylistic ESLint rules that are recommended by the ESLint Style..
- org.openrewrite.codemods.format.RestSpreadSpacing
- Enforce spacing between rest and spread operators and their expressions
- Enforce spacing between rest and spread operators and their expressions See rule details.
- org.openrewrite.codemods.format.Semi
- Require or disallow semicolons instead of ASI
- Require or disallow semicolons instead of ASI See rule details.
- org.openrewrite.codemods.format.SemiSpacing
- Enforce consistent spacing before and after semicolons
- Enforce consistent spacing before and after semicolons See rule details.
- org.openrewrite.codemods.format.SemiStyle
- Enforce location of semicolons
- Enforce location of semicolons See rule details.
- org.openrewrite.codemods.format.SpaceBeforeBlocks
- Enforce consistent spacing before blocks
- Enforce consistent spacing before blocks See rule details.
- org.openrewrite.codemods.format.SpaceBeforeFunctionParen
- Enforce consistent spacing before `function` definition opening parenthesis
- Enforce consistent spacing before `function` definition opening parenthesis See rule details.
- org.openrewrite.codemods.format.SpaceInParens
- Enforce consistent spacing inside parentheses
- Enforce consistent spacing inside parentheses See rule details.
- org.openrewrite.codemods.format.SpaceInfixOps
- Require spacing around infix operators
- Require spacing around infix operators See rule details.
- org.openrewrite.codemods.format.SpaceUnaryOps
- Enforce consistent spacing before or after unary operators
- Enforce consistent spacing before or after unary operators See rule details.
- org.openrewrite.codemods.format.SpacedComment
- Enforce consistent spacing after the `//` or `/*` in a comment
- Enforce consistent spacing after the `//` or `/*` in a comment See rule details.
- org.openrewrite.codemods.format.SwitchColonSpacing
- Enforce spacing around colons of switch statements
- Enforce spacing around colons of switch statements See rule details.
- org.openrewrite.codemods.format.TemplateCurlySpacing
- Require or disallow spacing around embedded expressions of template strings
- Require or disallow spacing around embedded expressions of template strings See rule details.
- org.openrewrite.codemods.format.TemplateTagSpacing
- Require or disallow spacing between template tags and their literals
- Require or disallow spacing between template tags and their literals See rule details.
- org.openrewrite.codemods.format.TypeAnnotationSpacing
- Require consistent spacing around type annotations
- Require consistent spacing around type annotations See rule details.
- org.openrewrite.codemods.format.TypeGenericSpacing
- Enforces consistent spacing inside TypeScript type generics
- Enforces consistent spacing inside TypeScript type generics See rule details.
- org.openrewrite.codemods.format.TypeNamedTupleSpacing
- Expect space before the type declaration in the named tuple
- Expect space before the type declaration in the named tuple See rule details.
- org.openrewrite.codemods.format.WrapIife
- Require parentheses around immediate `function` invocations
- Require parentheses around immediate `function` invocations See rule details.
- org.openrewrite.codemods.format.WrapRegex
- Require parenthesis around regex literals
- Require parenthesis around regex literals See rule details.
- org.openrewrite.codemods.format.YieldStarSpacing
- Require or disallow spacing around the `` in `yield` expressions
- Require or disallow spacing around the `` in `yield` expressions See rule details.
- org.openrewrite.codemods.migrate.angular.v15
- Update to Angular v15
- Upgrade to Angular v15 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v16
- Update to Angular v16
- Upgrade to Angular v16 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v17
- Update to Angular v17
- Upgrade to Angular v17 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v18
- Update to Angular v18
- Upgrade to Angular v18 through
ApplyAngularCLI.
- org.openrewrite.codemods.migrate.angular.v19
- Update to Angular v19
- Upgrade to Angular v19 through
ApplyAngularCLI.
- 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'.
- org.openrewrite.codemods.migrate.mui.AdapterV
- Converts components to use the v4 adapter module
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.All
- Combination of all deprecations
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.AutocompleteRenameCloseicon
- Renames
closeIconprop tocloseButtonIcon - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.AutocompleteRenameOption
- Renames
optionprop togetOptionLabel - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.AvatarCircleCircular
- Updates
circleprop tovariant="circular" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BadgeOverlapValue
- Updates
overlapprop tovariant="dot" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BaseHookImports
- Converts base imports to use React hooks
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BaseRemoveComponentProp
- Removes
componentprop from base components - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.BaseRemoveUnstyledSuffix
- Removes
Unstyledsuffix from base components - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.BaseRenameComponentsToSlots
- Renames base components to slots
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BaseUseNamedExports
- Updates base imports to use named exports
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BoxBorderradiusValues
- Updates
borderRadiusprop values - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BoxRenameCss
- Renames CSS properties for Box component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BoxRenameGap
- Renames
gapprop tospacing - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.BoxSxProp
- Converts
sxprop tosxstyle prop - See Material UI codemod projects for more details.
- Converts
- org.openrewrite.codemods.migrate.mui.ButtonColorProp
- Renames
colorprop tocolorOverride - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.ChipVariantProp
- Updates
variantprop for Chip component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.CircularprogressVariant
- Updates
variantprop for CircularProgress component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.CollapseRenameCollapsedheight
- Renames
collapsedHeightprop totransitionCollapsedHeight - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.ComponentRenameProp
- Renames
componentprop toas - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.CoreStylesImport
- Updates import paths for core styles
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.CreateTheme
- Updates createMuiTheme usage
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.DatePickersMovedToX
- Moves date pickers to
@mui/x-date-picker - See Material UI codemod projects for more details.
- Moves date pickers to
- org.openrewrite.codemods.migrate.mui.DialogProps
- Updates props for Dialog component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.DialogTitleProps
- Updates props for DialogTitle component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.EmotionPrependCache
- Prepends emotion cache
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ExpansionPanelComponent
- Converts ExpansionPanel to use ExpansionPanel component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.FabVariant
- Updates
variantprop for Fab component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.FadeRenameAlpha
- Renames
alphaprop toopacity - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.GridJustifyJustifycontent
- Updates
justifyprop tojustifyContentfor Grid component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.GridListComponent
- Converts GridList to use Grid component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.GridVProps
- Updates the usage of the
@mui/material/Grid2,@mui/system/Grid, and@mui/joy/Gridcomponents to their updated APIs - See Material UI codemod projects for more details.
- Updates the usage of the
- org.openrewrite.codemods.migrate.mui.HiddenDownProps
- Updates
downprop for Hidden component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.IconButtonSize
- Updates
sizeprop for IconButton component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.JoyAvatarRemoveImgprops
- Removes
imgPropsprop from Avatar component - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.JoyRenameClassnamePrefix
- Renames
Muiclassname prefix - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JoyRenameComponentsToSlots
- Renames components to slots
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.JoyRenameRowProp
- Renames
rowprop toflexDirection="row" - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JoyTextFieldToInput
- Renames
TextFieldtoInput - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JssToStyled
- Converts JSS styles to styled-components
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.JssToTssReact
- Converts JSS to TypeScript in React components
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.LinkUnderlineHover
- Updates link underline on hover
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.MaterialUiStyles
- Updates usage of
@mui/styles - See Material UI codemod projects for more details.
- Updates usage of
- org.openrewrite.codemods.migrate.mui.MaterialUiTypes
- Updates usage of
@mui/types - See Material UI codemod projects for more details.
- Updates usage of
- org.openrewrite.codemods.migrate.mui.ModalProps
- Updates props for Modal component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.MovedLabModules
- Moves lab modules to
@mui/material - See Material UI codemod projects for more details.
- Moves lab modules to
- org.openrewrite.codemods.migrate.mui.MuiReplace
- Replaces
@muiimports with@mui/material - See Material UI codemod projects for more details.
- Replaces
- org.openrewrite.codemods.migrate.mui.OptimalImports
- Optimizes imports
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.PaginationRoundCircular
- Updates
circularprop tovariant="circular" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.PresetSafe
- Ensures presets are safe to use
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.RenameCssVariables
- Renames CSS variables
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.RootRef
- Converts
rootReftoref - See Material UI codemod projects for more details.
- Converts
- org.openrewrite.codemods.migrate.mui.SkeletonVariant
- Updates
variantprop for Skeleton component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.Styled
- Updates the usage of
styledfrom@mui/system@v5to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Updates the usage of
- org.openrewrite.codemods.migrate.mui.StyledEngineProvider
- Updates usage of styled engine provider
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.SxProp
- Update the usage of the
sxprop to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Update the usage of the
- org.openrewrite.codemods.migrate.mui.SystemProps
- Remove system props and add them to the
sxprop - See Material UI codemod projects for more details.
- Remove system props and add them to the
- org.openrewrite.codemods.migrate.mui.TableProps
- Updates props for Table component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TabsScrollButtons
- Updates scroll buttons for Tabs component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TextareaMinmaxRows
- Updates
minRowsandmaxRowsprops for TextareaAutosize component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeAugment
- Adds
DefaultThememodule augmentation to typescript projects - See Material UI codemod projects for more details.
- Adds
- org.openrewrite.codemods.migrate.mui.ThemeBreakpoints
- Updates theme breakpoints
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeBreakpointsWidth
- Updates
widthvalues for theme breakpoints - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeOptions
- Updates theme options
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemePaletteMode
- Updates theme palette mode
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeProvider
- Updates usage of ThemeProvider
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeSpacing
- Updates theme spacing
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeSpacingApi
- Updates theme spacing API
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeTypographyRound
- Updates
roundvalues for theme typography - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeV
- Update the theme creation from
@mui/system@v5to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Update the theme creation from
- org.openrewrite.codemods.migrate.mui.TopLevelImports
- Converts all
@mui/materialsubmodule imports to the root module - See Material UI codemod projects for more details.
- Converts all
- org.openrewrite.codemods.migrate.mui.Transitions
- Updates usage of transitions
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TreeViewMovedToX
- Moves tree view to
@mui/x-tree-view - See Material UI codemod projects for more details.
- Moves tree view to
- org.openrewrite.codemods.migrate.mui.UseAutocomplete
- Updates usage of useAutocomplete
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.UseTransitionprops
- Updates usage of useTransitionProps
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.VariantProp
- Updates
variantprop usage - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.WithMobileDialog
- Updates withMobileDialog higher-order component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.WithWidth
- Updates withWidth higher-order component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.nextjs.NextJsCodemods
- Next.js Codemods for API Updates
- Next.js provides Codemod transformations to help upgrade your Next.js codebase when an API is updated or deprecated.
- org.openrewrite.codemods.migrate.nextjs.v10.AddMissingReactImport
- Add React imports
- Transforms files that do not import
Reactto include the import in order for the new React JSX transform to work.
- org.openrewrite.codemods.migrate.nextjs.v11.CraToNext
- Rename Next Image Imports
- Safely renames
next/imageimports in existing Next.js1011or12applications tonext/legacy/imagein Next.js 13. Also renamesnext/future/imagetonext/image.
- org.openrewrite.codemods.migrate.nextjs.v13_0.NewLink
- Remove
<a>Tags From Link Components - Remove
&lt;a&gt;tags inside Link Components or add alegacyBehaviorprop to Links that cannot be auto-fixed.
- Remove
- org.openrewrite.codemods.migrate.nextjs.v13_0.NextImageExperimental
- Migrate to the New Image Component
- Dangerously migrates from
next/legacy/imageto the newnext/imageby adding inline styles and removing unused props.
- org.openrewrite.codemods.migrate.nextjs.v13_0.NextImageToLegacyImage
- Rename Next Image Imports
- Safely renames
next/imageimports in existing Next.js1011or12applications tonext/legacy/imagein Next.js 13. Also renamesnext/future/imagetonext/image.
- org.openrewrite.codemods.migrate.nextjs.v13_2.BuiltInNextFont
- Use Built-in Font
- This codemod uninstalls the
@next/fontpackage and transforms@next/fontimports into the built-innext/font.
- org.openrewrite.codemods.migrate.nextjs.v14_0.MetadataToViewportExport
- Use
viewportexport - This codemod migrates certain viewport metadata to
viewportexport.
- Use
- org.openrewrite.codemods.migrate.nextjs.v14_0.NextOgImport
- Migrate
ImageResponseimports - This codemod moves transforms imports from
next/servertonext/ogfor usage of Dynamic OG Image Generation.
- Migrate
- org.openrewrite.codemods.migrate.nextjs.v6.UrlToWithrouter
- Use
withRouter - Transforms the deprecated automatically injected url property on top-level pages to using
withRouterand therouterproperty it injects. Read more here.
- Use
- org.openrewrite.codemods.migrate.nextjs.v8.WithampToConfig
- Transform AMP HOC into page config
- Transforms the
withAmpHOC into Next.js 9 page configuration.
- org.openrewrite.codemods.migrate.nextjs.v9.NameDefaultComponent
- Transform Anonymous Components into Named Components
- Transforms anonymous components into named components to make sure they work with Fast Refresh. The component will have a camel-cased name based on the name of the file, and it also works with arrow functions.
- org.openrewrite.concourse.search.FindPrivilegedResourceType
- Find privileged
resource_typedefinitions - By default,
resource_typedefinitions are unprivileged.
- Find privileged
- org.openrewrite.cucumber.jvm.CucumberJava8ToJava
- Migrate
cucumber-java8tocucumber-java - Migrates
cucumber-java8step definitions andLambdaGluehooks tocucumber-javaannotated methods.
- Migrate
- org.openrewrite.cucumber.jvm.CucumberToJunitPlatformSuite
- Cucumber to JUnit test
@Suite - Migrates Cucumber tests to JUnit test
@Suite.
- Cucumber to JUnit test
- org.openrewrite.cucumber.jvm.UpgradeCucumber2x
- Upgrade to Cucumber-JVM 2.x
- Upgrade to Cucumber-JVM 2.x from any previous version.
- org.openrewrite.cucumber.jvm.UpgradeCucumber5x
- Upgrade to Cucumber-JVM 5.x
- Upgrade to Cucumber-JVM 5.x from any previous version.
- org.openrewrite.cucumber.jvm.UpgradeCucumber7x
- Upgrade to Cucumber-JVM 7.x
- Upgrade to Cucumber-JVM 7.x from any previous version.
- org.openrewrite.dotnet.MigrateToNet6
- Upgrade to .NET 6.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 6.0.
- org.openrewrite.dotnet.MigrateToNet7
- Upgrade to .NET 7.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 7.0.
- org.openrewrite.dotnet.MigrateToNet8
- Upgrade to .NET 8.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 8.0.
- org.openrewrite.dotnet.MigrateToNet9
- Upgrade to .NET 9.0 using upgrade-assistant
- Run upgrade-assistant upgrade across a repository to upgrade projects to .NET 9.0.
- org.openrewrite.featureflags.launchdarkly.UpgradeLaunchDarkly6
- Migrate to LaunchDarkly 6.x
- This recipe will apply changes commonly needed when migrating to LaunchDarkly 6.x.
- org.openrewrite.featureflags.launchdarkly.UpgradeLaunchDarkly7
- Migrate to LaunchDarkly 7.x
- This recipe will apply changes commonly needed when migrating to LaunchDarkly 7.x.
- org.openrewrite.github.AddManualTrigger
- Add manual workflow trigger
- You can manually trigger workflow runs. To trigger specific workflows in a repository, use the
workflow_dispatchevent.
- org.openrewrite.github.DependabotCheckForGithubActionsUpdatesDaily
- Check for github-actions updates daily
- Set dependabot to check for github-actions updates daily.
- org.openrewrite.github.DependabotCheckForGithubActionsUpdatesWeekly
- Check for github-actions updates weekly
- Set dependabot to check for github-actions updates weekly.
- org.openrewrite.github.FindGitHubActionSecretReferences
- Find GitHub action secret references
- Help identify and inventory your GitHub secrets that are being used in GitHub actions.
- org.openrewrite.github.MigrateSetupUvV6ToV7
- Migrate
astral-sh/setup-uvfrom v6 to v7 - Migrates
astral-sh/setup-uvfrom v6 to v7. Updates the action version and removes the deprecatedserver-urlinput. See the v7.0.0 release notes for breaking changes.
- Migrate
- org.openrewrite.github.MigrateTibdexGitHubAppTokenToActions
- Migrate from tibdex/github-app-token to actions/create-github-app-token
- Migrates from tibdex/github-app-token@v2 to actions/create-github-app-token@v2 and updates parameter names from snake_case to kebab-case.
- 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
ReplaceSecretsandReplaceSecretKeysrecipes combined used to update the Maven publishing secrets in OpenRewrite's GitHub organization.
- org.openrewrite.github.gradle.RenameGradleBuildActionToSetupGradle
- Rename
gradle/gradle-build-actiontogradle/actions/setup-gradle - Rename the deprecated
gradle/gradle-build-actiontogradle/actions/setup-gradle@v3.
- Rename
- org.openrewrite.github.gradle.RenameWrapperValidationAction
- Rename
gradle/wrapper-validation-actiontogradle/actions/wrapper-validation - Rename the deprecated
gradle/wrapper-validation-actiontogradle/actions/wrapper-validation@v3.
- Rename
- org.openrewrite.github.security.GitHubActionsSecurity
- GitHub Actions security insights
- Finds potential security issues in GitHub Actions workflows, based on Zizmor security analysis rules.
- org.openrewrite.gradle.AddJUnitPlatformLauncher
- Add JUnit Platform Launcher
- Add the JUnit Platform Launcher to the buildscript dependencies.
- org.openrewrite.gradle.EnableGradleBuildCache
- Enable Gradle build cache
- Enable the Gradle build cache. By enabling build cache the build outputs are stored externally and fetched from the cache when it is determined that those inputs have no changed, avoiding the expensive work of regenerating them. See the Gradle Build Cache for more information.
- org.openrewrite.gradle.EnableGradleParallelExecution
- Enable Gradle parallel execution
- Most builds consist of more than one project and some of those projects are usually independent of one another. Yet Gradle will only run one task at a time by default, regardless of the project structure. By using the
--parallelswitch, you can force Gradle to execute tasks in parallel as long as those tasks are in different projects. See the Gradle performance documentation for more information.
- org.openrewrite.gradle.GradleBestPractices
- Apply Gradle best practices
- Apply a set of Gradle best practices to the build files, for more efficient and ideomatic builds.
- org.openrewrite.gradle.MigrateToGradle5
- Migrate to Gradle 5 from Gradle 4
- Migrate to version 5.x. See the Gradle upgrade guide from version 4.x to 5.0 for more information.
- org.openrewrite.gradle.MigrateToGradle6
- Migrate to Gradle 6 from Gradle 5
- Migrate to version 6.x. See the Gradle upgrade guide from version 5.x to 6.0 for more information.
- org.openrewrite.gradle.MigrateToGradle7
- Migrate to Gradle 7 from Gradle 6
- Migrate to version 7.x. See the Gradle upgrade guide from version 6.x to 7.0 for more information.
- org.openrewrite.gradle.MigrateToGradle8
- Migrate to Gradle 8 from Gradle 7
- Migrate to version 8.x. See the Gradle upgrade guide from version 7.x to 8.0 and version 8.x to latest for more information.
- org.openrewrite.gradle.MigrateToGradle9
- Migrate to Gradle 9 from Gradle 8
- Migrate to version 9.x. See the Gradle upgrade guide from version 8.x to 9.0 for more information.
- org.openrewrite.gradle.plugins.RemoveDevelocity
- Remove Develocity
- Remove the Develocity plugin and configuration from the Gradle build and settings files.
- org.openrewrite.hibernate.MigrateToHibernate60
- Migrate to Hibernate 6.0.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.0.x. The hibernate dependencies will be updated to use the new
org.hibernate.ormgroup ID and the recipe will make changes necessary to use Hibernate with Jakarta EE 9.0.
- org.openrewrite.hibernate.MigrateToHibernate61
- Migrate to Hibernate 6.1.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.1.x. The hibernate dependencies will be updated to use the new org.hibernate.orm group ID and the recipe will make changes necessary to use Hibernate with Jakarta EE 9.0.
- org.openrewrite.hibernate.MigrateToHibernate62
- Migrate to Hibernate 6.2.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.2.x.
- org.openrewrite.hibernate.MigrateToHibernate63
- Migrate to Hibernate 6.3.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.3.x.
- org.openrewrite.hibernate.MigrateToHibernate64
- Migrate to Hibernate 6.4.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.4.x.
- org.openrewrite.hibernate.MigrateToHibernate65
- Migrate to Hibernate 6.5.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.5.x.
- org.openrewrite.hibernate.MigrateToHibernate66
- Migrate to Hibernate 6.6.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 6.6.x.
- org.openrewrite.hibernate.MigrateToHibernate70
- Migrate to Hibernate 7.0.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 7.0.x.
- org.openrewrite.hibernate.MigrateToHibernate71
- Migrate to Hibernate 7.1.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate 7.1.x.
- org.openrewrite.hibernate.MigrateToHibernateDependencies60
- Migrate Hibernate dependencies to 6.0.x (Community Edition)
- This recipe will migrate any existing dependencies on Hibernate 5.x to the latest 6.0.x release. This migration will include the adjustment to the new
org.hibernate.ormgroup ID. It accounts for artifacts names that both do and do not include thejakartasuffix and it will change both dependencies and managed dependencies.
- org.openrewrite.hibernate.MigrateToHypersistenceUtilsHibernate60
- Migrate Hibernate Types to Hypersistence Utils 6.0 (Community Edition)
- This recipe will migrate any existing dependencies on
com.vladmihalcea:hibernate-typestoio.hypersistence:hypersistence-utils-hibernate-60. This migration will include the adjustment fromcom.vladmihalceatoio.hypersistence.utilspackage name.
- org.openrewrite.hibernate.MigrateToHypersistenceUtilsHibernate62
- Migrate Hibernate Types to Hypersistence Utils 6.2 (Community Edition)
- This recipe will migrate any existing dependencies on
io.hypersistence:hypersistence-utils-hibernate-60toio.hypersistence:hypersistence-utils-hibernate-62.
- org.openrewrite.hibernate.MigrateToHypersistenceUtilsHibernate63
- Migrate Hibernate Types to Hypersistence Utils 6.3 (Community Edition)
- This recipe will migrate any existing dependencies on
io.hypersistence:hypersistence-utils-hibernate-62toio.hypersistence:hypersistence-utils-hibernate-63.
- org.openrewrite.hibernate.TypeDescriptorToType
- Rename
JavaTypeDescriptorandSqlTypeDescriptortoJavaTypeandSqlType(Community Edition) - Rename
JavaTypeDescriptorandSqlTypeDescriptortoJavaTypeandSqlTyperespectively. See https://github.com/hibernate/hibernate-orm/blob/6.0/migration-guide.adoc#type-system for more details.
- Rename
- org.openrewrite.hibernate.validator.HibernateValidator_8_0
- Migrate to Hibernate Validator 8.0.x (Community Edition)
- This recipe will apply changes commonly needed when migrating to Hibernate Validator 8.0.x.
- org.openrewrite.java.AddApache2LicenseHeader
- Add ASLv2 license header
- Adds the Apache Software License Version 2.0 to Java source files which are missing a license header.
- org.openrewrite.java.dropwizard.AddActuatorConfiguration
- Add Spring Boot Actuator Configuration
- Configures Spring Boot Actuator endpoints and health checks in application.properties.
- org.openrewrite.java.dropwizard.AddCoreExampleProperties
- Add Core Example Properties
- Adds core example properties to the application.properties file.
- org.openrewrite.java.dropwizard.AddHibernateConfiguration
- Add Hibernate Configuration
- Configures Spring Boot Hibernate and JPA settings in application.properties.
- org.openrewrite.java.dropwizard.AddJerseyConfiguration
- Add Jersey Configuration
- Configures essential Jersey properties in Spring Boot that complement the JerseyConfig class.
- org.openrewrite.java.dropwizard.AddMissingApplicationProperties
- Add application.properties if missing
- This recipe creates an application.properties file in the resources folder if it does not exist.
- org.openrewrite.java.dropwizard.CodeCleanup
- Clean up various issues with the code
- Shorten references, remove unused imports, and remove Dropwizard-specific code constructs.
- org.openrewrite.java.dropwizard.CoreSetup
- Create Spring Boot Application Entry Point
- Creates the main Spring Boot application class.
- org.openrewrite.java.dropwizard.MigrateConfigurationClass
- Migrate Configuration Class
- Converts Dropwizard Configuration to Spring Boot format.
- org.openrewrite.java.dropwizard.MigrateDropwizardToSpringBoot
- Migrate Dropwizard to Spring Boot
- Apply various changes to migrate Dropwizard applications to Spring Boot.
- org.openrewrite.java.dropwizard.MigrateHealthChecksAndMetrics
- Add Spring Boot Actuator
- Configures Spring Boot Actuator with basic health endpoints.
- org.openrewrite.java.dropwizard.MigrateHibernate
- Migrate Hibernate
- Converts Dropwizard Resources to Spring Boot format.
- org.openrewrite.java.dropwizard.MigrateResourcesToSpringJersey
- Migrate Resource Classes
- Converts Dropwizard Resources to Spring Boot format.
- org.openrewrite.java.dropwizard.MigrateSecurity
- Migrate Health Checks to Spring Boot
- Converts Dropwizard health checks to Spring Boot format.
- org.openrewrite.java.dropwizard.MigrateTasksAndCommands
- Migrate
PostBodyTaskandConfiguredCommand - Remove or change the superclasses of
PostBodyTaskandConfiguredCommand.
- Migrate
- org.openrewrite.java.dropwizard.MigrateTests
- Migrate Health Checks to Spring Boot
- Converts Dropwizard tests to Spring Boot format.
- org.openrewrite.java.dropwizard.ModifyDropwizardHealthChecksToSpringVariants
- Convert Health Check Implementations
- Transforms Dropwizard HealthCheck classes to Spring Boot HealthIndicator.
- org.openrewrite.java.dropwizard.annotation.micrometer.CodahaleTimedToMicrometerTimed
- Replace
@Timed(Dropwizard) with@Timed(Micrometer) - Replaces Dropwizard's
@Timedannotation with Micrometer's@Timedannotation, preserving name (mapped to value), absolute, and description attributes.
- Replace
- org.openrewrite.java.flyway.AddFlywayModuleMySQL
- Add missing Flyway module for MySQL
- Database modules for Flyway 10 have been split out into separate modules for maintainability. Add the
flyway-mysqldependency if you are using MySQL with Flyway 10, as detailed on https://github.com/flyway/flyway/issues/3780.
- org.openrewrite.java.flyway.AddFlywayModuleOracle
- Add missing Flyway module for Oracle
- Database modules for Flyway 10 have been split out into separate modules for maintainability. Add the
flyway-database-oracledependency if you are using Oracle with Flyway 10, as detailed on https://github.com/flyway/flyway/issues/3780.
- org.openrewrite.java.flyway.AddFlywayModulePostgreSQL
- Add missing Flyway module for PostgreSQL
- Database modules for Flyway 10 have been split out in to separate modules for maintainability. Add the
flyway-database-postgresqldependency if you are using PostgreSQL with Flyway 10, as detailed on https://github.com/flyway/flyway/issues/3780.
- org.openrewrite.java.flyway.AddFlywayModuleSqlServer
- Add missing Flyway module for SQL Server
- Database modules for Flyway 10 have been split out into separate modules for maintainability. Add the
flyway-sqlserverdependency if you are using SQL Server with Flyway 10, as detailed on https://github.com/flyway/flyway/issues/3780.
- org.openrewrite.java.flyway.MigrateToFlyway10
- Migrate to Flyway 10
- Migrate to Flyway 10. See details at Flyway V10 has landed.
- org.openrewrite.java.jackson.CodehausClassesToFasterXML
- Migrate classes from Jackson Codehaus (legacy) to Jackson FasterXML
- In Jackson 2, the package and dependency coordinates moved from Codehaus to FasterXML.
- org.openrewrite.java.jackson.CodehausToFasterXML
- Migrate from Jackson Codehaus (legacy) to Jackson FasterXML
- In Jackson 2, the package and dependency coordinates moved from Codehaus to FasterXML.
- org.openrewrite.java.jackson.JacksonBestPractices
- Jackson best practices
- Apply best practices for using Jackson library, including upgrade to Jackson 2.x and removing redundant annotations.
- org.openrewrite.java.jackson.UpgradeJackson_2_3
- Migrates from Jackson 2.x to Jackson 3.x
- Migrate applications to the latest Jackson 3.x release. This recipe handles package changes (
com.fasterxml.jackson->tools.jackson), dependency updates, core class renames, exception renames, and method renames (e.g.,JsonGenerator.writeObject()->writePOJO(),JsonParser.getCurrentValue()->currentValue()).
- org.openrewrite.java.jackson.UpgradeJackson_2_3_Dependencies
- Upgrade Jackson 2.x dependencies to 3.x
- Upgrade Jackson Maven dependencies from 2.x to 3.x versions and update group IDs.
- org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonGeneratorMethodRenames
- Rename Jackson 2.x methods to 3.x equivalents for JsonGenerator
- Rename JsonGenerator methods that were renamed in 3.x (e.g.,
writeObject()towritePOJO(),getCurrentValue()tocurrentValue()).
- org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonNodeMethodRenames
- Rename Jackson 2.x methods to 3.x equivalents for JsonNode
- Rename JsonNode methods that were renamed in 3.x (e.g.,
elements()tovalues(),fields()toentries()).
- org.openrewrite.java.jackson.UpgradeJackson_2_3_JsonParserMethodRenames
- Rename Jackson 2.x methods to 3.x equivalents for JsonParser
- Rename JsonParser methods that were renamed in 3.x (e.g.,
getTextCharacters()togetStringCharacters(),getCurrentValue()tocurrentValue()).
- org.openrewrite.java.jackson.UpgradeJackson_2_3_MethodRenames
- Rename Jackson 2.x methods to 3.x equivalents
- Rename Jackson methods that were renamed in 3.x (e.g.,
writeObject()towritePOJO(),getCurrentValue()tocurrentValue()).
- org.openrewrite.java.jackson.UpgradeJackson_2_3_PackageChanges
- Update Jackson package names from 2.x to 3.x
- Update Jackson package imports from
com.fasterxml.jacksontotools.jackson.
- org.openrewrite.java.jackson.UpgradeJackson_2_3_RemoveRedundantFeatureFlags
- Remove redundant Jackson 3 feature flag configurations
- Remove
ObjectMapperfeature flag configurations that are now defaults in Jackson 3.
- org.openrewrite.java.jackson.UpgradeJackson_2_3_TypeChanges
- Update Jackson 2.x types to 3.x
- Update Jackson type names including exception types and core class renames.
- 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.timepackage was introduced, incorporating most of Joda-Time's concepts. Features deemed too specialized or bulky forjava.timewere included in the ThreeTen-Extra library. This recipe migrates Joda-Time types tojava.timeandthreeten-extratypes.
- org.openrewrite.java.jspecify.JSpecifyBestPractices
- JSpecify best practices
- Apply JSpecify best practices, such as migrating off of alternatives, and adding missing
@Nullableannotations.
- org.openrewrite.java.jspecify.MigrateFromJakartaAnnotationApi
- Migrate from Jakarta annotation API to JSpecify
- Migrate from Jakarta annotation API to JSpecify.
- org.openrewrite.java.jspecify.MigrateFromJavaxAnnotationApi
- Migrate from javax annotation API to JSpecify
- Migrate from javax annotation API to JSpecify.
- org.openrewrite.java.jspecify.MigrateFromJetbrainsAnnotations
- Migrate from JetBrains annotations to JSpecify
- Migrate from JetBrains annotations to JSpecify.
- org.openrewrite.java.jspecify.MigrateFromMicrometerAnnotations
- Migrate from Micrometer annotations to JSpecify
- Migrate from Micrometer annotations to JSpecify.
- org.openrewrite.java.jspecify.MigrateFromMicronautAnnotations
- Migrate from Micronaut Framework annotations to JSpecify
- Migrate from Micronaut Framework annotations to JSpecify.
- org.openrewrite.java.jspecify.MigrateFromOpenRewriteAnnotations
- Migrate from OpenRewrite annotations to JSpecify
- Migrate from OpenRewrite's JSR-305 meta-annotations to JSpecify.
- org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations
- Migrate from Spring Framework annotations to JSpecify
- Migrate from Spring Framework annotations to JSpecify.
- org.openrewrite.java.jspecify.MigrateToJSpecify
- Migrate to JSpecify
- This recipe will migrate to JSpecify annotations from various other nullability annotation standards.
- org.openrewrite.java.liberty.MigrateFromWebSphereToLiberty
- Migrate from WebSphere traditional to Liberty
- Use this category of rules to identify code changes needed when migrating from WebSphere Application Server traditional to Liberty.
- org.openrewrite.java.liberty.WebSphereUnavailableSSOMethods
- Use
getSSOCookieFromSSOTokenandlogout - This recipe replaces
LTPACookieFromSSOToken()withgetSSOCookieFromSSOTokenandrevokeSSOCookieswithlogout. The two methods are deprecated in traditional WebSphere Application Server Version 8.5 and might be removed in a future release. They are not available on Liberty.
- Use
- org.openrewrite.java.logging.jboss.JBossLoggingBestPractices
- JBoss Logging Best Practices
- This recipe applies best practices for logging in JBoss applications. It includes converting argument arrays to varargs for better readability and performance.
- org.openrewrite.java.logging.log4j.CommonsLoggingToLog4j
- Migrate JCL to Log4j 2.x API
- Transforms code written using Apache Commons Logging to use Log4j 2.x API.
- org.openrewrite.java.logging.log4j.JulToLog4j
- Migrate JUL to Log4j 2.x API
- Transforms code written using
java.util.loggingto use Log4j 2.x API.
- org.openrewrite.java.logging.log4j.Log4j1ToLog4j2
- Migrate Log4j 1.x to Log4j 2.x
- Migrates Log4j 1.x to Log4j 2.x.
- org.openrewrite.java.logging.log4j.ParameterizedLogging
- Parameterize Log4j 2.x logging statements
- Use Log4j 2.x 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.logging.log4j.Slf4jToLog4j
- Migrate SLF4J to Log4j 2.x API
- Transforms code written using SLF4J to use Log4j 2.x API.
- org.openrewrite.java.logging.log4j.UpgradeLog4J2DependencyVersion
- Upgrade Log4j 2.x dependency version
- Upgrades the Log4j 2.x dependencies to the latest 2.x version. Mitigates the Log4Shell and other Log4j2-related vulnerabilities.
- org.openrewrite.java.logging.logback.Log4jToLogback
- Migrate Log4j 2.x to Logback
- Migrates usage of Apache Log4j 2.x to using
logbackas an SLF4J implementation directly. Note, this currently does not modifylog4j.propertiesfiles.
- org.openrewrite.java.logging.slf4j.AddJBossLogManagerSlf4jProviderDependency
- Add JBoss LogManager's SLF4J provider
- When JBoss LogManager is the logging backend, add its SLF4J provider so we can migrate to SLF4J as a logging facade.
- org.openrewrite.java.logging.slf4j.CommonsLogging1ToSlf4j1
- Migrate Apache Commons Logging 1.x to SLF4J 1.x
- Transforms usages of Apache Commons Logging 1.x to leveraging SLF4J 1.x directly.
- org.openrewrite.java.logging.slf4j.JBossLoggingToSlf4j
- Migrate JBoss Logging to SLF4J
- Migrates usage of the JBoss Logging facade to using SLF4J.
- org.openrewrite.java.logging.slf4j.JulToSlf4j
- Migrate JUL to SLF4J
- Migrates usage of Java Util Logging (JUL) to using SLF4J directly.
- org.openrewrite.java.logging.slf4j.Log4j1ToSlf4j1
- Migrate Log4j 1.x to SLF4J 1.x
- Transforms usages of Log4j 1.x to leveraging SLF4J 1.x directly. Note, this currently does not modify
log4j.propertiesfiles.
- org.openrewrite.java.logging.slf4j.Log4j2ToSlf4j1
- Migrate Log4j 2.x to SLF4J 1.x
- Transforms usages of Log4j 2.x to leveraging SLF4J 1.x directly. Note, this currently does not modify
log4j.propertiesfiles.
- org.openrewrite.java.logging.slf4j.Log4jToSlf4j
- Migrate Log4j to SLF4J
- Migrates usage of Apache Log4j to using SLF4J directly. Use of the traditional Log4j to SLF4J bridge can result in loss of performance, as the Log4j messages must be formatted before they can be passed to SLF4J. Note, this currently does not modify
log4j.propertiesfiles.
- 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.logging.slf4j.Slf4jBestPractices
- SLF4J best practices
- Applies best practices to logging with SLF4J.
- org.openrewrite.java.micronaut.AddMicronautRetryDependencyIfNeeded
- Update the Micronaut Retry support
- This recipe will add the explicit Micronaut Retry dependency if needed.
- org.openrewrite.java.micronaut.AddMicronautWebsocketDependencyIfNeeded
- Update the Micronaut Websocket support
- This recipe will add the explicit Micronaut Websocket dependency if needed.
- org.openrewrite.java.micronaut.Micronaut2to3Migration
- Migrate from Micronaut 2.x to 3.x
- This recipe will apply changes required for migrating from Micronaut 2 to Micronaut 3.
- org.openrewrite.java.micronaut.Micronaut3to4Migration
- Migrate from Micronaut 3.x to 4.x
- This recipe will apply changes required for migrating from Micronaut 3 to Micronaut 4.
- org.openrewrite.java.micronaut.RemoveUnnecessaryDependencies
- Remove unnecessary dependencies
- This recipe will remove dependencies that are no longer explicitly needed.
- org.openrewrite.java.micronaut.RemoveWithJansiLogbackConfiguration
- Remove withJansi Logback configuration
- This recipe will remove the withJansi configuration tag from logback.xml.
- org.openrewrite.java.micronaut.UpdateBlockingTaskExecutors
- Migrate the use of TaskExecutors with blocking IO
- This recipe will any usage of TaskExecutors.IO to TaskExecutors.BLOCKING in order to be compatible with virtual threads.
- org.openrewrite.java.micronaut.UpdateBuildPlugins
- Add Micronaut build plugins to 4.x
- This recipe will update the shadow jar plugin to 8.x and the Micronaut build plugins to 4.x for a Gradle build.
- org.openrewrite.java.micronaut.UpdateBuildToMicronaut4Version
- Update the Micronaut version to 4.x
- This recipe will update the Micronaut version to 4.x for a Gradle or Maven build.
- org.openrewrite.java.micronaut.UpdateJakartaAnnotations
- Update jakarta annotations dependency
- This recipe will remove jakarta annotations dependency as it is a transitive dependency of micronaut-inject, and migrate from javax.annotation if needed.
- org.openrewrite.java.micronaut.UpdateMavenAnnotationProcessors
- Update the version of core annotation processors
- This recipe will update the version of Maven-configured annotation processors from Micronaut Core.
- org.openrewrite.java.micronaut.UpdateMicronautData
- Update the Micronaut Data library
- This recipe will make the necessary updates for using Micronaut Data with Micronaut Framework 4.
- org.openrewrite.java.micronaut.UpdateMicronautEmail
- Update to Micronaut Email 2.x
- This recipe will migrate from javax.validation if needed, and update packages in for the Postmark integration if needed.
- org.openrewrite.java.micronaut.UpdateMicronautPlatformBom
- Update to Micronaut 4.x platform BOM
- This recipe will update a Gradle or Maven build to reference the Micronaut 4 platform BOM.
- org.openrewrite.java.micronaut.UpdateMicronautSecurity
- Update the Micronaut Security library
- This recipe will update imports for relocated classes and update configuration files with renamed keys.
- org.openrewrite.java.micronaut.UpdateMicronautSession
- Update the Micronaut Session support
- This recipe will update the Micronaut Session dependency if needed.
- org.openrewrite.java.micronaut.UpdateMicronautValidation
- Update to Micronaut Validation 4.x
- This recipe will add jakarta validation dependency if needed, migrate from javax.validation if needed, and update micronaut validation dependencies.
- 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.AddLombokMapstructBinding
- Add
lombok-mapstruct-bindingwhen both MapStruct and Lombok are used - Add the
lombok-mapstruct-bindingannotation processor as needed when both MapStruct and Lombok are used.
- Add
- org.openrewrite.java.migrate.AddLombokMapstructBindingMavenDependencyOnly
- Add
lombok-mapstruct-bindingdependency for Maven when both MapStruct and Lombok are used - Add the
lombok-mapstruct-bindingwhen both MapStruct and Lombok are used, and the dependency does not already exist. Only to be called fromorg.openrewrite.java.migrate.AddLombokMapstructBindingto reduce redundant checks.
- Add
- org.openrewrite.java.migrate.BounceCastleFromJdk15OntoJdk18On
- Migrate Bouncy Castle to
jdk18on - This recipe will upgrade Bouncy Castle dependencies from
-jdk15onor-jdk15to18to-jdk18on.
- Migrate Bouncy Castle to
- org.openrewrite.java.migrate.BouncyCastleFromJdk15OnToJdk15to18
- Migrate Bouncy Castle from
jdk15ontojdk15to18for Java < 8 - This recipe replaces the Bouncy Castle artifacts from
jdk15ontojdk15to18.jdk15onisn't maintained anymore andjdk18onis only for Java 8 and above. Thejdk15to18artifact is the up-to-date replacement of the unmaintainedjdk15onfor Java < 8.
- Migrate Bouncy Castle from
- org.openrewrite.java.migrate.ComIntelliJAnnotationsToOrgJetbrainsAnnotations
- Migrate com.intellij:annotations to org.jetbrains:annotations
- This recipe will upgrade old dependency of com.intellij:annotations to the newer org.jetbrains:annotations.
- org.openrewrite.java.migrate.DeleteDeprecatedFinalize
- Avoid using the deprecated empty
finalize()method injava.desktop - The java.desktop module had a few implementations of finalize() that did nothing and have been removed. This recipe will remove these methods.
- Avoid using the deprecated empty
- org.openrewrite.java.migrate.DeprecatedCountStackFramesMethod
- Remove
Thread.countStackFrames()method Thread.countStackFrames()has been removed in Java SE 14 and has been changed in this release to unconditionally throwUnsupportedOperationExceptionThis recipe removes the usage of this method in your application as long as the method is not assigned to a variable. For more information on the Java SE 14 deprecation of this method, see https://bugs.java.com/bugdatabase/view_bug?bug_id=8205132.
- Remove
- org.openrewrite.java.migrate.DeprecatedJavaxSecurityCert
- Use
java.security.certinstead ofjavax.security.cert - The
javax.security.certpackage has been deprecated for removal.
- Use
- org.openrewrite.java.migrate.DeprecatedLogRecordThreadID
- Adopt
setLongThreadIDinjava.util.logging.LogRecord - Avoid using the deprecated methods in
java.util.logging.LogRecord.
- Adopt
- 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 ofcom.sun.xml.internal.bind.* - Do not use APIs from
com.sun.xml.internal.bind.*packages.
- Use
- org.openrewrite.java.migrate.JREDoNotUseSunNetSslAPIs
- Use
javax.net.sslinstead ofcom.sun.net.ssl - Do not use APIs from
com.sun.net.sslpackages.
- Use
- org.openrewrite.java.migrate.JREDoNotUseSunNetSslInternalSslProvider
- Use
com.ibm.jsse2instead ofcom.sun.net.ssl.internal.ssl - Do not use the
com.sun.net.ssl.internal.ssl.Providerclass.
- Use
- org.openrewrite.java.migrate.JREDoNotUseSunNetSslInternalWwwProtocol
- Use
com.ibm.net.ssl.www2.protocolinstead ofcom.sun.net.ssl.internal.www.protocol - Do not use the
com.sun.net.ssl.internal.www.protocolpackage.
- Use
- org.openrewrite.java.migrate.JREDoNotUseSunNetSslInternalWwwProtocolHttpsHandler
- Use
com.ibm.net.ssl.www2.protocol.https.Handlerinstead ofcom.sun.net.ssl.internal.www.protocol.https.Handler - Do not use the
com.sun.net.ssl.internal.www.protocol.https.Handlerclass.
- Use
- org.openrewrite.java.migrate.JREJdbcInterfaceNewMethods
- Adds missing JDBC interface methods
- Add method implementations stubs to classes that implement JDBC interfaces.
- org.openrewrite.java.migrate.JREWrapperInterface
- Add missing
isWrapperForandunwrapmethods - Add method implementations stubs to classes that implement
java.sql.Wrapper.
- Add missing
- 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.Jre17AgentMainPreMainPublic
- Set visibility of
premainandagentmainmethods topublic - Check for a behavior change in Java agents.
- Set visibility of
- org.openrewrite.java.migrate.Krb5LoginModuleClass
- Use
com.sun.security.auth.module.Krb5LoginModuleinstead ofcom.ibm.security.auth.module.Krb5LoginModule - Do not use the
com.ibm.security.auth.module.Krb5LoginModuleclass.
- Use
- org.openrewrite.java.migrate.MigrateZipErrorToZipException
- Use
ZipExceptioninstead ofZipError - Use
ZipExceptioninstead of the deprecatedZipErrorin Java 9 or higher.
- Use
- 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.RemovedFileIOFinalizeMethods
- Replace
finalizemethod injava.io.FileInputStreamandjava.io.FileOutputStream - The
finalizemethod injava.io.FileInputStreamandjava.io.FileOutputStreamis no longer available in Java SE 12 and later. The recipe replaces it with theclosemethod.
- Replace
- org.openrewrite.java.migrate.RemovedJavaXMLWSModuleProvided
- Do not package
java.xml.wsmodule in WebSphere Liberty applications - The
java.xml.wsmodule was removed in Java11. Websphere Liberty provides its own implementation of the module, which can be used by specifying thejaxws-2.2feature in the server.xml file. This recipe updates thejavax.xml.wsdependency to use theprovidedscope to avoid class loading issues.
- Do not package
- org.openrewrite.java.migrate.RemovedJaxBModuleProvided
- Do not package
java.xml.bindandjava.activationmodules in WebSphere Liberty applications - The
java.xml.bindandjava.activationmodules were removed in Java11. Websphere Liberty provides its own implementation of the modules, which can be used by specifying thejaxb-2.2feature in the server.xml file. This recipe updates thejavax.xml.bindandjavax.activationdependencies to use theprovidedscope to avoid class loading issues.
- Do not package
- org.openrewrite.java.migrate.RemovedLegacySunJSSEProviderName
- Use
SunJSSEinstead ofcom.sun.net.ssl.internal.ssl.Provider - The
com.sun.net.ssl.internal.ssl.Providerprovider name was removed.
- Use
- org.openrewrite.java.migrate.RemovedModifierAndConstantBootstrapsConstructors
- Change
java.lang.reflect.Modifierandjava.lang.invoke.ConstantBootstrapsmethod calls to static - The
java.lang.reflect.Modifier()andjava.lang.invoke.ConstantBootstraps()constructors have been removed in Java SE 15 because both classes only contain static methods. This recipe converts the usage of all methods in the two classes to be static. See https://docs.oracle.com/en/java/javase/15/migrate/index.html#GUID-233853B8-0782-429E-BEF7-7532EE610E63 for more information on these changes.
- Change
- org.openrewrite.java.migrate.RemovedPolicy
- Replace
javax.security.auth.Policywithjava.security.Policy - The
javax.security.auth.Policyclass is not available from Java SE 11 onwards.
- Replace
- org.openrewrite.java.migrate.RemovedRMIConnectorServerCredentialTypesConstant
- Replace
RMIConnectorServer.CREDENTIAL_TYPESconstant - This recipe replaces the
RMIConnectorServer.CREDENTIAL_TYPESconstant with theRMIConnectorServer.CREDENTIALS_FILTER_PATTERNconstant.
- Replace
- org.openrewrite.java.migrate.RemovedRuntimeTraceMethods
- Remove
Runtime.traceInstructions(boolean)andRuntime.traceMethodCallsmethods - The
traceInstructionsandtraceMethodCallsmethods injava.lang.Runtimewere deprecated in Java SE 9 and are no longer available in Java SE 13 and later. The recipe removes the invocations of these methods since the method invocations do nothing functionally.
- Remove
- org.openrewrite.java.migrate.RemovedSSLSessionGetPeerCertificateChainMethodImpl
- Replace
SSLSession.getPeerCertificateChain()method - The
javax.net.ssl.SSLSession.getPeerCertificateChain()method implementation was removed from the SunJSSE provider and HTTP client implementation in Java SE 15. The default implementation will now throw anUnsupportedOperationException. Applications using this method should be updated to use thejavax.net.ssl.SSLSession.getPeerCertificates()method instead.
- Replace
- org.openrewrite.java.migrate.RemovedSubjectMethods
- Adopt
javax.security.auth.Subject.current()andjavax.security.auth.Subject.callAs()methods` - Replaces the
javax.security.auth.Subject.getSubject()andjavax.security.auth.Subject.doAs()methods withjavax.security.auth.Subject.current()andjavax.security.auth.Subject.callAs().
- Adopt
- org.openrewrite.java.migrate.RemovedToolProviderConstructor
- Change
javax.tools.ToolProvidermethods calls to static - The
javax.tools.ToolProvider()constructor has been removed in Java SE 16 since the class only contains static methods. The recipe convertsjavax.tools.ToolProvider getSystemJavaCompiler(),javax.tools.ToolProvider getSystemDocumentationTool()andjavax.tools.ToolProvider getSystemToolClassLoader()to static methods.
- Change
- org.openrewrite.java.migrate.RemovedZipFinalizeMethods
- Replace
finalizemethod injava.util.zip.ZipFile,java.util.zip.Inflaterandjava.util.zip.Deflater - The
finalizemethod injava.util.zip.ZipFileis replaced with theclosemethod and is replaced by theendmethod injava.util.zip.Inflaterandjava.util.zip.Deflateras it is no longer available in Java SE 12 and later.
- Replace
- org.openrewrite.java.migrate.SunNetSslPackageUnavailable
- Replace
com.sun.net.sslpackage - The internal API
com.sun.net.sslis removed. The package was intended for internal use only and replacement APIs can be found in thejavax.net.sslpackage.
- Replace
- org.openrewrite.java.migrate.SwitchPatternMatching
- Adopt switch pattern matching (JEP 441)
- JEP 441 describes how some switch statements can be improved with pattern matching. This recipe applies some of those improvements where applicable.
- org.openrewrite.java.migrate.SystemGetSecurityManagerToNull
- Replace
System.getSecurityManager()withnull - The Security Manager API is unsupported in Java 24. This recipe will replace
System.getSecurityManager()withnullto make its behavior more obvious and try to simplify execution paths afterwards.
- Replace
- org.openrewrite.java.migrate.ThreadStopDestroy
- Remove
Thread.destroy()andThread.stop(Throwable) - The
java.lang.Thread.destroy()method was never implemented, and thejava.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.
- Remove
- 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.UpgradeBuildToJava17
- Upgrade build to Java 17
- Updates build files to use Java 17 as the target/source.
- org.openrewrite.java.migrate.UpgradeBuildToJava21
- Upgrade build to Java 21
- Updates build files to use Java 21 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.UpgradePluginsForJava17
- Upgrade plugins to Java 17 compatible versions
- Updates plugins to version compatible with Java 17.
- org.openrewrite.java.migrate.UpgradePluginsForJava21
- Upgrade plugins to Java 21 compatible versions
- Updates plugins and dependencies to version compatible with Java 21.
- org.openrewrite.java.migrate.UpgradeToJava17
- Migrate to Java 17
- This recipe will apply changes commonly needed when migrating to Java 17. 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 17 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 17.
- org.openrewrite.java.migrate.UpgradeToJava21
- Migrate to Java 21
- This recipe will apply changes commonly needed when migrating to Java 21. 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 21 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 21.
- 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.
- 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.
- 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.
- 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.
- org.openrewrite.java.migrate.WasDevMvnChangeParentArtifactId
- Change
net.wasdev.maven.parent:java8-parentto:parent - This recipe changes the artifactId of the
<parent>tag in thepom.xmlfromjava8-parenttoparent.
- Change
- 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.concurrent.JavaConcurrentAPIs
- Use modernized
java.util.concurrentAPIs - The Java concurrent APIs were updated in Java 9 and those changes resulted in certain APIs being deprecated. This recipe update an application to replace the deprecated APIs with their modern alternatives.
- Use modernized
- org.openrewrite.java.migrate.concurrent.MigrateAtomicBooleanWeakCompareAndSetToWeakCompareAndSetPlain
- Use
AtomicBoolean#weakCompareAndSetPlain(boolean, boolean) - Use
AtomicBoolean#weakCompareAndSetPlain(boolean, boolean)instead of the deprecatedAtomicBoolean#weakCompareAndSet(boolean, boolean)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.concurrent.MigrateAtomicIntegerArrayWeakCompareAndSetToWeakCompareAndSetPlain
- Use
AtomicIntegerArray#weakCompareAndSetPlain(int, int, int) - Use
AtomicIntegerArray#weakCompareAndSetPlain(int, int, int)instead of the deprecatedAtomicIntegerArray#weakCompareAndSet(int, int, int)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.concurrent.MigrateAtomicIntegerWeakCompareAndSetToWeakCompareAndSetPlain
- Use
AtomicInteger#weakCompareAndSetPlain(int, int) - Use
AtomicInteger#weakCompareAndSetPlain(int, int)instead of the deprecatedAtomicInteger#weakCompareAndSet(int, int)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.concurrent.MigrateAtomicLongArrayWeakCompareAndSetToWeakCompareAndSetPlain
- Use
AtomicLongArray#weakCompareAndSetPlain(int, long, long) - Use
AtomicLongArray#weakCompareAndSetPlain(int, long, long)instead of the deprecatedAtomicLongArray#weakCompareAndSet(int, long, long)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.concurrent.MigrateAtomicLongWeakCompareAndSetToWeakCompareAndSetPlain
- Use
AtomicLong#weakCompareAndSetPlain(long, long) - Use
AtomicLong#weakCompareAndSetPlain(long, long)instead of the deprecatedAtomicLong#weakCompareAndSet(long, long)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.concurrent.MigrateAtomicReferenceArrayWeakCompareAndSetToWeakCompareAndSetPlain
- Use
AtomicReferenceArray#weakCompareAndSetPlain(int, T, T) - Use
AtomicReferenceArray#weakCompareAndSetPlain(int, T, T)instead of the deprecatedAtomicReferenceArray#weakCompareAndSet(int, T, T)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.concurrent.MigrateAtomicReferenceWeakCompareAndSetToWeakCompareAndSetPlain
- Use
AtomicReference#weakCompareAndSetPlain(T, T) - Use
AtomicReference#weakCompareAndSetPlain(T, T)instead of the deprecatedAtomicReference#weakCompareAndSet(T, T)in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.guava.NoGuava
- Prefer the Java 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.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.NoGuavaJava21
- Prefer the Java 21 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.PreferCharCompare
- Prefer
java.lang.Char#compare - Prefer
java.lang.Char#compareinstead of usingcom.google.common.primitives.Chars#compare.
- Prefer
- org.openrewrite.java.migrate.guava.PreferIntegerCompare
- Prefer
Integer#compare - Prefer
java.lang.Integer#compareinstead of usingcom.google.common.primitives.Ints#compare.
- Prefer
- org.openrewrite.java.migrate.guava.PreferIntegerCompareUnsigned
- Prefer
Integer#compareUnsigned - Prefer
java.lang.Integer#compareUnsignedinstead of usingcom.google.common.primitives.UnsignedInts#compareorcom.google.common.primitives.UnsignedInts#compareUnsigned.
- Prefer
- org.openrewrite.java.migrate.guava.PreferIntegerDivideUnsigned
- Prefer
Integer#divideUnsigned - Prefer
java.lang.Integer#divideUnsignedinstead of usingcom.google.common.primitives.UnsignedInts#divideorcom.google.common.primitives.UnsignedInts#divideUnsigned.
- Prefer
- org.openrewrite.java.migrate.guava.PreferIntegerParseUnsignedInt
- Prefer
Integer#parseUnsignedInt - Prefer
java.lang.Integer#parseUnsignedIntinstead of usingcom.google.common.primitives.UnsignedInts#parseUnsignedInt.
- Prefer
- org.openrewrite.java.migrate.guava.PreferIntegerRemainderUnsigned
- Prefer
Integer#remainderUnsigned - Prefer
java.lang.Integer#remainderUnsignedinstead of usingcom.google.common.primitives.UnsignedInts#remainderUnsigned.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaNioCharsetStandardCharsets
- Prefer
java.nio.charset.StandardCharsets - Prefer
java.nio.charset.StandardCharsetsinstead of usingcom.google.common.base.Charsets.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilCollectionsSynchronizedNavigableMap
- Prefer
java.util.Collections#synchronizedNavigableMap - Prefer
java.util.Collections#synchronizedNavigableMapinstead of usingcom.google.common.collect.Maps#synchronizedNavigableMap.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilCollectionsUnmodifiableNavigableMap
- Prefer
java.util.Collections#unmodifiableNavigableMap - Prefer
java.util.Collections#unmodifiableNavigableMapinstead of usingcom.google.common.collect.Maps#unmodifiableNavigableMap.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilFunction
- Prefer
java.util.function.Function - Prefer
java.util.function.Functioninstead of usingcom.google.common.base.Function.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilObjectsEquals
- Prefer
java.util.Objects#equals - Prefer
java.util.Objects#equalsinstead of usingcom.google.common.base.Objects#equal.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilObjectsHashCode
- Prefer
java.util.Objects#hash - Prefer
java.util.Objects#hashinstead of usingcom.google.common.base.Objects#hashCodeorcom.google.common.base.Objects hash(..).
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilObjectsRequireNonNullElse
- Prefer
java.util.Objects#requireNonNullElse - Prefer
java.util.Objects#requireNonNullElseinstead of usingcom.google.common.base.MoreObjects#firstNonNull.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilOptional
- Prefer
java.util.Optional - Prefer
java.util.Optionalinstead of usingcom.google.common.base.Optional.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilPredicate
- Prefer
java.util.function.Predicate - Prefer
java.util.function.Predicateinstead of usingcom.google.common.base.Predicate.
- Prefer
- org.openrewrite.java.migrate.guava.PreferJavaUtilSupplier
- Prefer
java.util.function.Supplier - Prefer
java.util.function.Supplierinstead of usingcom.google.common.base.Supplier.
- Prefer
- org.openrewrite.java.migrate.guava.PreferLongCompare
- Prefer
Long#compare - Prefer
java.lang.Long#compareinstead of usingcom.google.common.primitives.Longs#compare.
- Prefer
- org.openrewrite.java.migrate.guava.PreferLongCompareUnsigned
- Prefer
Long#compareUnsigned - Prefer
java.lang.Long#compareUnsignedinstead of usingcom.google.common.primitives.UnsignedLongs#compareorcom.google.common.primitives.UnsignedLongs#compareUnsigned.
- Prefer
- org.openrewrite.java.migrate.guava.PreferLongDivideUnsigned
- Prefer
Long#divideUnsigned - Prefer
java.lang.Long#divideUnsignedinstead of usingcom.google.common.primitives.UnsignedLongs#divideorcom.google.common.primitives.UnsignedLongs#divideUnsigned.
- Prefer
- org.openrewrite.java.migrate.guava.PreferLongParseUnsignedLong
- Prefer
Long#parseUnsignedInt - Prefer
java.lang.Long#parseUnsignedIntinstead of usingcom.google.common.primitives.UnsignedLongs#parseUnsignedInt.
- Prefer
- org.openrewrite.java.migrate.guava.PreferLongRemainderUnsigned
- Prefer
Long#remainderUnsigned - Prefer
java.lang.Long#remainderUnsignedinstead of usingcom.google.common.primitives.UnsignedLongs#remainderUnsigned.
- Prefer
- org.openrewrite.java.migrate.guava.PreferMathAddExact
- Prefer
Math#addExact - Prefer
java.lang.Math#addExactinstead of usingcom.google.common.math.IntMath#checkedAddorcom.google.common.math.IntMath#addExact.
- Prefer
- org.openrewrite.java.migrate.guava.PreferMathClamp
- Prefer
Math#clamp - Prefer
java.lang.Math#clampinstead of usingcom.google.common.primitives.*#constrainToRange.
- Prefer
- org.openrewrite.java.migrate.guava.PreferMathMultiplyExact
- Prefer
Math#multiplyExact - Prefer
java.lang.Math#multiplyExactinstead of usingcom.google.common.primitives.IntMath#checkedMultiplyorcom.google.common.primitives.IntMath#multiplyExact.
- Prefer
- org.openrewrite.java.migrate.guava.PreferMathSubtractExact
- Prefer
Math#subtractExact - Prefer
java.lang.Math#subtractExactinstead of usingcom.google.common.primitives.IntMath#checkedSubtractorcom.google.common.primitives.IntMath#subtractExact.
- Prefer
- org.openrewrite.java.migrate.guava.PreferShortCompare
- Prefer
Short#compare - Prefer
java.lang.Short#compareinstead of usingcom.google.common.primitives.Shorts#compare.
- Prefer
- org.openrewrite.java.migrate.jacoco.UpgradeJaCoCo
- Upgrade JaCoCo
- This recipe will upgrade JaCoCo to the latest patch version, which traditionally advertises full backwards compatibility for older Java versions.
- org.openrewrite.java.migrate.jakarta.DeprecatedCDIAPIsRemoved40
- Remove deprecated API's not supported in CDI4.0
- Deprecated APIs have been removed in CDI 4.0. This recipe removes and updates the corresponding deprecated methods.
- org.openrewrite.java.migrate.jakarta.EhcacheJavaxToJakarta
- Migrate Ehcache from javax to jakarta namespace
- Java EE has been rebranded to Jakarta EE. This recipe replaces existing Ehcache dependencies with their counterparts that are compatible with Jakarta EE 9.
- org.openrewrite.java.migrate.jakarta.Faces2xMigrationToJakartaFaces3x
- JSF 2.x to Jakarta Faces 3.x
- Jakarta EE 9 uses Faces 3.0, a major upgrade to Jakarta packages and XML namespaces.
- org.openrewrite.java.migrate.jakarta.Faces3xMigrationToFaces4x
- Upgrade to Jakarta Faces 4.x
- Jakarta EE 10 uses Faces 4.0.
- org.openrewrite.java.migrate.jakarta.Faces4xMigrationToFaces41x
- Jakarta Faces 4.0 to 4.1
- Jakarta EE 11 uses Faces 4.1 a minor upgrade.
- org.openrewrite.java.migrate.jakarta.FacesJNDINamesChanged
- JNDI name
jsf/ClientSideSecretKeyhas been renamed tofaces/ClientSideSecretKey, and thejsf/FlashSecretKeyJNDI name has been renamed tofaces/FlashSecretKey - The
jsf/ClientSideSecretKeyJNDI name has been renamed tofaces/ClientSideSecretKey, and thejsf/FlashSecretKeyJNDI name has been renamed tofaces/FlashSecretKey. The JNDI keys that have been renamed are updated to allow use of the keys.
- JNDI name
- org.openrewrite.java.migrate.jakarta.FacesManagedBeansRemoved
- Substitute removed Faces Managed Beans
- This recipe substitutes Faces Managed Beans, which were deprecated in JavaServer Faces 2.3 and have been removed from Jakarta Faces 4.0.
- org.openrewrite.java.migrate.jakarta.FileuploadToFileUpload2
- Migrate deprecated
org.apache.commons.fileloadpackages toorg.apache.commons.fileload.core - Migrate deprecated
org.apache.commons.fileloadpackages toorg.apache.commons.fileload.core.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JacksonJavaxToJakarta
- Migrate Jackson from javax to jakarta namespace
- Java EE has been rebranded to Jakarta EE. This recipe replaces existing Jackson dependencies with their counterparts that are compatible with Jakarta EE 9.
- org.openrewrite.java.migrate.jakarta.JakartaEE10
- Migrate to Jakarta EE 10
- These recipes help with the Migration to Jakarta EE 10, flagging and updating deprecated methods.
- org.openrewrite.java.migrate.jakarta.JakartaEE11
- Migrate to Jakarta EE 11
- These recipes help with the Migration to Jakarta EE 11, flagging and updating deprecated methods.
- org.openrewrite.java.migrate.jakarta.JakartaFacesConfigXml4
- Migrate xmlns entries in
faces-config.xmlfiles - Jakarta EE 10 uses Faces version 4.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JakartaFacesEcmaScript
- Migrate JSF values inside EcmaScript files
- Convert JSF to Faces values inside JavaScript,TypeScript, and Properties files.
- org.openrewrite.java.migrate.jakarta.JakartaFacesTagLibraryXml4
- Migrate xmlns entries in
taglib.xmlfiles - Faces 4 uses facelet-taglib 4.0.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JakartaFacesXhtmlEE10
- Faces XHTML migration for Jakarta EE 10
- Find and replace legacy JSF namespace URIs with Jakarta Faces URNs in XHTML files.
- org.openrewrite.java.migrate.jakarta.JakartaFacesXhtmlEE9
- Faces XHTML migration for Jakarta EE 9
- Find and replace javax references to jakarta in XHTML files.
- org.openrewrite.java.migrate.jakarta.JakartaWebFragmentXml6
- Migrate xmlns entries in
web-fragment.xmlfiles - Faces 4 uses web-fragment 6.0.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JakartaWebXml6
- Migrate xmlns entries in
web.xmlfiles - Faces 4 uses web-app 6.0.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxActivationMigrationToJakartaActivation
- Migrate deprecated
javax.activationpackages tojakarta.activation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxAnnotationMigrationToJakartaAnnotation
- Migrate deprecated
javax.annotationtojakarta.annotation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxAuthenticationMigrationToJakartaAuthentication
- Migrate deprecated
javax.security.auth.messagepackages tojakarta.security.auth.message - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxAuthorizationMigrationToJakartaAuthorization
- Migrate deprecated
javax.security.jaccpackages tojakarta.security.jacc - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxBatchMigrationToJakartaBatch
- Migrate deprecated
javax.batchpackages tojakarta.batch - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxBeanValidationXmlToJakartaBeanValidationXml
- Migrate xmlns entries and javax. packages in
validation.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries and javax. packages in
- org.openrewrite.java.migrate.jakarta.JavaxBeansXmlToJakartaBeansXml
- Migrate xmlns entries in
beans.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxDecoratorToJakartaDecorator
- Migrate deprecated
javax.decoratorpackages tojakarta.decorator - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxEEApiToJakarta
- Migrate deprecated
javaee-apidependencies tojakarta.platform - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxEjbJarXmlToJakartaEjbJarXml
- Migrate xmlns entries and javax. packages in
ejb-jar.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries and javax. packages in
- org.openrewrite.java.migrate.jakarta.JavaxEjbToJakartaEjb
- Migrate deprecated
javax.ejbpackages tojakarta.ejb - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxElToJakartaEl
- Migrate deprecated
javax.elpackages tojakarta.el - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxEnterpriseToJakartaEnterprise
- Migrate deprecated
javax.enterprisepackages tojakarta.enterprise - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxFacesConfigXmlToJakartaFacesConfigXml
- Migrate xmlns entries in
faces-config.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxFacesTagLibraryXmlToJakartaFacesTagLibraryXml
- Migrate xmlns entries in
taglib.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxInjectMigrationToJakartaInject
- Migrate deprecated
javax.injectpackages tojakarta.inject - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxInterceptorToJakartaInterceptor
- Migrate deprecated
javax.interceptorpackages tojakarta.interceptor - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxJmsToJakartaJms
- Migrate deprecated
javax.jmspackages tojakarta.jms - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxJsonToJakartaJson
- Migrate deprecated
javax.jsonpackages tojakarta.json - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxJspToJakartaJsp
- Migrate deprecated
javax.jsppackages tojakarta.jsp - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxJwsToJakartaJws
- Migrate deprecated
javax.jwspackages tojakarta.jws - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxMailToJakartaMail
- Migrate deprecated
javax.mailpackages tojakarta.mail - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- 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
jakartanamespace.
- org.openrewrite.java.migrate.jakarta.JavaxOrmXmlToJakartaOrmXml
- Migrate xmlns entries in
orm.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxPersistenceToJakartaPersistence
- Migrate deprecated
javax.persistencepackages tojakarta.persistence - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxPersistenceXmlToJakartaPersistenceXml
- Migrate xmlns entries in
persistence.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxResourceToJakartaResource
- Migrate deprecated
javax.resourcepackages tojakarta.resource - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxSecurityToJakartaSecurity
- Migrate deprecated
javax.security.enterprisepackages tojakarta.security.enterprise - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxServletToJakartaServlet
- Migrate deprecated
javax.servletpackages tojakarta.servlet - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxToJakartaCdiExtensions
- Rename CDI Extension to Jakarta
- Rename
javax.enterprise.inject.spi.Extensiontojakarta.enterprise.inject.spi.Extension.
- org.openrewrite.java.migrate.jakarta.JavaxTransactionMigrationToJakartaTransaction
- Migrate deprecated
javax.transactionpackages tojakarta.transaction - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxValidationMigrationToJakartaValidation
- Migrate deprecated
javax.validationpackages tojakarta.validation - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxWebFragmentXmlToJakartaWebFragmentXml
- Migrate xmlns entries in
web-fragment.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxWebXmlToJakartaWebXml
- Migrate xmlns entries in
web.xmlfiles - Java EE has been rebranded to Jakarta EE, necessitating an XML namespace relocation.
- Migrate xmlns entries in
- org.openrewrite.java.migrate.jakarta.JavaxWebsocketToJakartaWebsocket
- Migrate deprecated
javax.websocketpackages tojakarta.websocket - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxWsToJakartaWs
- Migrate deprecated
javax.wspackages tojakarta.ws - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxXmlBindMigrationToJakartaXmlBind
- Migrate deprecated
javax.xml.bindpackages tojakarta.xml.bind - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxXmlSoapToJakartaXmlSoap
- Migrate deprecated
javax.soappackages tojakarta.soap - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JavaxXmlToJakartaXmlXJCBinding
- Migrate XJC Bindings to Jakata XML
- Java EE has been rebranded to Jakarta EE, migrates the namespace and version in XJC bindings.
- org.openrewrite.java.migrate.jakarta.JavaxXmlWsMigrationToJakartaXmlWs
- Migrate deprecated
javax.xml.wspackages tojakarta.xml.ws - Java EE has been rebranded to Jakarta EE, necessitating a package relocation.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.JettyUpgradeEE10
- Update Jetty EE9 to Jetty EE10
- Update Jetty dependencies from EE9 to EE10, changing the groupId and artifactIds as needed.
- org.openrewrite.java.migrate.jakarta.JettyUpgradeEE9
- Update Jetty9 to Jetty12
- Update Jetty dependencies from version 9 to version 12.
- org.openrewrite.java.migrate.jakarta.JohnzonJavaxToJakarta
- Migrate Johnzon from javax to jakarta namespace
- Java EE has been rebranded to Jakarta EE. This recipe replaces existing Johnzon dependencies with their counterparts that are compatible with Jakarta EE 9.
- org.openrewrite.java.migrate.jakarta.MigrateFastjsonForJakarta10
- Update Fastjson for Jakarta EE 10
- Update Fastjson to be compatible with Jakarta EE 10.
- org.openrewrite.java.migrate.jakarta.MigratePluginsForJakarta10
- Update Plugins for Jakarta EE 10
- Update plugin to be compatible with Jakarta EE 10.
- org.openrewrite.java.migrate.jakarta.MigrationToJakarta10Apis
- Migrate Jakarta EE 9 api dependencies to Jakarta EE 10 versions
- Jakarta EE 10 updates some apis compared to Jakarta EE 9.
- org.openrewrite.java.migrate.jakarta.OmniFacesNamespaceMigration
- OmniFaces Namespace Migration
- Find and replace legacy OmniFaces namespaces.
- org.openrewrite.java.migrate.jakarta.RemovalsServletJakarta10
- Replace deprecated Jakarta Servlet methods and classes
- This recipe replaces the classes and methods deprecated in Jakarta Servlet 6.0.
- org.openrewrite.java.migrate.jakarta.RemoveJakartaAnnotationDependencyWhenManagedBySpringBoot
- Remove
jakarta.annotation-apidependency when managed by Spring Boot - Best practice recipe to cleanup a direct dependency which also comes transitively for Spring Boot applications.
- Remove
- org.openrewrite.java.migrate.jakarta.RemovedIsParmetersProvidedMethod
- Use
isParametersProvided() - Expression Language prior to 5.0 provides the deprecated MethodExpression.isParmetersProvided() method, with the word 'parameter' misspelled in the method name. This method is unavailable in Jakarta Expression Language 5.0. Use the correctly spelled MethodExpression.isParametersProvided() method instead.
- Use
- org.openrewrite.java.migrate.jakarta.RemovedJakartaFacesExpressionLanguageClasses
- Use
jakarta.elinstead ofjakarta.faces.elandjavax.faces.el - Several classes were removed and replaced in Jakarta Faces 3.0. The only Object definition not removed in the
jakarta.faces.elpackage is the CompositeComponentExpressionHolder interface.
- Use
- org.openrewrite.java.migrate.jakarta.RemovedJakartaFacesResourceResolver
- Replace
ResourceResolverwithResourceHandler - The
ResourceResolverclass was removed in Jakarta Faces 3.0. The functionality provided by that class can be replaced by using thejakarta.faces.application.ResourceHandlerclass.
- Replace
- org.openrewrite.java.migrate.jakarta.RemovedSOAPElementFactory
- Use
jakarta.xml.soap.SOAPFactoryto createSOAPElements - XML Web Services prior to 4.0 provides the deprecated SOAPElementFactory class, which is removed in XML Web Services 4.0. The recommended replacement is to use jakarta.xml.soap.SOAPFactory to create SOAPElements.
- Use
- org.openrewrite.java.migrate.jakarta.RemovedStateManagerMethods
- Use
StateManagementStrategy - Faces 3.0 introduced using
StateManagementStrategyin favor ofStateManager, which was later removed in Faces 4.0.
- Use
- org.openrewrite.java.migrate.jakarta.RemovedUIComponentConstant
- Replace
CURRENT_COMPONENTandCURRENT_COMPOSITE_COMPONENTwithgetCurrentComponent()andgetCurrentCompositeComponent() - Replace
jakarta.faces.component.UIComponent.CURRENT_COMPONENTandCURRENT_COMPOSITE_COMPONENTconstants withjakarta.faces.component.UIComponent.getCurrentComponent()andgetCurrentCompositeComponent(). that were added in JSF 2.0.
- Replace
- org.openrewrite.java.migrate.jakarta.RestAssuredJavaxToJakarta
- Migrate RestAssured from javax to jakarta namespace by upgrading to a version compatible with J2EE9
- Java EE has been rebranded to Jakarta EE. This recipe replaces existing RestAssured dependencies with their counterparts that are compatible with Jakarta EE 9.
- org.openrewrite.java.migrate.jakarta.ServletCookieBehaviorChangeRFC6265
- Remove
getCommentandgetVersionmethods - Jakarta Servlet methods have been deprecated for removal in Jakarta Servlet 6.0 to align with RFC 6265. In addition, the behavior of these methods has been changed so the setters no longer have any effect, the getComment methods return null, and the getVersion method returns 0. The deprecated methods are removed.
- Remove
- org.openrewrite.java.migrate.jakarta.UpdateApacheCommonsEmailDependencies
- Update Apache Commons Email to Email2 for Jakarta
- Update Apache Commons Email to Email2 for Jakarta.
- org.openrewrite.java.migrate.jakarta.UpdateApacheShiroDependencies
- Update Apache Shiro Dependencies to 2.0.x
- Update Apache Shiro Dependencies to 2.0.x.
- org.openrewrite.java.migrate.jakarta.UpdateApacheWSSecurityPackages
- Migrate
org.apache.ws.securityandorg.apache.ws.security.components.cryptopackages toorg.apache.wss4j.common.extandorg.apache.wss4j.common.cryptopackages - Java EE has been rebranded to Jakarta EE. This recipe replaces Apache security packages to migrate to Apache
wss4j.
- Migrate
- org.openrewrite.java.migrate.jakarta.UpdateEclipseLinkDependencies
- Update EclipseLink Dependencies to 4.x
- Update EclipseLink Dependencies to 4.x.
- org.openrewrite.java.migrate.jakarta.UpdateFileupload2Dependencies
- Update Apache Commons FileUpload2 package for EE10
- Update Apache Commons FileUpload2 package for EE10.
- org.openrewrite.java.migrate.jakarta.UpdateJakartaAnnotations2
- Update Jakarta EE annotation Dependencies to 2.1.x
- Update Jakarta EE annotation Dependencies to 2.1.x.
- org.openrewrite.java.migrate.jakarta.UpdateJakartaFacesApi3
- Migrate deprecated
javax.facespackages tojakarta.faces - Java EE has been rebranded to Jakarta EE, necessitating a package relocation and upgrade.
- Migrate deprecated
- org.openrewrite.java.migrate.jakarta.UpdateJakartaFacesApi4
- Update Jakarta EE Java Faces Dependencies to 4.0.x
- Update Jakarta EE Java Faces Dependencies to 4.0.x.
- org.openrewrite.java.migrate.jakarta.UpdateJakartaFacesApi41
- Update Jakarta EE Java Faces Dependencies to 4.1.x
- Update Jakarta EE Java Faces Dependencies to 4.1.x.
- org.openrewrite.java.migrate.jakarta.UpdateJakartaPlatform10
- Update Jakarta EE Platform Dependencies to 10.0.0
- Update Jakarta EE Platform Dependencies to 10.0.0.
- org.openrewrite.java.migrate.jakarta.UpdateJakartaPlatform11
- Update Jakarta EE Platform Dependencies to 11.0.x
- Update Jakarta EE Platform Dependencies to 11.0.x.
- org.openrewrite.java.migrate.jakarta.UpdateJakartaXmlWsEE10
- Update Jakarta EE XML Web Services Dependencies for EE 10
- Update Jakarta EE XML Web Services Dependencies for EE 10.
- org.openrewrite.java.migrate.jakarta.UpdateJerseyDependencies
- Update GlassFish Jersey Dependencies to 3.1.x
- Update GlassFish Jersey Dependencies to 3.1.x.
- org.openrewrite.java.migrate.jakarta.UpdateRestLet2_6
- Update RestLet to 2.6.0
- Update RestLet to 2.6.0.
- org.openrewrite.java.migrate.jakarta.UpdateYassonDependencies
- Update Eclipse Yasson Dependencies to 3.0.x
- Update Eclipse Yasson Dependencies to 3.0.x.
- org.openrewrite.java.migrate.jakarta.UpgradeFaces3OpenSourceLibraries
- Upgrade Faces open source libraries
- Upgrade PrimeFaces, OmniFaces, and MyFaces libraries to Jakarta EE9 versions.
- org.openrewrite.java.migrate.jakarta.UpgradeFaces41OpenSourceLibraries
- Upgrade Faces open source libraries
- Upgrade OmniFaces and MyFaces/Mojarra libraries to Jakarta EE11 versions.
- org.openrewrite.java.migrate.jakarta.UpgradeFaces4OpenSourceLibraries
- Upgrade Faces open source libraries
- Upgrade PrimeFaces, OmniFaces, and MyFaces libraries to Jakarta EE10 versions.
- org.openrewrite.java.migrate.jakarta.WsWsocServerContainerDeprecation
- Replace
doUpgrade(..)withServerContainer.upgradeHttpToWebSocket(..) - Deprecated
WsWsocServerContainer.doUpgrade(..)is replaced by the Jakarta WebSocket 2.1 specificationServerContainer.upgradeHttpToWebSocket(..).
- Replace
- org.openrewrite.java.migrate.javaee6
- Migrate to JavaEE6
- These recipes help with the Migration to Java EE 6, flagging and updating deprecated methods.
- org.openrewrite.java.migrate.javaee7
- Migrate to JavaEE7
- These recipes help with the Migration to Java EE 7, flagging and updating deprecated methods.
- org.openrewrite.java.migrate.javaee7.OpenJPAPersistenceProvider
- Removed OpenJPA providers in the persistence.xml file
- When migrating to EclipseLink, using OpenJPA providers in EclipseLink results in runtime errors. To resolve these errors, the recipe removes the flagged OpenJPA provider from the persistence.xml.
- org.openrewrite.java.migrate.javaee8
- Migrate to JavaEE8
- These recipes help with the Migration to Java EE 8, flagging and updating deprecated methods.
- org.openrewrite.java.migrate.javaee8.ApacheDefaultProvider
- Flags any
org.apache.bval.jsr*(bval 1.1) andorg.apache.bval.jsr303*(bval 1.0) package references - This recipe flags any
org.apache.bval.jsr*(bval 1.1) andorg.apache.bval.jsr303*(bval 1.0) package references in validation.xml deployment descriptors. Bean Validation 2.0 and later use the Hibernate Validator implementation instead of the Apache BVal implementation which was used for Bean Validation 1.0 and 1.1.
- Flags any
- org.openrewrite.java.migrate.javaee8.ServletIsRequestedSessionIdFromURL
- Replace
HttpServletRequestWrapper.isRequestedSessionIdFromUrl()withisRequestedSessionIdFromURL() - The method
HttpServletRequestWrapper.isRequestedSessionIdFromUrl()is deprecated in JavaEE8 and is replaced byHttpServletRequestWrapper.isRequestedSessionIdFromURL().
- Replace
- org.openrewrite.java.migrate.javax.AddCommonAnnotationsDependencies
- Add explicit Common Annotations dependencies
- Add the necessary
annotation-apidependency 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-apidependency 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.bindnamespace. Running a full javax to Jakarta migration usingorg.openrewrite.java.migrate.jakarta.JavaxMigrationToJakartawill 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.bindnamespace. Running a full javax to Jakarta migration usingorg.openrewrite.java.migrate.jakarta.JavaxMigrationToJakartawill 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.bindnamespace. All JAXB runtime implementation dependencies are removed.
- 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.bindnamespace.
- org.openrewrite.java.migrate.javax.JavaxLangModelUtil
- Use modernized
javax.lang.model.utilAPIs - Certain
javax.lang.model.utilAPIs have become deprecated and their usages changed, necessitating usage changes.
- Use modernized
- org.openrewrite.java.migrate.javax.JavaxManagementMonitorAPIs
- Use modernized
javax.management.monitorAPIs - Certain
javax.management.monitorAPIs have become deprecated and their usages changed, necessitating usage changes.
- Use modernized
- org.openrewrite.java.migrate.javax.JavaxXmlStreamAPIs
- Use modernized
javax.xml.streamAPIs - Certain
javax.xml.streamAPIs have become deprecated and their usages changed, necessitating usage changes.
- Use modernized
- org.openrewrite.java.migrate.javax.MigrateAbstractAnnotationValueVisitor6To9
- Use
javax.lang.model.util.AbstractAnnotationValueVisitor9 - Use
javax.lang.model.util.AbstractAnnotationValueVisitor9instead of the deprecatedjavax.lang.model.util.AbstractAnnotationValueVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateAbstractElementVisitor6To9
- Use
javax.lang.model.util.AbstractElementVisitor9 - Use
javax.lang.model.util.AbstractElementVisitor9instead of the deprecatedjavax.lang.model.util.AbstractElementVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateAbstractTypeVisitor6To9
- Use
javax.lang.model.util.AbstractTypeVisitor9 - Use
javax.lang.model.util.AbstractTypeVisitor9instead of the deprecatedjavax.lang.model.util.AbstractTypeVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateCounterMonitorSetThresholdToSetInitThreshold
- Use
javax.management.monitor.CounterMonitor#setInitThreshold - Use
javax.management.monitor.CounterMonitor#setInitThresholdinstead of the deprecatedjavax.management.monitor.CounterMonitor#setThresholdin JMX 1.2 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateElementKindVisitor6To9
- Use
javax.lang.model.util.ElementKindVisitor9 - Use
javax.lang.model.util.ElementKindVisitor9instead of the deprecatedjavax.lang.model.util.ElementKindVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateElementScanner6To9
- Use
javax.lang.model.util.ElementScanner9 - Use
javax.lang.model.util.ElementScanner9instead of the deprecatedjavax.lang.model.util.ElementScanner6in Java 9 or higher.
- Use
- 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.javax.MigrateSimpleAnnotationValueVisitor6To9
- Use
javax.lang.model.util.SimpleAnnotationValueVisitor9 - Use
javax.lang.model.util.SimpleAnnotationValueVisitor9instead of the deprecatedjavax.lang.model.util.SimpleAnnotationValueVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateSimpleElementVisitor6To9
- Use
javax.lang.model.util.SimpleElementVisitor9 - Use
javax.lang.model.util.SimpleElementVisitor9instead of the deprecatedjavax.lang.model.util.SimpleElementVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateSimpleTypeVisitor6To9
- Use
javax.lang.model.util.SimpleTypeVisitor9 - Use
javax.lang.model.util.SimpleTypeVisitor9instead of the deprecatedjavax.lang.model.util.SimpleTypeVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateTypeKindVisitor6To9
- Use
javax.lang.model.util.TypeKindVisitor9 - Use
javax.lang.model.util.TypeKindVisitor9instead of the deprecatedjavax.lang.model.util.TypeKindVisitor6in Java 9 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateXMLEventFactoryNewInstanceToNewFactory
- Use
javax.xml.stream.XMLEventFactory#newFactory(String, ClassLoader) - Use
javax.xml.stream.XMLEventFactory#newFactoryinstead of the deprecatedjavax.xml.stream.XMLEventFactory#newInstancein Java 7 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateXMLInputFactoryNewInstanceToNewFactory
- Use
javax.xml.stream.XMLInputFactory#newFactory(String, ClassLoader) - Use
javax.xml.stream.XMLInputFactory#newFactoryinstead of the deprecatedjavax.xml.stream.XMLInputFactory#newInstancein Java 7 or higher.
- Use
- org.openrewrite.java.migrate.javax.MigrateXMLOutputFactoryNewInstanceToNewFactory
- Use
javax.xml.stream.XMLOutputFactory#newFactory(String, ClassLoader) - Use
javax.xml.stream.XMLOutputFactory#newFactoryinstead of the deprecatedjavax.xml.stream.XMLOutputFactory#newInstancein Java 7 or higher.
- Use
- org.openrewrite.java.migrate.javax.openJPAToEclipseLink
- Migrate from OpenJPA to EclipseLink JPA
- These recipes help migrate Java Persistence applications using OpenJPA to EclipseLink JPA.
- org.openrewrite.java.migrate.lang.FindNonVirtualExecutors
- Find non-virtual
ExecutorServicecreation - Find all places where static
java.util.concurrent.Executorsmethod creates a non-virtualjava.util.concurrent.ExecutorService. This recipe can be used to search froExecutorServicethat can be replaced by Virtual Thread executor.
- Find non-virtual
- org.openrewrite.java.migrate.lang.FindVirtualThreadOpportunities
- Find Virtual Thread opportunities
- Find opportunities to convert existing code to use Virtual Threads.
- org.openrewrite.java.migrate.lang.JavaLangAPIs
- Use modernized
java.langAPIs - Certain Java lang APIs have become deprecated and their usages changed, necessitating usage changes.
- Use modernized
- org.openrewrite.java.migrate.lang.MigrateCharacterIsJavaLetterOrDigitToIsJavaIdentifierPart
- Use
Character#isJavaIdentifierPart(char) - Use
Character#isJavaIdentifierPart(char)instead of the deprecatedCharacter#isJavaLetterOrDigit(char)in Java 1.1 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateCharacterIsJavaLetterToIsJavaIdentifierStart
- Use
Character#isJavaIdentifierStart(char) - Use
Character#isJavaIdentifierStart(char)instead of the deprecatedCharacter#isJavaLetter(char)in Java 1.1 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateCharacterIsSpaceToIsWhitespace
- Use
Character#isWhitespace(char) - Use
Character#isWhitespace(char)instead of the deprecatedCharacter#isSpace(char)in Java 1.1 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateRuntimeVersionMajorToFeature
- Use
Runtime.Version#feature() - Use
Runtime.Version#feature()instead of the deprecatedRuntime.Version#major()in Java 10 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateRuntimeVersionMinorToInterim
- Use
Runtime.Version#interim() - Use
Runtime.Version#interim()instead of the deprecatedRuntime.Version#minor()in Java 10 or higher.
- Use
- org.openrewrite.java.migrate.lang.MigrateRuntimeVersionSecurityToUpdate
- Use
Runtime.Version#update() - Use
Runtime.Version#update()instead of the deprecatedRuntime.Version#security()in Java 10 or higher.
- Use
- 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.
- org.openrewrite.java.migrate.logging.JavaLoggingAPIs
- Use modernized
java.util.loggingAPIs - Certain Java logging APIs have become deprecated and their usages changed, necessitating usage changes.
- Use modernized
- org.openrewrite.java.migrate.logging.MigrateInterfaceLoggingMXBeanToPlatformLoggingMXBean
- Use
java.lang.management.PlatformLoggingMXBean - Use
java.lang.management.PlatformLoggingMXBeaninstead of the deprecatedjava.util.logging.LoggingMXBeanin Java 9 or higher.
- Use
- org.openrewrite.java.migrate.lombok.LombokBestPractices
- Lombok Best Practices
- Applies all recipes that enforce best practices for using Lombok.
- 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.lombok.log.UseLombokLogAnnotations
- Use Lombok logger annotations instead of explicit fields
- Applies all recipes that replace logger declarations with class level annotations.
- org.openrewrite.java.migrate.net.JavaNetAPIs
- Use modernized
java.netAPIs - Certain Java networking APIs have become deprecated and their usages changed, necessitating usage changes.
- Use modernized
- org.openrewrite.java.migrate.net.MigrateMulticastSocketGetTTLToGetTimeToLive
- Use
java.net.MulticastSocket#getTimeToLive() - Use
java.net.MulticastSocket#getTimeToLive()instead of the deprecatedjava.net.MulticastSocket#getTTL()in Java 1.2 or higher.
- Use
- org.openrewrite.java.migrate.nio.file.PathsGetToPathOf
- Replace
Paths.getwithPath.of - The
java.nio.file.Paths.getmethod was introduced in Java SE 7. Thejava.nio.file.Path.ofmethod was introduced in Java SE 11. This recipe replaces all usages ofPaths.getwithPath.offor consistency.
- Replace
- org.openrewrite.java.migrate.sql.JavaSqlAPIs
- Use modernized
java.sqlAPIs - Certain Java sql APIs have become deprecated and their usages changed, necessitating usage changes.
- Use modernized
- org.openrewrite.java.migrate.util.JavaUtilAPIs
- Use modernized
java.utilAPIs - Certain java util APIs have been introduced and are favored over previous APIs.
- Use modernized
- org.openrewrite.java.migrate.util.MigrateInflaterDeflaterToClose
- Replace
InflaterandDeflaterend()calls withclose() - Replace
end()method calls withclose()method calls forInflaterandDeflaterclasses in Java 25+, as they now implement AutoCloseable.
- Replace
- org.openrewrite.java.migrate.util.SequencedCollection
- Adopt
SequencedCollection - Replace older code patterns with
SequencedCollectionmethods, as per https://openjdk.org/jeps/431.
- Adopt
- org.openrewrite.java.recipes.JavaRecipeBestPractices
- Java Recipe best practices
- Best practices for Java recipe development.
- org.openrewrite.java.recipes.RecipeNullabilityBestPractices
- Recipe nullability best practices
- Use JSpecify nullable annotations; drop Nonnull annotations; use
NullMarkedonpackage-info.javainstead.
- org.openrewrite.java.recipes.RecipeTestingBestPractices
- Recipe testing best practices
- Best practices for testing recipes.
- org.openrewrite.java.recipes.UpgradeTestsToJava21
- Migrate tests to Java 21
- Use Java 21 features in tests.
- org.openrewrite.java.search.FindSecrets
- Find plain text secrets
- Find secrets stored in plain text in code.
- org.openrewrite.java.security.JavaSecurityBestPractices
- Java security best practices
- Applies security best practices to Java code.
- org.openrewrite.java.security.OwaspA01
- Remediate OWASP A01:2021 Broken access control
- OWASP A01:2021 describes failures related to broken access control.
- org.openrewrite.java.security.OwaspA02
- Remediate OWASP A02:2021 Cryptographic failures
- OWASP A02:2021 describes failures related to cryptography (or lack thereof), which often lead to exposure of sensitive data. This recipe seeks to remediate these vulnerabilities.
- org.openrewrite.java.security.OwaspA03
- Remediate OWASP A03:2021 Injection
- OWASP A03:2021 describes failures related to user-supplied data being used to influence program state to operate outside of its intended bounds. This recipe seeks to remediate these vulnerabilities.
- org.openrewrite.java.security.OwaspA05
- Remediate OWASP A05:2021 Security misconfiguration
- OWASP A05:2021 describes failures related to security misconfiguration.
- org.openrewrite.java.security.OwaspA06
- Remediate OWASP A06:2021 Vulnerable and outdated components
- OWASP A06:2021 describes failures related to vulnerable and outdated components.
- org.openrewrite.java.security.OwaspA08
- Remediate OWASP A08:2021 Software and data integrity failures
- OWASP A08:2021 software and data integrity failures.
- org.openrewrite.java.security.OwaspTopTen
- Remediate vulnerabilities from the OWASP Top Ten
- OWASP publishes a list of the most impactful common security vulnerabilities. These recipes identify and remediate vulnerabilities from the OWASP Top Ten.
- org.openrewrite.java.security.search.FindJacksonDefaultTypeMapping
- Find Jackson default type mapping enablement
ObjectMapper#enableTypeMapping(..)can lead to vulnerable deserialization.
- org.openrewrite.java.security.search.FindVulnerableJacksonJsonTypeInfo
- Find vulnerable uses of Jackson
@JsonTypeInfo - Identify where attackers can deserialize gadgets into a target field.
- Find vulnerable uses of Jackson
- org.openrewrite.java.security.secrets.FindArtifactorySecrets
- Find Artifactory secrets
- Locates Artifactory secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindAwsSecrets
- Find AWS secrets
- Locates AWS secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindAzureSecrets
- Find Azure secrets
- Locates Azure secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindDiscordSecrets
- Find Discord secrets
- Locates Discord secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindFacebookSecrets
- Find Facebook secrets
- Locates Facebook secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindGenericSecrets
- Find generic secrets
- Locates generic secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindGitHubSecrets
- Find GitHub secrets
- Locates GitHub secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindGoogleSecrets
- Find Google secrets
- Locates Google secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindHerokuSecrets
- Find Heroku secrets
- Locates Heroku secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindMailChimpSecrets
- Find MailChimp secrets
- Locates MailChimp secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindMailgunSecrets
- Find Mailgun secrets
- Locates Mailgun secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindNpmSecrets
- Find NPM secrets
- Locates NPM secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindPasswordInUrlSecrets
- Find passwords used in URLs
- Locates URLs that contain passwords in plain text.
- org.openrewrite.java.security.secrets.FindPayPalSecrets
- Find PayPal secrets
- Locates PayPal secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindPgpSecrets
- Find PGP secrets
- Locates PGP secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindPicaticSecrets
- Find Picatic secrets
- Locates Picatic secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindRsaSecrets
- Find RSA private keys
- Locates RSA private keys stored in plain text in code.
- org.openrewrite.java.security.secrets.FindSecrets
- Find secrets
- Locates secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindSendGridSecrets
- Find SendGrid secrets
- Locates SendGrid secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindSquareSecrets
- Find Square secrets
- Locates Square secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindSshSecrets
- Find SSH secrets
- Locates SSH secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindStripeSecrets
- Find Stripe secrets
- Locates Stripe secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindTelegramSecrets
- Find Telegram secrets
- Locates Telegram secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindTwilioSecrets
- Find Twilio secrets
- Locates Twilio secrets stored in plain text in code.
- org.openrewrite.java.security.secrets.FindTwitterSecrets
- Find Twitter secrets
- Locates Twitter secrets stored in plain text in code.
- org.openrewrite.java.spring.PropertiesToKebabCase
- Normalize Spring properties to kebab-case
- Normalize Spring properties to use lowercase and hyphen-separated syntax. For example, changing
spring.main.showBannertospring.main.show-banner. With Spring's relaxed binding,kebab-casemay be used in properties files and still be converted to configuration beans. Note, an exception to this is the case of@Value, which is match-sensitive. For example,@Value("${anExampleValue}")will not matchan-example-value. The Spring reference documentation recommends usingkebab-casefor properties where possible.
- org.openrewrite.java.spring.batch.ListenerSupportClassToInterface
- Transform classes that extend
*ListenerSupportto implement the*Listenerinterfaces instead - As of 5.0
*Listenerinterfaces default methods (made possible by a Java 8 baseline) can be implemented directly without the need for the adapter.
- Transform classes that extend
- org.openrewrite.java.spring.batch.SpringBatch4To5Migration
- Migrate to Spring Batch 5.0 from 4.3
- Migrate applications built on Spring Batch 4.3 to the latest Spring Batch 5.0 release.
- org.openrewrite.java.spring.batch.SpringBatch5To6Migration
- Migrate to Spring Batch 6.0 from 5.2
- Migrate applications built on Spring Batch 5.2 to the latest Spring Batch 6.0 release.
- org.openrewrite.java.spring.batch.UpgradeSkipPolicyParameterType
- Change the type of
skipCountparameter inSkipPolicyfrominttolong - The
skipCountparameter inorg.springframework.batch.core.step.skip.SkipPolicy#shouldSkiphas been changed frominttolong, this recipe updates the parameter type in the implementing classes.
- Change the type of
- org.openrewrite.java.spring.boot2.DatabaseComponentAndBeanInitializationOrdering
- Adds
@DependsOnDatabaseInitializationto Spring Beans and Components depending onjavax.sql.DataSource - Beans of certain well-known types, such as
JdbcTemplate, will be ordered so that they are initialized after the database has been initialized. If you have a bean that works with theDataSourcedirectly, annotate its class or@Beanmethod with@DependsOnDatabaseInitializationto ensure that it too is initialized after the database has been initialized. See the release notes for more.
- Adds
- org.openrewrite.java.spring.boot2.MaybeAddJavaxValidationApi
- Add
javax.validation-apidependency - Conditional on the application using a version of Spring Boot which uses javax but provides a hibernate-validator version which exports the jakarta.validation-api instead.
- Add
- org.openrewrite.java.spring.boot2.MaybeAddSpringBootStarterActuator
- Replace
micrometer-spring-legacywithspring-boot-starter-actuator - Replace deprecated
micrometer-spring-legacywithspring-boot-starter-actuator.
- Replace
- org.openrewrite.java.spring.boot2.MigrateApplicationHealthIndicatorToPingHealthIndicator
- Use
PingHealthIndicator org.springframework.boot.actuate.health.ApplicationHealthIndicatorwas deprecated in 2.2.
- Use
- org.openrewrite.java.spring.boot2.MigrateDatabaseCredentials
- Migrate flyway and liquibase credentials
- If you currently define a
spring.flyway.urlorspring.liquibase.urlyou may need to provide additional username and password properties. In earlier versions of Spring Boot, these settings were derived fromspring.datasourceproperties but this turned out to be problematic for people that provided their ownDataSourcebeans.
- org.openrewrite.java.spring.boot2.MigrateErrorControllerPackageName
- Use
org.springframework.boot.web.servlet.error.ErrorController - Use
org.springframework.boot.web.servlet.error.ErrorControllerinstead of the deprecatedorg.springframework.boot.autoconfigure.web.ErrorControllerin Spring Boot 2.0 or higher.
- Use
- org.openrewrite.java.spring.boot2.MigrateHibernateConstraintsToJavax
- Use
javax.validation.constraints - Use
javax.validation.constraintsinstead of the deprecatedorg.hibernate.validator.constraintsin Spring Boot 2.0 or higher.
- Use
- org.openrewrite.java.spring.boot2.MigrateHttpMessageConvertersPackageName
- Use
org.springframework.boot.autoconfigure.http.HttpMessageConverters - Use
org.springframework.boot.autoconfigure.http.HttpMessageConvertersinstead of the deprecatedorg.springframework.boot.autoconfigure.web.HttpMessageConvertersin Spring Boot 2.0 or higher.
- Use
- org.openrewrite.java.spring.boot2.MigrateRestClientBuilderCustomizerPackageName
- Use
RestClientBuilderCustomizer org.springframework.boot.autoconfigure.elasticsearch.rest.RestClientBuilderCustomizerwas deprecated in 2.3.
- Use
- org.openrewrite.java.spring.boot2.MigrateRestTemplateBuilderBasicAuthorization
- Use
RestTemplateBuilder#basicAuthentication RestTemplateBuilder#basicAuthorizationwas deprecated in 2.1.
- Use
- org.openrewrite.java.spring.boot2.MigrateSpringBootServletInitializerPackageName
- Use
org.springframework.boot.web.servlet.support.SpringBootServletInitializer - Use
org.springframework.boot.web.servlet.support.SpringBootServletInitializerinstead of the deprecatedorg.springframework.boot.web.support.SpringBootServletInitializerin Spring Boot 1.4 or higher.
- Use
- org.openrewrite.java.spring.boot2.MigrateToWebServerFactoryCustomizer
- Use
WebServerFactoryCustomizer - Use
WebServerFactoryCustomizerinstead of the deprecatedEmbeddedServletContainerCustomizerin Spring Boot 2.0 or higher. This recipe will replace look for any classes that implementEmbeddedServletContainerCustomizerand change the interface toWebServerFactoryCustomizer<ConfigurableServletWebServerFactory>. This recipe also adjusts the types used in thecustomize()method from*EmbeddedServletContainerFactoryto their*ServletWebServerFactorycounterparts.
- Use
- org.openrewrite.java.spring.boot2.MigrateUndertowServletWebServerFactoryIsEagerInitFilters
- Use
isEagerFilterInit() org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory#isEagerInitFilterswas deprecated in 2.4 and are removed in 2.6.
- Use
- org.openrewrite.java.spring.boot2.MigrateUndertowServletWebServerFactorySetEagerInitFilters
- Use
setEagerFilterInit(boolean) org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory#setEagerInitFilterswas deprecated in 2.4 and are removed in 2.6.
- Use
- org.openrewrite.java.spring.boot2.MigrateWebTestClientBuilderCustomizerPackageName
- Use
WebTestClientBuilderCustomizer org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientBuilderCustomizerwas deprecated in 2.2.
- Use
- org.openrewrite.java.spring.boot2.RemoveObsoleteSpringRunners
- Remove obsolete Spring JUnit runners
- Remove obsolete classpath runners.
- org.openrewrite.java.spring.boot2.SpringBoot2BestPractices
- Spring Boot 2.x best practices
- Applies best practices to Spring Boot 2 applications.
- org.openrewrite.java.spring.boot2.SpringBoot2JUnit4to5Migration
- Migrate Spring Boot 2.x projects to JUnit 5 from JUnit 4
- This recipe will migrate a Spring Boot application's tests from JUnit 4 to JUnit 5. This spring-specific migration includes conversion of Spring Test runners to Spring Test extensions and awareness of the composable Spring Test annotations.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_0
- Migrate Spring Boot properties to 2.0
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_1
- Migrate Spring Boot properties to 2.1
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_2
- Migrate Spring Boot properties to 2.2
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_3
- Migrate Spring Boot properties to 2.3
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_4
- Migrate Spring Boot properties to 2.4
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_5
- Migrate Spring Boot properties to 2.5
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_6
- Migrate Spring Boot properties to 2.6
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_7
- Migrate Spring Boot properties to 2.7
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot2.UnnecessarySpringRunWith
- Remove unnecessary Spring
@RunWith - Remove
@RunWithannotations on Spring tests.
- Remove unnecessary Spring
- org.openrewrite.java.spring.boot2.UpgradeSpockToGroovy3
- Upgrade Spock to a Groovy 3 compatible variant
- Upgrade Spock dependencies to a Groovy 3 compatible 2.0 variant when Groovy 3 is on the classpath.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_0
- Migrate from Spring Boot 1.x to 2.0
- Migrate Spring Boot 1.x applications to the latest Spring Boot 2.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.0.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_1
- Migrate to Spring Boot 2.1
- Migrate applications to the latest Spring Boot 2.1 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.1.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_2
- Migrate to Spring Boot 2.2
- Migrate applications to the latest Spring Boot 2.2 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.2.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_3
- Migrate to Spring Boot 2.3
- Migrate applications to the latest Spring Boot 2.3 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.3.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_4
- Migrate to Spring Boot 2.4
- Migrate applications to the latest Spring Boot 2.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.4.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_5
- Upgrade to Spring Boot 2.5
- Upgrade to Spring Boot 2.5 from any prior 2.x version.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6
- Migrate to Spring Boot 2.6
- Migrate applications to the latest Spring Boot 2.6 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.6.
- org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7
- Migrate to Spring Boot 2.7
- Upgrade to Spring Boot 2.7.
- org.openrewrite.java.spring.boot2.search.FindUpgradeRequirementsSpringBoot_2_5
- Find patterns that require updating for Spring Boot 2.5
- Looks for a series of patterns that have not yet had auto-remediation recipes developed for.
- org.openrewrite.java.spring.boot2.search.MessagesInTheDefaultErrorView
- Find projects affected by changes to the default error view message attribute
- As of Spring Boot 2.5 the
messageattribute in the default error view was removed rather than blanked when it is not shown.spring-webmvcorspring-webfluxprojects that parse the error response JSON may need to deal with the missing item (release notes). You can still use theserver.error.include-messageproperty if you want messages to be included.
- org.openrewrite.java.spring.boot3.ActuatorEndpointSanitization
- Remove the deprecated properties
additional-keys-to-sanitizefrom theconfigpropsandenvend points - Spring Boot 3.0 removed the key-based sanitization mechanism used in Spring Boot 2.x in favor of a unified approach. See https://github.com/openrewrite/rewrite-spring/issues/228.
- Remove the deprecated properties
- org.openrewrite.java.spring.boot3.ChangeCassandraGroupId
- Change
com.datastax.osstoorg.apache.cassandra - Change
groupIdfromcom.datastax.osstoorg.apache.cassandraand adopt the Spring Boot 3.3 managed version.
- Change
- org.openrewrite.java.spring.boot3.EnableVirtualThreads
- Enable Virtual Threads on Java 21
- Set
spring.threads.virtual.enabledtotrueinapplication.propertiesorapplication.yml.
- org.openrewrite.java.spring.boot3.MigrateDropWizardDependencies
- Migrate dropWizard dependencies to Spring Boot 3.x
- Migrate dropWizard dependencies to the new artifactId, since these are changed with Spring Boot 3.
- org.openrewrite.java.spring.boot3.MigrateMaxHttpHeaderSize
- Rename
server.max-http-header-sizetoserver.max-http-request-header-size - Previously, the server.max-http-header-size was treated inconsistently across the four supported embedded web servers. When using Jetty, Netty, or Undertow it would configure the max HTTP request header size. When using Tomcat it would configure the max HTTP request and response header sizes. The renamed property is used to configure the http request header size in Spring Boot 3.0. To limit the max header size of an HTTP response on Tomcat or Jetty (the only two servers that support such a setting), use a
WebServerFactoryCustomizer.
- Rename
- org.openrewrite.java.spring.boot3.MigrateSapCfJavaLoggingSupport
- Migrate SAP cloud foundry logging support to Spring Boot 3.x
- Migrate SAP cloud foundry logging support from
cf-java-logging-support-servlettocf-java-logging-support-servlet-jakarta, to use Jakarta with Spring Boot 3.
- org.openrewrite.java.spring.boot3.MigrateThymeleafDependencies
- Migrate thymeleaf dependencies to Spring Boot 3.x
- Migrate thymeleaf dependencies to the new artifactId, since these are changed with Spring Boot 3.
- org.openrewrite.java.spring.boot3.RelocateLauncherClasses
- Relocate Launcher Classes
- Relocate classes that have been moved to different packages in Spring Boot 3.2.
- org.openrewrite.java.spring.boot3.ReplaceRestTemplateBuilderMethods
- Replace deprecated setters in
RestTemplateBuilder - Replaces
setConnectTimeout,setReadTimeout, andsetSslBundlemethod invocations withconnectTimeout,readTimeout, andsslBundlerespectively.
- Replace deprecated setters in
- org.openrewrite.java.spring.boot3.ReplaceStringLiteralsWithConstants
- Replace String literals with Spring constants
- Replace String literals with Spring constants where applicable.
- org.openrewrite.java.spring.boot3.SpringBoot33BestPractices
- Spring Boot 3.3 best practices
- Applies best practices to Spring Boot 3 applications.
- org.openrewrite.java.spring.boot3.SpringBoot3BestPracticesOnly
- Spring Boot 3.3 best practices (only)
- Applies best practices to Spring Boot 3 applications, without chaining in upgrades to Spring Boot.
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_0
- Migrate Spring Boot properties to 3.0
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_1
- Migrate Spring Boot properties to 3.1
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_2
- Migrate Spring Boot properties to 3.2
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_3
- Migrate Spring Boot properties to 3.3
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_4
- Migrate Spring Boot properties to 3.4
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_4_EnabledToAccess
- Migrate Enabled to Access Spring Boot Properties
- Migrate properties found in
application.propertiesandapplication.yml, specifically converting 'enabled' to 'access'.
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_5
- Migrate Spring Boot properties to 3.5
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot3.UpdatePrometheusPushgateway
- Update Prometheus Pushgateway Dependency Coordinates
- Update the Prometheus Pushgateway artifact ID for Spring Boot 3.5 compatibility.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_0
- Upgrade MyBatis to Spring Boot 2.0
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.0.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_1
- Upgrade MyBatis to Spring Boot 2.1
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.1.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_2
- Upgrade MyBatis to Spring Boot 2.2
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.2.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_3
- Upgrade MyBatis to Spring Boot 2.3
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.3.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_4
- Upgrade MyBatis to Spring Boot 2.4
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.4.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_5
- Upgrade MyBatis to Spring Boot 2.5
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.5.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_6
- Upgrade MyBatis to Spring Boot 2.6
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.6.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_7
- Upgrade MyBatis to Spring Boot 2.7
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.7.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_3_0
- Upgrade MyBatis to Spring Boot 3.0
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 3.0.
- org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_3_2
- Upgrade MyBatis to Spring Boot 3.2
- Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 3.2.
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0
- Migrate to Spring Boot 3.0
- Migrate applications to the latest Spring Boot 3.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.7.
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1
- Migrate to Spring Boot 3.1
- Migrate applications to the latest Spring Boot 3.1 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.0.
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2
- Migrate to Spring Boot 3.2
- Migrate applications to the latest Spring Boot 3.2 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.1.
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3
- Migrate to Spring Boot 3.3
- Migrate applications to the latest Spring Boot 3.3 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.2.
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4
- Migrate to Spring Boot 3.4 (Community Edition)
- Migrate applications to the latest Spring Boot 3.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5
- Migrate to Spring Boot 3.5 (Community Edition)
- Migrate applications to the latest Spring Boot 3.5 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.
- org.openrewrite.java.spring.boot4.AddSpringBootStarterFlyway
- Add
spring-boot-starter-flywayif using Flyway - Adds the necessary Spring Boot 4.0 Flyway starter for autoconfiguration based on dependency usage.
- Add
- org.openrewrite.java.spring.boot4.MigrateAutoconfigurePackages
- Migrate packages to modular starters
- Migrate to new packages used for autoconfiguration by Spring Boot 4.0 modules.
- org.openrewrite.java.spring.boot4.MigrateToModularStarters
- Migrate to Spring Boot 4.0 modular starters
- Adds the necessary Spring Boot 4.0 starter dependencies based on package usage. Spring Boot 4.0 has a modular design requiring explicit starters for each feature. This recipe detects feature usage via package imports and adds the appropriate starters. Note: Higher-level starters (like data-jpa) include lower-level ones (like jdbc) transitively, so only the highest-level detected starter is added for each technology.
- org.openrewrite.java.spring.boot4.ReplaceMockBeanAndSpyBean
- Replace
@MockBeanand@SpyBean - Replaces
@MockBeanand@SpyBeanannotations with@MockitoBeanand@MockitoSpyBean.
- Replace
- org.openrewrite.java.spring.boot4.SpringBootProperties_4_0
- Migrate Spring Boot properties to 4.0
- Migrate properties found in
application.propertiesandapplication.yml.
- org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0
- Migrate to Spring Boot 4.0 (Community Edition)
- Migrate applications to the latest Spring Boot 4.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.
- org.openrewrite.java.spring.cloud2022.DependencyUpgrades
- Upgrade dependencies to Spring Cloud 2022
- Upgrade dependencies to Spring Cloud 2022 from prior 2021.x version.
- org.openrewrite.java.spring.cloud2022.MigrateCloudSleuthToMicrometerTracing
- Migrate Spring Cloud Sleuth 3.1 to Micrometer Tracing 1.0
- Spring Cloud Sleuth has been discontinued and only compatible with Spring Boot 2.x.
- org.openrewrite.java.spring.cloud2022.UpgradeSpringCloud_2022
- Migrate to Spring Cloud 2022
- Migrate applications to the latest Spring Cloud 2022 (Kilburn) release.
- org.openrewrite.java.spring.cloud2023.DependencyUpgrades
- Upgrade dependencies to Spring Cloud 2023
- Upgrade dependencies to Spring Cloud 2023 from prior 2022.x version.
- org.openrewrite.java.spring.cloud2023.UpgradeSpringCloud_2023
- Migrate to Spring Cloud 2023
- Migrate applications to the latest Spring Cloud 2023 (Leyton) release.
- org.openrewrite.java.spring.cloud2024.DependencyUpgrades
- Upgrade dependencies to Spring Cloud 2024
- Upgrade dependencies to Spring Cloud 2024 from prior 2023.x version.
- org.openrewrite.java.spring.cloud2024.UpgradeSpringCloud_2024
- Migrate to Spring Cloud 2024
- Migrate applications to the latest Spring Cloud 2024 (Moorgate) release.
- org.openrewrite.java.spring.cloud2025.DependencyUpgrades
- Upgrade dependencies to Spring Cloud 2025
- Upgrade dependencies to Spring Cloud 2025 from prior 2024.x version.
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayDeprecatedModulesAndStarters
- Migrate to New Spring Cloud Gateway Modules and Starters
- Migrate to new Spring Cloud Gateway modules and starters for Spring Cloud 2025.
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProperties
- Migrate Spring Cloud Gateway Properties
- Migrate Spring Cloud Gateway properties for Spring Cloud 2025 release.
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProxyWebMvcProperties
- Migrate Spring Cloud Gateway Proxy WebMvc Properties
- Migrate Spring Cloud Gateway Proxy WebMvc properties for Spring Cloud 2025 release.
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProxyWebfluxProperties
- Migrate Spring Cloud Gateway Proxy Webflux Properties
- Migrate Spring Cloud Gateway Proxy Webflux properties for Spring Cloud 2025 release.
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayWebMvcProperties
- Migrate Spring Cloud Gateway WebMvc Properties
- Migrate Spring Cloud Gateway WebMvc properties for Spring Cloud 2025 release.
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayWebfluxProperties
- Migrate Spring Cloud Gateway Webflux Properties
- Migrate Spring Cloud Gateway Webflux properties for Spring Cloud 2025 release.
- org.openrewrite.java.spring.cloud2025.UpgradeSpringCloud_2025
- Migrate to Spring Cloud 2025
- Migrate applications to the latest Spring Cloud 2025 (Northfields) release.
- org.openrewrite.java.spring.data.UpgradeSpringData_2_3
- Migrate to Spring Data 2.3
- Migrate applications to the latest Spring Data 2.3 release.
- org.openrewrite.java.spring.data.UpgradeSpringData_2_5
- Migrate to Spring Data JPA 2.5
- Migrate applications to the latest Spring Data 2.5 release.
- org.openrewrite.java.spring.data.UpgradeSpringData_2_7
- Migrate to Spring Data JPA 2.7
- Migrate applications to the latest Spring Data JPA 2.7 release.
- org.openrewrite.java.spring.data.UpgradeSpringData_3_4
- Migrate to Spring Data JPA 3.4
- Migrate applications to the latest Spring Data JPA 3.4 release.
- org.openrewrite.java.spring.data.UseJpaRepositoryDeleteAllInBatch
- Use
JpaRepository#deleteAllInBatch(Iterable<T> entities) JpaRepository#deleteInBatch(Iterable)was deprecated in 2.5.
- Use
- org.openrewrite.java.spring.data.UseJpaRepositoryGetById
- Use
JpaRepository#getById(ID id) JpaRepository#getOne(ID)was deprecated in 2.5.
- Use
- org.openrewrite.java.spring.data.UseJpaRepositoryGetReferenceById
- Use
JpaRepository#getReferenceById(ID id) JpaRepository#getOne(ID)was deprecated in 2.5 andJpaRepository#getById(ID)was deprecated in 2.7.
- Use
- org.openrewrite.java.spring.framework.MigrateResponseStatusException
- Migrate breaking changes in
ResponseStatusException - Migrate Spring Framework 5.3's
ResponseStatusExceptionmethodgetRawStatusCode()to Spring Framework 6'sgetStatusCode().value()andResponseStatusExceptionmethodgetStatus()to Spring Framework 6'sgetStatusCode().
- Migrate breaking changes in
- org.openrewrite.java.spring.framework.MigrateSpringAssert
- Migrate removed Spring
Assertmethods - Assert methods without a message argument have been removed in Spring Framework 6.0.
- Migrate removed Spring
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_5_0
- Migrate to Spring Framework 5.0
- Migrate applications to the latest Spring Framework 5.0 release.
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_5_1
- Migrate to Spring Framework 5.1
- Migrate applications to the latest Spring Framework 5.1 release.
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_5_2
- Migrate to Spring Framework 5.2
- Migrate applications to the latest Spring Framework 5.2 release.
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_5_3
- Migrate to Spring Framework 5.3
- Migrate applications to the latest Spring Framework 5.3 release.
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_0
- Migrate to Spring Framework 6.0
- Migrate applications to the latest Spring Framework 6.0 release.
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_1
- Migrate to Spring Framework 6.1
- Migrate applications to the latest Spring Framework 6.1 release.
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_2
- Migrate to Spring Framework 6.2
- Migrate applications to the latest Spring Framework 6.2 release.
- org.openrewrite.java.spring.framework.UpgradeSpringFramework_7_0
- Migrate to Spring Framework 7.0
- Migrate applications to the latest Spring Framework 7.0 release.
- org.openrewrite.java.spring.framework.UseObjectUtilsIsEmpty
- Use
ObjectUtils#isEmpty(Object) StringUtils#isEmpty(Object)was deprecated in 5.3.
- Use
- org.openrewrite.java.spring.http.SpringWebDependency
- Find Spring Web dependency
- Find compile scoped Spring Web dependency for Maven and Gradle, both direct and transitive.
- org.openrewrite.java.spring.kafka.UpgradeSpringKafka_3_0
- Migrate to Spring Kafka 3.0
- Migrate applications to the latest Spring Kafka 3.0 release.
- org.openrewrite.java.spring.security5.RenameNimbusdsJsonObjectPackageName
- Rename the package name from
com.nimbusds.jose.shaded.jsontonet.minidev.json - Rename the package name from
com.nimbusds.jose.shaded.jsontonet.minidev.json.
- Rename the package name from
- org.openrewrite.java.spring.security5.ReplaceGlobalMethodSecurityWithMethodSecurityXml
- Replace global method security with method security
@EnableGlobalMethodSecurityand<global-method-security>are deprecated in favor of@EnableMethodSecurityand<method-security>, respectively. The new annotation and XML element activate Spring’s pre-post annotations by default and use AuthorizationManager internally.
- org.openrewrite.java.spring.security5.UpgradeSpringSecurity_5_7
- Migrate to Spring Security 5.7
- Migrate applications to the latest Spring Security 5.7 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security5.UpgradeSpringSecurity_5_8
- Migrate to Spring Security 5.8
- Migrate applications to the latest Spring Security 5.8 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security5.search.FindEncryptorsQueryableTextUses
- Finds uses of
Encryptors.queryableText() Encryptors.queryableText()is insecure and is removed in Spring Security 6.
- Finds uses of
- org.openrewrite.java.spring.security6.RemoveUseAuthorizationManager
- Remove unnecessary
use-authorization-managerfor message security in Spring security 6 - In Spring Security 6,
<websocket-message-broker>defaultsuse-authorization-managertotrue. So, theuse-authorization-managerattribute for message security is no longer needed and can be removed.
- Remove unnecessary
- org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_0
- Migrate to Spring Security 6.0
- Migrate applications to the latest Spring Security 6.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_1
- Migrate to Spring Security 6.1
- Migrate applications to the latest Spring Security 6.1 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_2
- Migrate to Spring Security 6.2
- Migrate applications to the latest Spring Security 6.2 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_3
- Migrate to Spring Security 6.3
- Migrate applications to the latest Spring Security 6.3 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_4
- Migrate to Spring Security 6.4
- Migrate applications to the latest Spring Security 6.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_5
- Migrate to Spring Security 6.5
- Migrate applications to the latest Spring Security 6.5 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.spring.security7.SecurityConfigurerRemoveThrowsException
- Remove throws exception in
SecurityConfigurermethodsinitandconfigure - Remove throws exception in
SecurityConfigurermethodsinitandconfigure.
- Remove throws exception in
- org.openrewrite.java.spring.security7.UpgradeSpringSecurity_7_0
- Migrate to Spring Security 7.0
- Migrate applications to the latest Spring Security 7.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
- org.openrewrite.java.springdoc.MigrateSpringdocCommon
- Migrate from springdoc-openapi-common to springdoc-openapi-starter-common
- Migrate from springdoc-openapi-common to springdoc-openapi-starter-common.
- org.openrewrite.java.springdoc.ReplaceSpringFoxDependencies
- Replace SpringFox Dependencies
- Replace SpringFox Dependencies.
- org.openrewrite.java.springdoc.SpringFoxToSpringDoc
- Migrate from SpringFox Swagger to SpringDoc and OpenAPI
- Migrate from SpringFox Swagger to SpringDoc and OpenAPI.
- org.openrewrite.java.springdoc.SwaggerToSpringDoc
- Migrate from Swagger to SpringDoc and OpenAPI
- Migrate from Swagger to SpringDoc and OpenAPI.
- org.openrewrite.java.springdoc.UpgradeSpringDoc_2
- Upgrade to SpringDoc 2.1
- Upgrade to SpringDoc v2.1, as described in the upgrade guide.
- org.openrewrite.java.springdoc.UpgradeSpringDoc_2_2
- Upgrade to SpringDoc 2.2
- Upgrade to SpringDoc v2.2.
- org.openrewrite.java.springdoc.UpgradeSpringDoc_2_5
- Upgrade to SpringDoc 2.5
- Upgrade to SpringDoc v2.5.
- org.openrewrite.java.springdoc.UpgradeSpringDoc_2_6
- Upgrade to SpringDoc 2.6
- Upgrade to SpringDoc v2.6.
- org.openrewrite.java.springdoc.UpgradeSpringDoc_2_8
- Upgrade to SpringDoc 2.8
- Upgrade to SpringDoc v2.8.
- org.openrewrite.java.springdoc.UpgradeSpringDoc_3_0
- Upgrade to SpringDoc 3.0
- Upgrade to SpringDoc v3.0.
- org.openrewrite.java.struts.migrate6.MigrateAwareInterfaces
- Migrate Struts 2.0 interceptors to action "aware" interfaces
- These types have moved to a new package in Struts 6.0 and their methods have been renamed from set* to with*.
- org.openrewrite.java.struts.migrate6.MigrateOpenSymphonyClasses
- Migrate OpenSymphony classes to Struts 6.0
- Migrate classes from
com.opensymphony.xwork2to their replacements inorg.apache.struts2.
- org.openrewrite.java.struts.migrate6.MigrateStruts6
- Migrate to Struts 6.0
- Migrate Struts 2.x to Struts 6.0.
- org.openrewrite.java.struts.migrate6.MigrateStruts6Constants
- Migrate to Struts 6.0 constants
- All Xwork constants had been already deprecated, with this version all of them have been removed and Struts constants have been used instead.
- org.openrewrite.java.struts.migrate6.UpgradeStruts6Dependencies
- Upgrade Struts 6.0 dependencies
- Upgrade Struts 2.x dependencies to Struts 6.0.
- org.openrewrite.java.testing.archunit.ArchUnit0to1Migration
- ArchUnit 0.x upgrade
- Upgrade ArchUnit from 0.x to 1.x.
- org.openrewrite.java.testing.arquillian.ArquillianJUnit4ToArquillianJUnit5
- Use Arquillian JUnit 5 Extension
- Migrates Arquillian JUnit 4 to JUnit 5.
- org.openrewrite.java.testing.assertj.Assertj
- AssertJ best practices
- Migrates JUnit asserts to AssertJ and applies best practices to assertions.
- org.openrewrite.java.testing.assertj.FestToAssertj
- Migrate Fest 2.x to AssertJ
- AssertJ provides a rich set of assertions, truly helpful error messages, improves test code readability. Converts Fest 2.x imports to AssertJ imports.
- org.openrewrite.java.testing.assertj.JUnitToAssertj
- Migrate JUnit asserts to AssertJ
- AssertJ provides a rich set of assertions, truly helpful error messages, improves test code readability. Converts assertions from
org.junit.jupiter.api.Assertionstoorg.assertj.core.api.Assertions. Will convert JUnit 4 to JUnit Jupiter if necessary to match and modify assertions.
- org.openrewrite.java.testing.assertj.SimplifyAssertJAssertions
- Shorten AssertJ assertions
- Replace AssertJ assertions where a dedicated assertion is available for the same actual value.
- org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertions
- Simplify AssertJ chained assertions
- Replace AssertJ assertions where a method is called on the actual value with a dedicated assertion.
- org.openrewrite.java.testing.assertj.StaticImports
- Statically import AssertJ's
assertThat - Consistently use a static import rather than inlining the
Assertionsclass name in tests.
- Statically import AssertJ's
- org.openrewrite.java.testing.byteman.BytemanJUnit4ToBytemanJUnit5
- Use Byteman JUnit 5 dependency
- Migrates Byteman JUnit 4 to JUnit 5.
- org.openrewrite.java.testing.cleanup.BestPractices
- Testing best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.datafaker.JavaFakerToDataFaker
- Migrate from Java Faker to Datafaker
- Change imports and dependencies related to Java Faker to Datafaker replacements.
- org.openrewrite.java.testing.dbrider.MigrateDbRiderSpringToDbRiderJUnit5
- Migrate rider-spring (JUnit4) to rider-junit5 (JUnit5)
- This recipe will migrate the necessary dependencies and annotations from DbRider with JUnit4 to JUnit5 in a Spring application.
- org.openrewrite.java.testing.easymock.EasyMockToMockito
- Migrate from EasyMock to Mockito
- This recipe will apply changes commonly needed when migrating from EasyMock to Mockito.
- org.openrewrite.java.testing.hamcrest.AddHamcrestIfUsed
- Add
org.hamcrest:hamcrestif it is used - JUnit Jupiter does not include hamcrest as a transitive dependency. If needed, add a direct dependency.
- Add
- org.openrewrite.java.testing.hamcrest.ConsistentHamcrestMatcherImports
- Use consistent Hamcrest matcher imports
- Use consistent imports for Hamcrest matchers, and remove wrapping
is(Matcher)calls ahead of further changes.
- org.openrewrite.java.testing.hamcrest.MigrateHamcrestToAssertJ
- Migrate Hamcrest assertions to AssertJ
- Migrate Hamcrest
assertThat(..)to AssertJAssertions.
- org.openrewrite.java.testing.hamcrest.MigrateHamcrestToJUnit5
- Migrate Hamcrest assertions to JUnit Jupiter
- Migrate Hamcrest
assertThat(..)to JUnit JupiterAssertions.
- org.openrewrite.java.testing.htmlunit.UpgradeHtmlUnit_3
- Migrate to HtmlUnit 3.x
- Automates the HtmlUnit migration guide from 2.x to 3.x.
- org.openrewrite.java.testing.jmockit.JMockitToMockito
- Migrate from JMockit to Mockito
- This recipe will apply changes commonly needed when migrating from JMockit to Mockito.
- org.openrewrite.java.testing.junit.JUnit6BestPractices
- JUnit 6 best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.junit.JupiterBestPractices
- JUnit Jupiter best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.junit5.CleanupAssertions
- Clean Up Assertions
- Simplifies JUnit Jupiter assertions to their most-direct equivalents.
- org.openrewrite.java.testing.junit5.ExcludeJUnit4UnlessUsingTestcontainers
- Exclude JUnit 4, unless Testcontainers is used
- Excludes JUnit 4, as it ought not to be necessary in a JUnit 5 project, unless Testcontainers is used.
- org.openrewrite.java.testing.junit5.IgnoreToDisabled
- Use JUnit Jupiter
@Disabled - Migrates JUnit 4.x
@Ignoreto JUnit Jupiter@Disabled.
- Use JUnit Jupiter
- org.openrewrite.java.testing.junit5.JUnit4to5Migration
- JUnit Jupiter migration from JUnit 4.x
- Migrates JUnit 4.x tests to JUnit Jupiter.
- org.openrewrite.java.testing.junit5.JUnit5BestPractices
- JUnit 5 best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.junit5.MigrateAssumptions
- Use
Assertions#assume*(..)and Hamcrest'sMatcherAssume#assume*(..) - Many of JUnit 4's
Assume#assume(..)methods have no direct counterpart in JUnit 5 and require Hamcrest JUnit'sMatcherAssume.
- Use
- org.openrewrite.java.testing.junit5.StaticImports
- Statically import JUnit Jupiter assertions
- Always use a static import for assertion methods.
- org.openrewrite.java.testing.junit5.ThrowingRunnableToExecutable
- Use JUnit Jupiter
Executable - Migrates JUnit 4.x
ThrowingRunnableto JUnit JupiterExecutable.
- Use JUnit Jupiter
- org.openrewrite.java.testing.junit5.UpgradeOkHttpMockWebServer
- Use OkHttp 3 MockWebServer for JUnit 5
- Migrates OkHttp 3
MockWebServerto enable JUnit Jupiter Extension support.
- org.openrewrite.java.testing.junit5.UpgradeSurefirePlugin
- Upgrade Surefire Plugin
- Upgrades the Maven Surefire Plugin to the latest version if still using an older Maven version.
- org.openrewrite.java.testing.junit5.UpgradeToJUnit513
- Upgrade to JUnit 5.13
- Upgrades JUnit 5 to 5.13.x and migrates all deprecated APIs.
- org.openrewrite.java.testing.junit5.UpgradeToJUnit514
- Upgrade to JUnit 5.14
- Upgrades JUnit 5 to 5.14.x and migrates all deprecated APIs.
- org.openrewrite.java.testing.junit5.UseHamcrestAssertThat
- Use
MatcherAssert#assertThat(..) - JUnit 4's
Assert#assertThat(..)This method was deprecated in JUnit 4 and removed in JUnit Jupiter.
- Use
- org.openrewrite.java.testing.junit5.UseMockitoExtension
- Use Mockito JUnit Jupiter extension
- Migrate uses of
@RunWith(MockitoJUnitRunner.class)(and similar annotations) to@ExtendWith(MockitoExtension.class).
- org.openrewrite.java.testing.junit5.UseXMLUnitLegacy
- Use XMLUnit Legacy for JUnit 5
- Migrates XMLUnit 1.x to XMLUnit legacy 2.x.
- org.openrewrite.java.testing.junit5.VertxUnitToVertxJunit5
- Use Vert.x JUnit 5 Extension
- Migrates Vert.x
@RunWithVertxUnitRunnerto the JUnit Jupiter@ExtendWithVertxExtension.
- org.openrewrite.java.testing.junit6.JUnit5to6Migration
- JUnit 6 migration from JUnit 5.x
- Migrates JUnit 5.x tests to JUnit 6.x.
- org.openrewrite.java.testing.mockito.Mockito1to3Migration
- Mockito 3.x migration from 1.x
- Upgrade Mockito from 1.x to 3.x.
- org.openrewrite.java.testing.mockito.Mockito1to4Migration
- Mockito 4.x upgrade
- Upgrade Mockito from 1.x to 4.x.
- org.openrewrite.java.testing.mockito.Mockito1to5Migration
- Mockito 5.x upgrade
- Upgrade Mockito from 1.x to 5.x.
- org.openrewrite.java.testing.mockito.Mockito4to5Only
- Mockito 4 to 5.x upgrade only
- Upgrade Mockito from 4.x to 5.x. Does not include 1.x to 4.x migration.
- org.openrewrite.java.testing.mockito.MockitoBestPractices
- Mockito best practices
- Applies best practices for Mockito tests.
- org.openrewrite.java.testing.mockito.ReplacePowerMockito
- Replace PowerMock with raw Mockito
- PowerMockito with raw Mockito; best executed as part of a Mockito upgrade.
- org.openrewrite.java.testing.testcontainers.ExplicitContainerImages
- Explicit container images and versions
- Replace implicit default container images and versions with explicit versions.
- org.openrewrite.java.testing.testcontainers.GetHostMigration
- Replace
ContainerState.getContainerIpAddress()withgetHost() - Replace
org.testcontainers.containers.ContainerState.getContainerIpAddress()withgetHost().
- Replace
- org.openrewrite.java.testing.testcontainers.TestContainersBestPractices
- Testcontainers best practices
- Apply best practices to Testcontainers usage.
- org.openrewrite.java.testing.testcontainers.Testcontainers2ContainerClasses
- Testcontainers 2 container classes
- Change Testcontainers container classes to their new package locations in Testcontainers 2.x.
- org.openrewrite.java.testing.testcontainers.Testcontainers2Dependencies
- Rename Testcontainers dependencies
- Change Testcontainers dependencies to adopt the new consistent
testcontainers-prefix.
- org.openrewrite.java.testing.testcontainers.Testcontainers2Migration
- Migrate to testcontainers-java 2.x
- Change dependencies and types to migrate to testcontainers-java 2.x.
- org.openrewrite.java.testing.testng.TestNgToAssertj
- Migrate TestNG assertions to AssertJ
- Convert assertions from
org.testng.Asserttoorg.assertj.core.api.Assertions.
- org.openrewrite.java.testing.truth.MigrateTruthToAssertJ
- Migrate Google Truth to AssertJ
- Migrate Google Truth assertions to AssertJ assertions.
- org.openrewrite.javascript.change-import
- Change import
- Changes an import from one module/member to another, updating all type attributions.
- org.openrewrite.javascript.cleanup.add-parse-int-radix
- Add radix to
parseInt - Adds the radix parameter (base 10) to
parseInt()calls that are missing it, preventing potential parsing issues.
- Add radix to
- org.openrewrite.javascript.cleanup.async-callback-in-sync-array-method
- Detect async callbacks in synchronous array methods
- Detects async callbacks passed to array methods like .some(), .every(), .filter() which don't await promises. This is a common bug where Promise objects are always truthy.
- org.openrewrite.javascript.cleanup.order-imports
- Order imports
- Sort imports by category and module path. Categories: side-effect, namespace, default, named, type. Within each category, imports are sorted alphabetically by module path. Named specifiers within each import are also sorted alphabetically.
- org.openrewrite.javascript.cleanup.prefer-optional-chain
- Prefer optional chaining
- Converts ternary expressions like
foo ? foo.bar : undefinedto use optional chaining syntaxfoo?.bar.
- org.openrewrite.javascript.cleanup.use-object-property-shorthand
- Use object property shorthand
- Simplifies object properties where the property name and value/variable name are the same (e.g.,
{ x: x }becomes{ x }). Applies to both destructuring patterns and object literals.
- org.openrewrite.javascript.dependencies.add-dependency
- Add npm dependency
- Adds a new dependency to
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.dependencies.find-dependency
- Find Node.js dependency
- Finds dependencies in a project's
package.json. Can find both direct dependencies and dependencies that transitively include the target package. This recipe is commonly used as a precondition for other recipes.
- org.openrewrite.javascript.dependencies.upgrade-dependency-version
- Upgrade npm dependency version
- Upgrades the version of a direct dependency in
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.dependencies.upgrade-transitive-dependency-version
- Upgrade transitive npm dependency version
- Upgrades the version of a transitive dependency by adding override/resolution entries to
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.format.auto-format
- Auto-format JavaScript/TypeScript code
- Format JavaScript and TypeScript code using formatting rules auto-detected from the project's existing code style.
- org.openrewrite.javascript.migrate.es6.modernize-octal-escape-sequences
- Modernize octal escape sequences
- Convert old-style octal escape sequences (e.g.,
\0,\123) to modern hex escape sequences (e.g.,\x00,\x53) or Unicode escape sequences (e.g.,\u0000,\u0053).
- org.openrewrite.javascript.migrate.es6.modernize-octal-literals
- Modernize octal literals
- Convert old-style octal literals (e.g.,
0777) to modern ES6 syntax (e.g.,0o777).
- org.openrewrite.javascript.migrate.es6.remove-duplicate-object-keys
- Remove duplicate object keys
- Remove duplicate keys in object literals, keeping only the last occurrence (last-wins semantics).
- org.openrewrite.javascript.migrate.typescript.export-assignment-to-export-default
- Convert
export =toexport default - Converts TypeScript
export =syntax to ES moduleexport defaultsyntax for compatibility with ECMAScript modules.
- Convert
- org.openrewrite.jenkins.CommonsLang3ToApiPlugin
- Use commons-lang3 API Plugin
- Updates
pom.xmlto depend oncommons-lang3-apiand excludecommons-lang3where it is brought in transitively.
- org.openrewrite.jenkins.CreateJenkinsfile
- Create Jenkinsfile
- Creates a simple base Jenkinsfile in Groovy for a Declarative Pipeline - located in the root of the project.
- org.openrewrite.jenkins.JavaxAnnotationsToSpotbugs
- Migrate
javax.annotationsto SpotBugs annotations - SpotBugs is the preferred replacement of JSR-305 annotations for Jenkins plugins.
- Migrate
- org.openrewrite.jenkins.ModernizeJenkinsfile
- Modernize Jenkinsfile
- Updates
Jenkinsfileto build with recommended Java versions, platforms, and settings.
- org.openrewrite.jenkins.ModernizePlugin
- Modernize a Jenkins plugin to the latest recommended versions
- This recipe is intended to change over time to reflect the recommended tooling and recommended Jenkins baseline.
- org.openrewrite.jenkins.ModernizePluginForJava8
- Modernize a Jenkins plugin to the latest versions supported by Java 8
- This recipe is intended to break down the modernization of very old plugins into distinct steps. It allows modernizing all tooling up to the last versions that supported Java 8. This can then be followed by another recipe that makes the jump to Java 11.
- org.openrewrite.jenkins.migrate.hudson.UtilGetPastTimeStringToGetTimeSpanString
- Replace
hudson.Util.getPastTimeStringwithgetTimeSpanString hudson.Util.getPastTimeStringhas been deprecated since the 2.204.1 LTS release on 2019-12-18.
- Replace
- org.openrewrite.kubernetes.ImagePullPolicyAlways
- Ensure image pull policy is
Always - Ensures the latest version of a tag is deployed each time.
- Ensure image pull policy is
- org.openrewrite.kubernetes.KubernetesBestPractices
- Kubernetes best practices
- Applies best practices to Kubernetes manifests.
- org.openrewrite.kubernetes.LifecycleRuleOnStorageBucket
- Ensure lifecycle rule on
StorageBucket - When defining a rule, you can specify any set of conditions for any action. The following configuration defines a rule to delete all objects older than 7 days in a bucket.
- Ensure lifecycle rule on
- org.openrewrite.kubernetes.LimitContainerCapabilities
- Limit root capabilities in a container
- Limiting the admission of containers with capabilities ensures that only a small number of containers have extended capabilities outside the default range.
- org.openrewrite.kubernetes.MissingCpuLimits
- Ensure CPU limits are set
- A system without managed quotas could eventually collapse due to inadequate resources for the tasks it bares.
- org.openrewrite.kubernetes.MissingCpuRequest
- Ensure CPU request is set
- If a container is created in a namespace that has a default CPU limit, and the container does not specify its own CPU limit, then the container is assigned the default CPU limit.
- org.openrewrite.kubernetes.MissingMemoryLimits
- Ensure memory limits are set
- With no limit set, kubectl allocates more and more memory to the container until it runs out.
- org.openrewrite.kubernetes.MissingMemoryRequest
- Ensure memory request is set
- A container is guaranteed to have as much memory as it requests, but is not allowed to use more memory than the limit set. This configuration may save resources and prevent an attack on an exploited container.
- org.openrewrite.kubernetes.MissingPodLivenessProbe
- Ensure liveness probe is configured
- The kubelet uses liveness probes to know when to schedule restarts for containers. Restarting a container in a deadlock state can help to make the application more available, despite bugs.
- org.openrewrite.kubernetes.MissingPodReadinessProbe
- Ensure readiness probe is configured
- Using the Readiness Probe ensures teams define what actions need to be taken to prevent failure and ensure recovery in case of unexpected errors.
- org.openrewrite.kubernetes.NoHostIPCSharing
- No host IPC sharing
- Preventing sharing of host PID/IPC namespace, networking, and ports ensures proper isolation between Docker containers and the underlying host.
- org.openrewrite.kubernetes.NoHostNetworkSharing
- No host network sharing
- When using the host network mode for a container, that container’s network stack is not isolated from the Docker host, so the container shares the host’s networking namespace and does not get its own IP-address allocation.
- org.openrewrite.kubernetes.NoHostProcessIdSharing
- No host process ID sharing
- Sharing the host process ID namespace breaks the isolation between container images and can make processes visible to other containers in the pod. This includes all information in the /proc directory, which can sometimes include passwords or keys, passed as environment variables.
- org.openrewrite.kubernetes.NoPrivilegeEscalation
- No privilege escalation
- Does not allow a process to gain more privileges than its parent process.
- org.openrewrite.kubernetes.NoPrivilegedContainers
- No privileged containers
- Privileged containers are containers that have all of the root capabilities of a host machine, allowing access to resources that are not accessible in ordinary containers.
- org.openrewrite.kubernetes.NoRootContainers
- No root containers
- Containers that run as root frequently have more permissions than their workload requires which, in case of compromise, could help an attacker further their exploits.
- org.openrewrite.kubernetes.ReadOnlyRootFilesystem
- Read-only root filesystem
- Using an immutable root filesystem and a verified boot mechanism prevents against attackers from "owning" the machine through permanent local changes.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_16
- Migrate to Kubernetes API v1.16
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.16.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_22
- Migrate to Kubernetes API v1.22
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.22.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_25
- Migrate to Kubernetes API v1.25
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.25.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_26
- Migrate to Kubernetes API v1.26
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.26.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_27
- Migrate to Kubernetes API v1.27
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.27.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_29
- Migrate to Kubernetes API v1.29
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.29.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_32
- Migrate to Kubernetes API v1.32
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.32.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_33
- Migrate to Kubernetes API v1.33
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.33.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_34
- Migrate to Kubernetes API v1.34
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.34.
- org.openrewrite.kubernetes.migrate.MigrateToAPIv1_35
- Migrate to Kubernetes API v1.35
- This recipe will apply changes commonly needed when migrating to Kubernetes API v1.35.
- org.openrewrite.kubernetes.search.FindHarcodedIPAddresses
- Find hardcoded IP addresses
- Find hardcoded IP address anywhere in text-based files.
- org.openrewrite.maven.BestPractices
- Apache Maven best practices
- Applies best practices to Maven POMs.
- org.openrewrite.maven.MigrateToMaven4
- Migrate to Maven 4
- Migrates Maven POMs from Maven 3 to Maven 4, addressing breaking changes and deprecations. This recipe updates property expressions, lifecycle phases, removes duplicate plugin declarations, and replaces removed properties to ensure compatibility with Maven 4.
- org.openrewrite.maven.ReplaceDeprecatedLifecyclePhases
- Replace deprecated lifecycle phases
- Maven 4 deprecated all
pre-*andpost-*lifecycle phases in favor of thebefore:andafter:syntax. This recipe updates plugin phase declarations to use the new syntax, includingpre-clean→before:clean,pre-site→before:site,pre-integration-test→before:integration-test, and theirpost-*equivalents.
- org.openrewrite.maven.ReplaceModulesWithSubprojects
- Replace modules with subprojects
- Maven 4 model version 4.1.0 deprecates the
<modules>element in favor of<subprojects>to eliminate confusion with Java's Platform Module System (JPMS). This recipe renames<modules>to<subprojects>and<module>children to<subproject>.
- org.openrewrite.maven.ReplaceRemovedRootDirectoryProperties
- Replace removed root directory properties
- Maven 4 removed support for deprecated root directory properties. This recipe replaces
${executionRootDirectory}with${session.rootDirectory}and${multiModuleProjectDirectory}with${project.rootDirectory}.
- org.openrewrite.maven.UpgradeToModelVersion410
- Upgrade to Maven model version 4.1.0
- Upgrades Maven POMs from model version 4.0.0 to 4.1.0, enabling new Maven 4 features like
<subprojects>,bompackaging, and automatic version inference. This recipe updates the<modelVersion>element,xmlnsnamespace, andxsi:schemaLocationfrom 4.0.0 to 4.1.0.
- org.openrewrite.maven.cleanup.PrefixlessExpressions
- Drop prefixless expressions in POM
- MNG-7404 drops support for prefixless in POMs. This recipe will add the
project.prefix where missing.
- org.openrewrite.maven.liberty.AddOpenLibertyPlugin
- Add Liberty Maven plugin
- This recipe adds the Liberty Maven plugin, which provides several goals for managing a Liberty server and applications.
- org.openrewrite.micrometer.MicrometerBestPractices
- Micrometer best practices
- This recipe will apply a set of best practice refactorings for Micrometer, like adopting
Observationsinstead ofTimers.
- org.openrewrite.micrometer.UpgradeMicrometer_1_13
- Migrate to Micrometer 1.13
- Migrate applications to the latest Micrometer 1.13 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions as described in the Micrometer 1.13 migration guide.
- org.openrewrite.micrometer.misk.MigrateMiskToMicrometer
- Migrate Misk metrics to Micrometer
- This recipe will move Misk metrics to Micrometer, where that is possible to do without a loss of fidelity.
- org.openrewrite.netty.UpgradeNetty_4_1_to_4_2
- Migrates from Netty 4.1.x to Netty 4.2.x
- Migrate applications to the latest Netty 4.2.x release.
- org.openrewrite.nodejs.search.DatabaseInteractionInsights
- Javascript database interaction library insights
- Discover which popular javascript database interaction libraries (Sequelize, TypeORM, Mongoose, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.FormHandlingInsights
- Javascript form handling library insights
- Discover which popular javascript form handling libraries (Formik, React Hook Form, Yup, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.LintingFormattingInsights
- Javascript linting & formatting library insights
- Discover which popular javascript linting and formatting libraries (ESLint, Prettier, Stylelint, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.RealTimeCommunicationInsights
- Javascript real-time communication library insights
- Discover which popular javascript real-time communication libraries (Socket.io, Ws, SockJS, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.SecurityInsights
- Javascript security library insights
- Discover which popular javascript security libraries (Helmet, Cors, Bcrypt, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.ServerSideFrameworksInsights
- Javascript server-side frameworks insights
- Discover which popular javascript server-side frameworks (Express, Koa, Hapi, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.StateManagementInsights
- Javascript state management library insights
- Discover which popular javascript state management libraries (Redux, MobX, Vuex, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.TaskRunnersBuildToolsInsights
- Javascript task runners & build tools insights
- Discover which popular javascript task runners and build tools (Webpack, Parcel, Gulp, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.TestingInsights
- Javascript testing library insights
- Discover which popular javascript testing libraries (Jest, Mocha, Chai, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.UIInsights
- Javascript UI library insights
- Discover which popular javascript UI libraries (React, Vue.js, Angular, etc.) are being used in your projects.
- org.openrewrite.nodejs.search.UtilityInsights
- Javascript utility library insights
- Discover which popular javascript utility libraries (Lodash, Moment.js, Date-fns, etc.) are being used in your projects.
- org.openrewrite.okhttp.ReorderRequestBodyCreateArguments
- Reorder the arguments of
RequestBody.create() - Reorder the arguments of
RequestBody.create()to put theMediaTypeargument after theStringbody.
- Reorder the arguments of
- org.openrewrite.okhttp.UpgradeMockWebServer3
- Migrate to MockWebServer3 (core module)
- Migrate from the legacy
mockwebserverartifact tomockwebserver3core module without JUnit dependency.
- org.openrewrite.okhttp.UpgradeMockWebServer3JUnit4
- Migrate to MockWebServer3 with JUnit 4
- Migrate from the legacy
mockwebserverartifact tomockwebserver3-junit4with JUnit 4 integration.
- org.openrewrite.okhttp.UpgradeMockWebServer3JUnit5
- Migrate to MockWebServer3 with JUnit 5
- Migrate from the legacy
mockwebserverartifact tomockwebserver3-junit5with JUnit 5 integration.
- org.openrewrite.okhttp.UpgradeOkHttp4
- Migrate to OkHttp 4.x
- This recipe will apply changes commonly needed when migrating to OkHttp 4.x.
- org.openrewrite.okhttp.UpgradeOkHttp4Dependencies
- Migrate OkHttp dependencies to 4.x
- Migrate OkHttp dependencies to 4.x.
- org.openrewrite.okhttp.UpgradeOkHttp5
- Migrate to OkHttp 5.x
- This recipe will apply changes commonly needed when migrating to OkHttp 5.x.
- org.openrewrite.okhttp.UpgradeOkHttp5Dependencies
- Migrate OkHttp dependencies to 5.x
- Migrate OkHttp dependencies to 5.x.
- org.openrewrite.okio.UpgradeOkio3
- Migrate to Okio 3.x
- This recipe will apply changes commonly needed when migrating to Okio 3.x.
- org.openrewrite.okio.UpgradeOkio3Dependencies
- Migrate Okio dependencies to 3.x
- Migrate Okio dependencies to 3.x.
- org.openrewrite.openapi.swagger.MigrateApiImplicitParamsToParameters
- Migrate from
@ApiImplicitParamsto@Parameters - Converts
@ApiImplicitParamsto@Parametersand the@ApiImplicitParamannotation to@Parameterand converts the directly mappable attributes and removes the others.
- Migrate from
- org.openrewrite.openapi.swagger.MigrateApiModelPropertyToSchema
- Migrate from
@ApiModelPropertyto@Schema - Converts the
@ApiModelPropertyannotation to@Schemaand converts the "value" attribute to "description".
- Migrate from
- org.openrewrite.openapi.swagger.MigrateApiOperationToOperation
- Migrate from
@ApiOperationto@Operation - Converts the
@ApiOperationannotation to@Operationand converts the directly mappable attributes and removes the others.
- Migrate from
- org.openrewrite.openapi.swagger.MigrateApiParamToParameter
- Migrate from
@ApiParamto@Parameter - Converts the
@ApiParamannotation to@Parameterand converts the directly mappable attributes.
- Migrate from
- org.openrewrite.openapi.swagger.MigrateApiResponsesToApiResponses
- Migrate from
@ApiResponsesto@ApiResponses - Changes the namespace of the
@ApiResponsesand@ApiResponseannotations and converts its attributes (ex. code -> responseCode, message -> description, response -> content).
- Migrate from
- org.openrewrite.openapi.swagger.SwaggerToOpenAPI
- Migrate from Swagger to OpenAPI
- Migrate from Swagger to OpenAPI.
- org.openrewrite.openapi.swagger.UseJakartaSwaggerArtifacts
- Use Jakarta Swagger Artifacts
- Migrate from javax Swagger artifacts to Jakarta versions.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_0_0
- Quarkus Updates Aggregate 3.0.0
- Quarkus update recipes to upgrade your application to 3.0.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_10_0
- Quarkus Updates Aggregate 3.10.0
- Quarkus update recipes to upgrade your application to 3.10.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_11_0
- Quarkus Updates Aggregate 3.11.0
- Quarkus update recipes to upgrade your application to 3.11.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_12_0
- Quarkus Updates Aggregate 3.12.0
- Quarkus update recipes to upgrade your application to 3.12.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_13_0
- Quarkus Updates Aggregate 3.13.0
- Quarkus update recipes to upgrade your application to 3.13.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_15_0
- Quarkus Updates Aggregate 3.15.0
- Quarkus update recipes to upgrade your application to 3.15.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_17_0
- Quarkus Updates Aggregate 3.17.0
- Quarkus update recipes to upgrade your application to 3.17.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_18_0
- Quarkus Updates Aggregate 3.18.0
- Quarkus update recipes to upgrade your application to 3.18.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_19_0
- Quarkus Updates Aggregate 3.19.0
- Quarkus update recipes to upgrade your application to 3.19.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_1_0
- Quarkus Updates Aggregate 3.1.0
- Quarkus update recipes to upgrade your application to 3.1.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_20_1
- Quarkus Updates Aggregate 3.20.1
- Quarkus update recipes to upgrade your application to 3.20.1.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_21_0
- Quarkus Updates Aggregate 3.21.0
- Quarkus update recipes to upgrade your application to 3.21.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_22_0
- Quarkus Updates Aggregate 3.22.0
- Quarkus update recipes to upgrade your application to 3.22.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_23_0
- Quarkus Updates Aggregate 3.23.0
- Quarkus update recipes to upgrade your application to 3.23.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_24_0
- Quarkus Updates Aggregate 3.24.0
- Quarkus update recipes to upgrade your application to 3.24.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_25_0
- Quarkus Updates Aggregate 3.25.0
- Quarkus update recipes to upgrade your application to 3.25.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_26_0
- Quarkus Updates Aggregate 3.26.0
- Quarkus update recipes to upgrade your application to 3.26.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_2_0
- Quarkus Updates Aggregate 3.2.0
- Quarkus update recipes to upgrade your application to 3.2.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_3_0
- Quarkus Updates Aggregate 3.3.0
- Quarkus update recipes to upgrade your application to 3.3.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_5_0
- Quarkus Updates Aggregate 3.5.0
- Quarkus update recipes to upgrade your application to 3.5.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_6_0
- Quarkus Updates Aggregate 3.6.0
- Quarkus update recipes to upgrade your application to 3.6.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_7_0
- Quarkus Updates Aggregate 3.7.0
- Quarkus update recipes to upgrade your application to 3.7.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_8_0
- Quarkus Updates Aggregate 3.8.0
- Quarkus update recipes to upgrade your application to 3.8.0.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_8_3
- Quarkus Updates Aggregate 3.8.3
- Quarkus update recipes to upgrade your application to 3.8.3.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_9_0
- Quarkus Updates Aggregate 3.9.0
- Quarkus update recipes to upgrade your application to 3.9.0.
- org.openrewrite.quarkus.Quarkus1to1_13Migration
- Quarkus 1.13 migration from Quarkus 1.11
- Migrates Quarkus 1.11 to 1.13.
- org.openrewrite.quarkus.migrate.javaee.AddQuarkus2Dependencies
- Add Quarkus 2 dependencies
- Add Quarkus 2 dependencies to the project.
- org.openrewrite.quarkus.migrate.javaee.AddQuarkus2MavenPlugins
- Migrate JavaEE Maven Dependencies to Quarkus 2
- Upgrade Standard JavaEE dependencies to Quarkus 2 dependencies.
- org.openrewrite.quarkus.migrate.javaee.JavaEEtoQuarkus2CodeMigration
- Migrate JavaEE Code to Quarkus 2
- Migrate Standard JavaEE Code to Quarkus 2.
- org.openrewrite.quarkus.migrate.javaee.JavaEEtoQuarkus2Migration
- Migrate JavaEE to Quarkus 2
- These recipes help with the migration of a JavaEE application using EJBs and Hibernate to Quarkus 2. Additional transformations like JSF, JMS, Quarkus Tests may be necessary.
- org.openrewrite.quarkus.migrate.javaee.RemoveJavaEEDependencies
- Remove JavaEE dependencies
- Remove JavaEE dependencies from the project.
- org.openrewrite.quarkus.quarkus2.Quarkus1to2Migration
- Quarkus 2.x migration from Quarkus 1.x
- Migrates Quarkus 1.x to 2.x.
- org.openrewrite.quarkus.spring.AddSpringCompatibilityExtensions
- Add Spring compatibility extensions for commonly used annotations
- Adds Quarkus Spring compatibility extensions when Spring annotations are detected in the codebase.
- org.openrewrite.quarkus.spring.DerbyDriverToQuarkus
- Replace Derby driver with Quarkus JDBC Derby
- Migrates
org.apache.derby:derbyorderbyclienttoio.quarkus:quarkus-jdbc-derby(excludes test scope).
- org.openrewrite.quarkus.spring.DerbyTestDriverToQuarkus
- Replace Derby test driver with Quarkus JDBC Derby (test scope)
- Migrates
org.apache.derby:derbywith test scope toio.quarkus:quarkus-jdbc-derbywith test scope.
- org.openrewrite.quarkus.spring.EnableAnnotationsToQuarkusDependencies
- Migrate
@EnableXyzannotations to Quarkus extensions - Removes Spring
@EnableXyzannotations and adds the corresponding Quarkus extensions as dependencies.
- Migrate
- org.openrewrite.quarkus.spring.H2DriverToQuarkus
- Replace H2 driver with Quarkus JDBC H2
- Migrates
com.h2database:h2toio.quarkus:quarkus-jdbc-h2(excludes test scope).
- org.openrewrite.quarkus.spring.H2TestDriverToQuarkus
- Replace H2 test driver with Quarkus JDBC H2 (test scope)
- Migrates
com.h2database:h2with test scope toio.quarkus:quarkus-jdbc-h2with test scope.
- org.openrewrite.quarkus.spring.MigrateBootStarters
- Replace Spring Boot starter dependencies with Quarkus equivalents
- Migrates Spring Boot starter dependencies to their Quarkus equivalents, removing version tags as Quarkus manages versions through its BOM.
- org.openrewrite.quarkus.spring.MigrateDatabaseDrivers
- Migrate database drivers to Quarkus JDBC extensions
- Replaces Spring Boot database driver dependencies with their Quarkus JDBC extension equivalents.
- org.openrewrite.quarkus.spring.MigrateMavenPlugin
- Add or replace Spring Boot build plugin with Quarkus build plugin
- Remove Spring Boot Maven plugin if present and add Quarkus Maven plugin using the same version as the quarkus-bom.
- org.openrewrite.quarkus.spring.ReplaceSpringBootApplication
- Replace
@SpringBootApplicationwith Quarkus equivalent - Replace
@SpringBootApplicationannotation with@QuarkusMain,SpringApplication.run()calls.
- Replace
- org.openrewrite.quarkus.spring.SpringBootActiveMQToQuarkus
- Replace Spring Boot ActiveMQ with Quarkus Artemis JMS
- Migrates
spring-boot-starter-activemqtoquarkus-artemis-jms.
- org.openrewrite.quarkus.spring.SpringBootActuatorToQuarkus
- Replace Spring Boot Actuator with Quarkus SmallRye Health
- Migrates
spring-boot-starter-actuatortoquarkus-smallrye-health.
- org.openrewrite.quarkus.spring.SpringBootAmqpToQuarkusClassic
- Replace Spring Boot AMQP with Quarkus Messaging RabbitMQ
- Migrates
spring-boot-starter-amqptoquarkus-messaging-rabbitmqwhen no reactor dependencies are present.
- org.openrewrite.quarkus.spring.SpringBootAmqpToQuarkusReactive
- Replace Spring Boot AMQP with Quarkus Messaging AMQP
- Migrates
spring-boot-starter-amqptoquarkus-messaging-amqpwhen reactor dependencies are present.
- org.openrewrite.quarkus.spring.SpringBootArtemisToQuarkus
- Replace Spring Boot Artemis with Quarkus Artemis JMS
- Migrates
spring-boot-starter-artemistoquarkus-artemis-jms.
- org.openrewrite.quarkus.spring.SpringBootBatchToQuarkus
- Replace Spring Boot Batch with Quarkus Scheduler
- Migrates
spring-boot-starter-batchtoquarkus-scheduler.
- org.openrewrite.quarkus.spring.SpringBootCacheToQuarkus
- Replace Spring Boot Cache with Quarkus Cache
- Migrates
spring-boot-starter-cachetoquarkus-cache.
- org.openrewrite.quarkus.spring.SpringBootDataJpaToQuarkus
- Replace Spring Boot Data JPA with Quarkus Hibernate ORM Panache
- Migrates
spring-boot-starter-data-jpatoquarkus-hibernate-orm-panache.
- org.openrewrite.quarkus.spring.SpringBootDataMongoToQuarkus
- Replace Spring Boot Data MongoDB with Quarkus MongoDB Panache
- Migrates
spring-boot-starter-data-mongodbtoquarkus-mongodb-panache.
- org.openrewrite.quarkus.spring.SpringBootDataRedisToQuarkus
- Replace Spring Boot Data Redis with Quarkus Redis Client
- Migrates
spring-boot-starter-data-redistoquarkus-redis-client.
- org.openrewrite.quarkus.spring.SpringBootDataRestToQuarkus
- Replace Spring Boot Data REST with Quarkus REST
- Migrates
spring-boot-starter-data-resttoquarkus-rest-jackson.
- org.openrewrite.quarkus.spring.SpringBootElasticsearchToQuarkus
- Replace Spring Boot Elasticsearch with Quarkus Elasticsearch REST Client
- Migrates
spring-boot-starter-data-elasticsearchtoquarkus-elasticsearch-rest-client.
- org.openrewrite.quarkus.spring.SpringBootIntegrationToQuarkus
- Replace Spring Boot Integration with Camel Quarkus
- Migrates
spring-boot-starter-integrationtocamel-quarkus-core.
- org.openrewrite.quarkus.spring.SpringBootJdbcToQuarkus
- Replace Spring Boot JDBC with Quarkus Agroal
- Migrates
spring-boot-starter-jdbctoquarkus-agroal.
- org.openrewrite.quarkus.spring.SpringBootMailToQuarkus
- Replace Spring Boot Mail with Quarkus Mailer
- Migrates
spring-boot-starter-mailtoquarkus-mailer.
- org.openrewrite.quarkus.spring.SpringBootOAuth2ClientToQuarkus
- Replace Spring Boot OAuth2 Client with Quarkus OIDC Client
- Migrates spring-boot-starter-oauth2-client
toquarkus-oidc-client`.
- org.openrewrite.quarkus.spring.SpringBootOAuth2ResourceServerToQuarkus
- Replace Spring Boot OAuth2 Resource Server with Quarkus OIDC
- Migrates
spring-boot-starter-oauth2-resource-servertoquarkus-oidc.
- org.openrewrite.quarkus.spring.SpringBootQuartzToQuarkus
- Replace Spring Boot Quartz with Quarkus Quartz
- Migrates
spring-boot-starter-quartztoquarkus-quartz.
- org.openrewrite.quarkus.spring.SpringBootSecurityToQuarkus
- Replace Spring Boot Security with Quarkus Security
- Migrates
spring-boot-starter-securitytoquarkus-security.
- org.openrewrite.quarkus.spring.SpringBootTestToQuarkus
- Replace Spring Boot Test with Quarkus JUnit 5
- Migrates
spring-boot-starter-testtoquarkus-junit5.
- org.openrewrite.quarkus.spring.SpringBootThymeleafToQuarkus
- Replace Spring Boot Thymeleaf with Quarkus Qute
- Migrates
spring-boot-starter-thymeleaftoquarkus-qute.
- org.openrewrite.quarkus.spring.SpringBootToQuarkus
- Migrate Spring Boot to Quarkus
- Replace Spring Boot with Quarkus.
- org.openrewrite.quarkus.spring.SpringBootValidationToQuarkus
- Replace Spring Boot Validation with Quarkus Hibernate Validator
- Migrates
spring-boot-starter-validationtoquarkus-hibernate-validator.
- org.openrewrite.quarkus.spring.SpringBootWebFluxToQuarkusReactive
- Replace Spring Boot WebFlux with Quarkus REST Client
- Migrates
spring-boot-starter-webfluxtoquarkus-rest-client-jacksonwhen reactor dependencies are present.
- org.openrewrite.quarkus.spring.SpringBootWebSocketToQuarkus
- Replace Spring Boot WebSocket with Quarkus WebSockets
- Migrates
spring-boot-starter-websockettoquarkus-websockets.
- org.openrewrite.quarkus.spring.SpringBootWebToQuarkusClassic
- Replace Spring Boot Web with Quarkus RESTEasy Classic
- Migrates
spring-boot-starter-webtoquarkus-resteasy-jacksonwhen no reactor dependencies are present.
- org.openrewrite.quarkus.spring.SpringBootWebToQuarkusReactive
- Replace Spring Boot Web with Quarkus REST
- Migrates
spring-boot-starter-webtoquarkus-rest-jacksonwhen reactor dependencies are present.
- org.openrewrite.quarkus.spring.SpringKafkaToQuarkusClassic
- Replace Spring Kafka with Quarkus Kafka Client
- Migrates
spring-kafkatoquarkus-kafka-clientwhen no reactor dependencies are present.
- org.openrewrite.quarkus.spring.SpringKafkaToQuarkusReactive
- Replace Spring Kafka with Quarkus Messaging Kafka
- Migrates
spring-kafkatoquarkus-messaging-kafkawhen reactor dependencies are present.
- org.openrewrite.quarkus.spring.StereotypeAnnotationsToCDI
- Migrate Spring annotations to CDI
- Replace Spring stereotype and injection annotations with CDI equivalents.
- org.openrewrite.reactive.reactor.ReactorBestPractices
- Reactor Best Practices
- This recipe applies best practices for using Reactor.
- org.openrewrite.reactive.reactor.UpgradeReactor_3_5
- Migrate to Reactor 3.5
- Adopt to breaking changes in Reactor 3.5.
- org.openrewrite.recipes.rewrite.InlineMethods
- Inline methods annotated with
@InlineMe - Automatically generated recipes to inline method calls based on
@InlineMeannotations discovered in the type table.
- Inline methods annotated with
- org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPractices
- OpenRewrite recipe best practices
- Best practices for OpenRewrite recipe development.
- org.openrewrite.scala.migrate.UpgradeScala_2_12
- Migrate to Scala 2.12.+
- Upgrade the Scala version for compatibility with newer Java versions.
- org.openrewrite.sql.ConvertOracleDataTypesToPostgres
- Convert Oracle data types to PostgreSQL
- Replaces Oracle-specific data types with PostgreSQL equivalents.
- org.openrewrite.sql.ConvertOracleFunctionsToPostgres
- Convert Oracle functions to PostgreSQL
- Replaces Oracle-specific functions with PostgreSQL equivalents.
- org.openrewrite.sql.ConvertSqlServerDataTypesToPostgres
- Convert SQL Server data types to PostgreSQL
- Replaces SQL Server-specific data types with PostgreSQL equivalents.
- org.openrewrite.sql.ConvertSqlServerFunctionsToPostgres
- Convert SQL Server functions to PostgreSQL
- Replaces SQL Server-specific functions with PostgreSQL equivalents.
- org.openrewrite.sql.MigrateOracleToPostgres
- Migrate Oracle SQL to PostgreSQL
- Converts Oracle-specific SQL syntax and functions to PostgreSQL equivalents.
- org.openrewrite.sql.MigrateSqlServerToPostgres
- Migrate SQL Server to PostgreSQL
- Converts Microsoft SQL Server-specific SQL syntax and functions to PostgreSQL equivalents.
- org.openrewrite.staticanalysis.CodeCleanup
- Code cleanup
- Automatically cleanup code, e.g. remove unnecessary parentheses, simplify expressions.
- 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 beFunction<? super IN, ? extends OUT>. This recipe checks for method parameters of well-known types.
- org.openrewrite.staticanalysis.CommonStaticAnalysis
- Common static analysis issues
- Resolve common static analysis issues (also known as SAST issues).
- org.openrewrite.staticanalysis.JavaApiBestPractices
- Java API best practices
- Use the Java standard library in a way that is most idiomatic.
- org.openrewrite.staticanalysis.ReplaceApacheCommonsLang3ValidateNotNullWithObjectsRequireNonNull
- Replace
org.apache.commons.lang3.Validate#notNullwithObjects#requireNonNull - Replace
org.apache.commons.lang3.Validate.notNull(..)withObjects.requireNonNull(..).
- Replace
- org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
- Replace calls to
Thread.run()withThread.start() Thread.run()should not be called directly.
- Replace calls to
- org.openrewrite.staticanalysis.ReplaceValidateNotNullHavingSingleArgWithObjectsRequireNonNull
- Replace
org.apache.commons.lang3.Validate#notNullwithObjects#requireNonNull - Replace
org.apache.commons.lang3.Validate.notNull(Object)withObjects.requireNonNull(Object).
- Replace
- org.openrewrite.staticanalysis.UseMapContainsKey
- Use
Map#containsKey map.keySet().contains(a)can be simplified tomap.containsKey(a).
- Use
- org.openrewrite.terraform.aws.AWSBestPractices
- Best practices for AWS
- Securely operate on Amazon Web Services.
- org.openrewrite.terraform.aws.DisableInstanceMetadataServiceV1
- Disable Instance Metadata Service version 1
- As a request/response method IMDSv1 is prone to local misconfigurations.
- org.openrewrite.terraform.aws.EnableApiGatewayCaching
- Enable API gateway caching
- Enable caching for all methods of API Gateway.
- org.openrewrite.terraform.aws.EnableDynamoDbPITR
- Enable point-in-time recovery for DynamoDB
- DynamoDB Point-In-Time Recovery (PITR) is an automatic backup service for DynamoDB table data that helps protect your DynamoDB tables from accidental write or delete operations.
- org.openrewrite.terraform.aws.EnableECRScanOnPush
- Scan images pushed to ECR
- ECR Image Scanning assesses and identifies operating system vulnerabilities. Using automated image scans you can ensure container image vulnerabilities are found before getting pushed to production.
- org.openrewrite.terraform.aws.EncryptAuroraClusters
- Encrypt Aurora clusters
- Native Aurora encryption helps protect your cloud applications and fulfils compliance requirements for data-at-rest encryption.
- org.openrewrite.terraform.aws.EncryptCodeBuild
- Encrypt CodeBuild projects
- Build artifacts, such as a cache, logs, exported raw test report data files, and build results, are encrypted by default using CMKs for Amazon S3 that are managed by the AWS Key Management Service.
- org.openrewrite.terraform.aws.EncryptDAXStorage
- Encrypt DAX storage at rest
- DAX encryption at rest automatically integrates with AWS KMS for managing the single service default key used to encrypt clusters.
- org.openrewrite.terraform.aws.EncryptDocumentDB
- Encrypt DocumentDB storage
- The encryption feature available for Amazon DocumentDB clusters provides an additional layer of data protection by helping secure your data against unauthorized access to the underlying storage.
- org.openrewrite.terraform.aws.EncryptEBSSnapshots
- Encrypt EBS snapshots
- EBS snapshots should be encrypted, as they often include sensitive information, customer PII or CPNI.
- org.openrewrite.terraform.aws.EncryptEBSVolumeLaunchConfiguration
- Encrypt EBS volume launch configurations
- EBS volumes allow you to create encrypted launch configurations when creating EC2 instances and auto scaling. When the entire EBS volume is encrypted, data stored at rest on the volume, disk I/O, snapshots created from the volume, and data in-transit between EBS and EC2 are all encrypted.
- org.openrewrite.terraform.aws.EncryptEBSVolumes
- Encrypt EBS volumes
- Encrypting EBS volumes ensures that replicated copies of your images are secure even if they are accidentally exposed. AWS EBS encryption uses AWS KMS customer master keys (CMK) when creating encrypted volumes and snapshots. Storing EBS volumes in their encrypted state reduces the risk of data exposure or data loss.
- org.openrewrite.terraform.aws.EncryptEFSVolumesInECSTaskDefinitionsInTransit
- Encrypt EFS Volumes in ECS Task Definitions in transit
- Enable attached EFS definitions in ECS tasks to use encryption in transit.
- org.openrewrite.terraform.aws.EncryptElastiCacheRedisAtRest
- Encrypt ElastiCache Redis at rest
- ElastiCache for Redis offers default encryption at rest as a service.
- org.openrewrite.terraform.aws.EncryptElastiCacheRedisInTransit
- Encrypt ElastiCache Redis in transit
- ElastiCache for Redis offers optional encryption in transit. In-transit encryption provides an additional layer of data protection when transferring data over standard HTTPS protocol.
- org.openrewrite.terraform.aws.EncryptNeptuneStorage
- Encrypt Neptune storage
- Encryption of Neptune storage protects data and metadata against unauthorized access.
- org.openrewrite.terraform.aws.EncryptRDSClusters
- Encrypt RDS clusters
- Native RDS encryption helps protect your cloud applications and fulfils compliance requirements for data-at-rest encryption.
- org.openrewrite.terraform.aws.EncryptRedshift
- Encrypt Redshift storage at rest
- Redshift clusters should be securely encrypted at rest.
- org.openrewrite.terraform.aws.EnsureAWSCMKRotationIsEnabled
- Ensure AWS CMK rotation is enabled
- Ensure AWS CMK rotation is enabled.
- org.openrewrite.terraform.aws.EnsureAWSEFSWithEncryptionForDataAtRestIsEnabled
- Ensure AWS EFS with encryption for data at rest is enabled
- Ensure AWS EFS with encryption for data at rest is enabled.
- org.openrewrite.terraform.aws.EnsureAWSEKSClusterEndpointAccessIsPubliclyDisabled
- Ensure AWS EKS cluster endpoint access is publicly disabled
- Ensure AWS EKS cluster endpoint access is publicly disabled.
- org.openrewrite.terraform.aws.EnsureAWSElasticsearchDomainEncryptionForDataAtRestIsEnabled
- Ensure AWS Elasticsearch domain encryption for data at rest is enabled
- Ensure AWS Elasticsearch domain encryption for data at rest is enabled.
- org.openrewrite.terraform.aws.EnsureAWSElasticsearchDomainsHaveEnforceHTTPSEnabled
- Ensure AWS Elasticsearch domains have
EnforceHTTPSenabled - Ensure AWS Elasticsearch domains have
EnforceHTTPSenabled.
- Ensure AWS Elasticsearch domains have
- org.openrewrite.terraform.aws.EnsureAWSElasticsearchHasNodeToNodeEncryptionEnabled
- Ensure AWS Elasticsearch has node-to-node encryption enabled
- Ensure AWS Elasticsearch has node-to-node encryption enabled.
- org.openrewrite.terraform.aws.EnsureAWSIAMPasswordPolicyHasAMinimumOf14Characters
- Ensure AWS IAM password policy has a minimum of 14 characters
- Ensure AWS IAM password policy has a minimum of 14 characters.
- org.openrewrite.terraform.aws.EnsureAWSLambdaFunctionIsConfiguredForFunctionLevelConcurrentExecutionLimit
- Ensure AWS Lambda function is configured for function-level concurrent execution limit
- Ensure AWS Lambda function is configured for function-level concurrent execution limit.
- org.openrewrite.terraform.aws.EnsureAWSLambdaFunctionsHaveTracingEnabled
- Ensure AWS Lambda functions have tracing enabled
- Ensure AWS Lambda functions have tracing enabled.
- org.openrewrite.terraform.aws.EnsureAWSRDSDatabaseInstanceIsNotPubliclyAccessible
- Ensure AWS RDS database instance is not publicly accessible
- Ensure AWS RDS database instance is not publicly accessible.
- org.openrewrite.terraform.aws.EnsureAWSS3ObjectVersioningIsEnabled
- Ensure AWS S3 object versioning is enabled
- Ensure AWS S3 object versioning is enabled.
- org.openrewrite.terraform.aws.EnsureAmazonEKSControlPlaneLoggingEnabledForAllLogTypes
- Ensure Amazon EKS control plane logging enabled for all log types
- Ensure Amazon EKS control plane logging enabled for all log types.
- org.openrewrite.terraform.aws.EnsureCloudTrailLogFileValidationIsEnabled
- Ensure CloudTrail log file validation is enabled
- Ensure CloudTrail log file validation is enabled.
- org.openrewrite.terraform.aws.EnsureDataStoredInAnS3BucketIsSecurelyEncryptedAtRest
- Ensure data stored in an S3 bucket is securely encrypted at rest
- Ensure data stored in an S3 bucket is securely encrypted at rest.
- org.openrewrite.terraform.aws.EnsureDetailedMonitoringForEC2InstancesIsEnabled
- Ensure detailed monitoring for EC2 instances is enabled
- Ensure detailed monitoring for EC2 instances is enabled.
- org.openrewrite.terraform.aws.EnsureEC2IsEBSOptimized
- Ensure EC2 is EBS optimized
- Ensure EC2 is EBS optimized.
- org.openrewrite.terraform.aws.EnsureECRRepositoriesAreEncrypted
- Ensure ECR repositories are encrypted
- Ensure ECR repositories are encrypted.
- org.openrewrite.terraform.aws.EnsureEnhancedMonitoringForAmazonRDSInstancesIsEnabled
- Ensure enhanced monitoring for Amazon RDS instances is enabled
- Ensure enhanced monitoring for Amazon RDS instances is enabled.
- org.openrewrite.terraform.aws.EnsureIAMPasswordPolicyExpiresPasswordsWithin90DaysOrLess
- Ensure IAM password policy expires passwords within 90 days or less
- Ensure IAM password policy expires passwords within 90 days or less.
- org.openrewrite.terraform.aws.EnsureIAMPasswordPolicyPreventsPasswordReuse
- Ensure IAM password policy prevents password reuse
- Ensure IAM password policy prevents password reuse.
- org.openrewrite.terraform.aws.EnsureIAMPasswordPolicyRequiresAtLeastOneLowercaseLetter
- Ensure IAM password policy requires at least one lowercase letter
- Ensure IAM password policy requires at least one lowercase letter.
- org.openrewrite.terraform.aws.EnsureIAMPasswordPolicyRequiresAtLeastOneNumber
- Ensure IAM password policy requires at least one number
- Ensure IAM password policy requires at least one number.
- org.openrewrite.terraform.aws.EnsureIAMPasswordPolicyRequiresAtLeastOneSymbol
- Ensure IAM password policy requires at least one symbol
- Ensure IAM password policy requires at least one symbol.
- org.openrewrite.terraform.aws.EnsureIAMPasswordPolicyRequiresAtLeastOneUppercaseLetter
- Ensure IAM password policy requires at least one uppercase letter
- Ensure IAM password policy requires at least one uppercase letter.
- org.openrewrite.terraform.aws.EnsureKinesisStreamIsSecurelyEncrypted
- Ensure Kinesis Stream is securely encrypted
- Ensure Kinesis Stream is securely encrypted.
- org.openrewrite.terraform.aws.EnsureRDSDatabaseHasIAMAuthenticationEnabled
- Ensure RDS database has IAM authentication enabled
- Ensure RDS database has IAM authentication enabled.
- org.openrewrite.terraform.aws.EnsureRDSInstancesHaveMultiAZEnabled
- Ensure RDS instances have Multi-AZ enabled
- Ensure RDS instances have Multi-AZ enabled.
- org.openrewrite.terraform.aws.EnsureRespectiveLogsOfAmazonRDSAreEnabled
- Ensure respective logs of Amazon RDS are enabled
- Ensure respective logs of Amazon RDS are enabled.
- org.openrewrite.terraform.aws.EnsureTheS3BucketHasAccessLoggingEnabled
- Ensure the S3 bucket has access logging enabled
- Ensure the S3 bucket has access logging enabled.
- org.openrewrite.terraform.aws.EnsureVPCSubnetsDoNotAssignPublicIPByDefault
- Ensure VPC subnets do not assign public IP by default
- Ensure VPC subnets do not assign public IP by default.
- org.openrewrite.terraform.aws.ImmutableECRTags
- Make ECR tags immutable
- Amazon ECR supports immutable tags, preventing image tags from being overwritten. In the past, ECR tags could have been overwritten, this could be overcome by requiring users to uniquely identify an image using a naming convention.
- org.openrewrite.terraform.aws.UseHttpsForCloudfrontDistribution
- Use HTTPS for Cloudfront distribution
- Secure communication by default.
- org.openrewrite.terraform.azure.AzureBestPractices
- Best practices for Azure
- Securely operate on Microsoft Azure.
- org.openrewrite.terraform.azure.DisableKubernetesDashboard
- Disable Kubernetes dashboard
- Disabling the dashboard eliminates it as an attack vector. The dashboard add-on is disabled by default for all new clusters created on Kubernetes 1.18 or greater.
- org.openrewrite.terraform.azure.EnableAzureStorageAccountTrustedMicrosoftServicesAccess
- Enable Azure Storage Account Trusted Microsoft Services access
- Certain Microsoft services that interact with storage accounts operate from networks that cannot be granted access through network rules. Using this configuration, you can allow the set of trusted Microsoft services to bypass those network rules.
- org.openrewrite.terraform.azure.EnableAzureStorageSecureTransferRequired
- Enable Azure Storage secure transfer required
- Microsoft recommends requiring secure transfer for all storage accounts.
- org.openrewrite.terraform.azure.EnableGeoRedundantBackupsOnPostgreSQLServer
- Enable geo-redundant backups on PostgreSQL server
- Ensure PostgreSQL server enables geo-redundant backups.
- org.openrewrite.terraform.azure.EncryptAzureVMDataDiskWithADECMK
- Encrypt Azure VM data disk with ADE/CMK
- Ensure Azure VM data disk is encrypted with ADE/CMK.
- org.openrewrite.terraform.azure.EnsureAKSPoliciesAddOn
- Ensure AKS policies add-on
- Azure Policy Add-on for Kubernetes service (AKS) extends Gatekeeper v3, an admission controller webhook for Open Policy Agent (OPA), to apply at-scale enforcements and safeguards on your clusters in a centralized, consistent manner.
- org.openrewrite.terraform.azure.EnsureAKVSecretsHaveAnExpirationDateSet
- Ensure AKV secrets have an expiration date set
- Ensure AKV secrets have an expiration date set.
- org.openrewrite.terraform.azure.EnsureASecurityContactPhoneNumberIsPresent
- Ensure a security contact phone number is present
- Ensure a security contact phone number is present.
- org.openrewrite.terraform.azure.EnsureActivityLogRetentionIsSetTo365DaysOrGreater
- Ensure activity log retention is set to 365 days or greater
- Ensure activity log retention is set to 365 days or greater.
- org.openrewrite.terraform.azure.EnsureAllKeysHaveAnExpirationDate
- Ensure all keys have an expiration date
- Ensure all keys have an expiration date.
- org.openrewrite.terraform.azure.EnsureAppServiceEnablesDetailedErrorMessages
- Ensure app service enables detailed error messages
- Ensure app service enables detailed error messages.
- org.openrewrite.terraform.azure.EnsureAppServiceEnablesFailedRequestTracing
- Ensure app service enables failed request tracing
- Ensure app service enables failed request tracing.
- org.openrewrite.terraform.azure.EnsureAppServiceEnablesHTTPLogging
- Ensure app service enables HTTP logging
- Ensure app service enables HTTP logging.
- org.openrewrite.terraform.azure.EnsureAppServicesUseAzureFiles
- Ensure app services use Azure files
- Ensure app services use Azure files.
- org.openrewrite.terraform.azure.EnsureAzureAppServiceWebAppRedirectsHTTPToHTTPS
- Ensure Azure App Service Web app redirects HTTP to HTTPS
- Ensure Azure App Service Web app redirects HTTP to HTTPS.
- org.openrewrite.terraform.azure.EnsureAzureApplicationGatewayHasWAFEnabled
- Ensure Azure application gateway has WAF enabled
- Ensure Azure application gateway has WAF enabled.
- org.openrewrite.terraform.azure.EnsureAzureKeyVaultIsRecoverable
- Ensure Azure key vault is recoverable
- Ensure Azure key vault is recoverable.
- org.openrewrite.terraform.azure.EnsureAzureNetworkWatcherNSGFlowLogsRetentionIsGreaterThan90Days
- Ensure Azure Network Watcher NSG flow logs retention is greater than 90 days
- Ensure Azure Network Watcher NSG flow logs retention is greater than 90 days.
- org.openrewrite.terraform.azure.EnsureAzurePostgreSQLDatabaseServerWithSSLConnectionIsEnabled
- Ensure Azure PostgreSQL database server with SSL connection is enabled
- Ensure Azure PostgreSQL database server with SSL connection is enabled.
- org.openrewrite.terraform.azure.EnsureAzureSQLServerAuditLogRetentionIsGreaterThan90Days
- Ensure Azure SQL server audit log retention is greater than 90 days
- Ensure Azure SQL server audit log retention is greater than 90 days.
- org.openrewrite.terraform.azure.EnsureAzureSQLServerSendAlertsToFieldValueIsSet
- Ensure Azure SQL server send alerts to field value is set
- Ensure Azure SQL server send alerts to field value is set.
- org.openrewrite.terraform.azure.EnsureAzureSQLServerThreatDetectionAlertsAreEnabledForAllThreatTypes
- Ensure Azure SQL Server threat detection alerts are enabled for all threat types
- Ensure Azure SQL Server threat detection alerts are enabled for all threat types.
- org.openrewrite.terraform.azure.EnsureFTPDeploymentsAreDisabled
- Ensure FTP Deployments are disabled
- Ensure FTP Deployments are disabled.
- org.openrewrite.terraform.azure.EnsureKeyVaultAllowsFirewallRulesSettings
- Ensure key vault allows firewall rules settings
- Ensure key vault allows firewall rules settings.
- org.openrewrite.terraform.azure.EnsureKeyVaultEnablesPurgeProtection
- Ensure key vault enables purge protection
- Ensure key vault enables purge protection.
- org.openrewrite.terraform.azure.EnsureKeyVaultKeyIsBackedByHSM
- Ensure key vault key is backed by HSM
- Ensure key vault key is backed by HSM.
- org.openrewrite.terraform.azure.EnsureKeyVaultSecretsHaveContentTypeSet
- Ensure key vault secrets have
content_typeset - Ensure key vault secrets have
content_typeset.
- Ensure key vault secrets have
- org.openrewrite.terraform.azure.EnsureLogProfileIsConfiguredToCaptureAllActivities
- Ensure log profile is configured to capture all activities
- Ensure log profile is configured to capture all activities.
- org.openrewrite.terraform.azure.EnsureMSSQLServersHaveEmailServiceAndCoAdministratorsEnabled
- Ensure MSSQL servers have email service and co-administrators enabled
- Ensure MSSQL servers have email service and co-administrators enabled.
- org.openrewrite.terraform.azure.EnsureManagedIdentityProviderIsEnabledForAppServices
- Ensure managed identity provider is enabled for app services
- Ensure managed identity provider is enabled for app services.
- org.openrewrite.terraform.azure.EnsureMySQLIsUsingTheLatestVersionOfTLSEncryption
- Ensure MySQL is using the latest version of TLS encryption
- Ensure MySQL is using the latest version of TLS encryption.
- org.openrewrite.terraform.azure.EnsureMySQLServerDatabasesHaveEnforceSSLConnectionEnabled
- Ensure MySQL server databases have Enforce SSL connection enabled
- Ensure MySQL server databases have Enforce SSL connection enabled.
- org.openrewrite.terraform.azure.EnsureMySQLServerDisablesPublicNetworkAccess
- Ensure MySQL server disables public network access
- Ensure MySQL server disables public network access.
- org.openrewrite.terraform.azure.EnsureMySQLServerEnablesGeoRedundantBackups
- Ensure MySQL server enables geo-redundant backups
- Ensure MySQL server enables geo-redundant backups.
- org.openrewrite.terraform.azure.EnsureMySQLServerEnablesThreatDetectionPolicy
- Ensure MySQL server enables Threat Detection policy
- Ensure MySQL server enables Threat Detection policy.
- org.openrewrite.terraform.azure.EnsurePostgreSQLServerDisablesPublicNetworkAccess
- Ensure PostgreSQL server disables public network access
- Ensure PostgreSQL server disables public network access.
- org.openrewrite.terraform.azure.EnsurePostgreSQLServerEnablesInfrastructureEncryption
- Ensure PostgreSQL server enables infrastructure encryption
- Ensure PostgreSQL server enables infrastructure encryption.
- org.openrewrite.terraform.azure.EnsurePostgreSQLServerEnablesThreatDetectionPolicy
- Ensure PostgreSQL server enables Threat Detection policy
- Ensure PostgreSQL server enables Threat Detection policy.
- org.openrewrite.terraform.azure.EnsurePublicNetworkAccessEnabledIsSetToFalseForMySQLServers
- Ensure public network access enabled is set to False for mySQL servers
- Ensure public network access enabled is set to False for mySQL servers.
- org.openrewrite.terraform.azure.EnsureSendEmailNotificationForHighSeverityAlertsIsEnabled
- Ensure Send email notification for high severity alerts is enabled
- Ensure Send email notification for high severity alerts is enabled.
- org.openrewrite.terraform.azure.EnsureSendEmailNotificationForHighSeverityAlertsToAdminsIsEnabled
- Ensure Send email notification for high severity alerts to admins is enabled
- Ensure Send email notification for high severity alerts to admins is enabled.
- org.openrewrite.terraform.azure.EnsureStandardPricingTierIsSelected
- Ensure standard pricing tier is selected
- Ensure standard pricing tier is selected.
- org.openrewrite.terraform.azure.EnsureStorageAccountUsesLatestTLSVersion
- Ensure storage account uses latest TLS version
- Communication between an Azure Storage account and a client application is encrypted using Transport Layer Security (TLS). Microsoft recommends using the latest version of TLS for all your Microsoft Azure App Service web applications.
- org.openrewrite.terraform.azure.EnsureTheStorageContainerStoringActivityLogsIsNotPubliclyAccessible
- Ensure the storage container storing activity logs is not publicly accessible
- Ensure the storage container storing activity logs is not publicly accessible.
- org.openrewrite.terraform.azure.EnsureWebAppHasIncomingClientCertificatesEnabled
- Ensure Web App has incoming client certificates enabled
- Ensure Web App has incoming client certificates enabled.
- org.openrewrite.terraform.azure.EnsureWebAppUsesTheLatestVersionOfHTTP
- Ensure Web App uses the latest version of HTTP
- Ensure Web App uses the latest version of HTTP.
- org.openrewrite.terraform.azure.EnsureWebAppUsesTheLatestVersionOfTLSEncryption
- Ensure Web App uses the latest version of TLS encryption
- Ensure Web App uses the latest version of TLS encryption.
- org.openrewrite.terraform.azure.SetAzureStorageAccountDefaultNetworkAccessToDeny
- Set Azure Storage Account default network access to deny
- Ensure Azure Storage Account default network access is set to Deny.
- org.openrewrite.terraform.gcp.EnablePodSecurityPolicyControllerOnGKEClusters
- Enable
PodSecurityPolicycontroller on Google Kubernetes Engine (GKE) clusters - Ensure
PodSecurityPolicycontroller is enabled on Google Kubernetes Engine (GKE) clusters.
- Enable
- org.openrewrite.terraform.gcp.EnableVPCFlowLogsAndIntranodeVisibility
- Enable VPC flow logs and intranode visibility
- Enable VPC flow logs and intranode visibility.
- org.openrewrite.terraform.gcp.EnableVPCFlowLogsForSubnetworks
- Enable VPC Flow Logs for subnetworks
- Ensure GCP VPC flow logs for subnets are enabled. Flow Logs capture information on IP traffic moving through network interfaces. This information can be used to monitor anomalous traffic and provide security insights.
- org.openrewrite.terraform.gcp.EnsureBinaryAuthorizationIsUsed
- Ensure binary authorization is used
- Ensure binary authorization is used.
- org.openrewrite.terraform.gcp.EnsureComputeInstancesLaunchWithShieldedVMEnabled
- Ensure compute instances launch with shielded VM enabled
- Ensure compute instances launch with shielded VM enabled.
- org.openrewrite.terraform.gcp.EnsureGCPCloudStorageBucketWithUniformBucketLevelAccessAreEnabled
- Ensure GCP cloud storage bucket with uniform bucket-level access are enabled
- Ensure GCP cloud storage bucket with uniform bucket-level access are enabled.
- org.openrewrite.terraform.gcp.EnsureGCPKubernetesClusterNodeAutoRepairConfigurationIsEnabled
- Ensure GCP Kubernetes cluster node auto-repair configuration is enabled
- Ensure GCP Kubernetes cluster node auto-repair configuration is enabled.
- org.openrewrite.terraform.gcp.EnsureGCPKubernetesEngineClustersHaveLegacyComputeEngineMetadataEndpointsDisabled
- Ensure GCP Kubernetes engine clusters have legacy compute engine metadata endpoints disabled
- Ensure GCP Kubernetes engine clusters have legacy compute engine metadata endpoints disabled.
- org.openrewrite.terraform.gcp.EnsureGCPVMInstancesHaveBlockProjectWideSSHKeysFeatureEnabled
- Ensure GCP VM instances have block project-wide SSH keys feature enabled
- Ensure GCP VM instances have block project-wide SSH keys feature enabled.
- org.openrewrite.terraform.gcp.EnsureIPForwardingOnInstancesIsDisabled
- Ensure IP forwarding on instances is disabled
- Ensure IP forwarding on instances is disabled.
- org.openrewrite.terraform.gcp.EnsurePrivateClusterIsEnabledWhenCreatingKubernetesClusters
- Ensure private cluster is enabled when creating Kubernetes clusters
- Ensure private cluster is enabled when creating Kubernetes clusters.
- org.openrewrite.terraform.gcp.EnsureSecureBootForShieldedGKENodesIsEnabled
- Ensure secure boot for shielded GKE nodes is enabled
- Ensure secure boot for shielded GKE nodes is enabled.
- org.openrewrite.terraform.gcp.EnsureShieldedGKENodesAreEnabled
- Ensure shielded GKE nodes are enabled
- Ensure shielded GKE nodes are enabled.
- org.openrewrite.terraform.gcp.EnsureTheGKEMetadataServerIsEnabled
- Ensure the GKE metadata server is enabled
- Ensure the GKE metadata server is enabled.
- org.openrewrite.terraform.gcp.GCPBestPractices
- Best practices for GCP
- Securely operate on Google Cloud Platform.
- org.openrewrite.xml.liberty.AppDDNamespaceRule
- Use correct application namespace values
- Namespace values in application.xml must be consistent with the descriptor version.
- org.openrewrite.xml.liberty.ConnectorDDNamespaceRule
- Use correct connector namespace values
- Namespace values in ra.xml must be consistent with the descriptor version.
- org.openrewrite.xml.liberty.EJBDDNamespaceRule
- Use correct ejb-jar namespace values
- Namespace values in ejb-jar.xml must be consistent with the descriptor version.
- org.openrewrite.xml.liberty.WebDDNamespaceRule
- Use correct web-app namespace values
- Namespace values in web.xml must be consistent with the descriptor version.
- software.amazon.awssdk.v2migration.AddS3EventNotificationDependency
- Add AWS SDK for Java v2 S3 Event Notification dependency if needed
- This recipe will add the Java v2 S3 Event Notification dependency if v1 S3EventNotification is used
- software.amazon.awssdk.v2migration.AddTransferManagerDependency
- Add AWS SDK for Java v2 S3 Transfer Manager dependency if needed
- This recipe will add the Java v2 S3 Transfer Manager dependency if v1 Transfer Manager is used
- software.amazon.awssdk.v2migration.AwsSdkJavaV1ToV2
- Migrate from the AWS SDK for Java v1 to the AWS SDK for Java v2
- This recipe will apply changes required for migrating from the AWS SDK for Java v1 to the AWS SDK for Java v2.
- software.amazon.awssdk.v2migration.ChangeAuthTypes
- Change auth related classes from v1 to v2
- Change auth related classes from v1 to v2.
- software.amazon.awssdk.v2migration.ChangeConfigTypes
- Change config related classes from v1 to v2
- Change config related classes from v1 to v2.
- software.amazon.awssdk.v2migration.ChangeExceptionTypes
- Change SDK Exception types from v1 to v2
- Change SDK Exception types from v1 to v2.
- software.amazon.awssdk.v2migration.ChangeRegionTypes
- Change region related classes
- Change region related classes from v1 to v2.
- software.amazon.awssdk.v2migration.ChangeS3EventNotificationTypes
- Change SDK S3EventNotification types from v1 to v2
- Change SDK S3EventNotification types from v1 to v2.
- software.amazon.awssdk.v2migration.ChangeSdkCoreTypes
- Change SDK core types from v1 to v2
- Change SDK core types from v1 to v2.
- software.amazon.awssdk.v2migration.ChangeTransferManagerSimpleMethods
- Change TransferManager simple methods to v2.
- Change TransferManager simple methods to v2.
- software.amazon.awssdk.v2migration.ChangeTransferManagerTypes
- Change SDK TransferManager types from v1 to v2
- Change SDK TransferManager types from v1 to v2.
- software.amazon.awssdk.v2migration.EnumGettersToV2
- Change v1 enum getters to v2
- Change v1 enum getters to v2.
- software.amazon.awssdk.v2migration.S3EventNotificationMethodsToV2
- Change S3EventNotification methods to v2.
- Change S3EventNotification methods to v2.
- software.amazon.awssdk.v2migration.S3MethodsConstructorToFluent
- Change S3 method constructors to fluent builder calls
- Change S3 method constructors to fluent builder calls.
- software.amazon.awssdk.v2migration.S3MethodsToV2
- Change S3 methods to v2.
- Change S3 methods to v2.
- software.amazon.awssdk.v2migration.S3TypesToV2
- Change S3 types to v2.
- Change S3 types to v2.
- software.amazon.awssdk.v2migration.UpgradeSdkDependencies
- Change v1 Maven/Gradle dependencies to v2
- Change v1 Maven/Gradle dependencies to v2.
- tech.picnic.errorprone.refasterrules.tech.picnic.errorprone.refasterrules.AllRefasterRules
- All Picnic Refaster rules
- Collection of all Refaster rules from Picnic's error-prone-contrib project.