Links

Common static analysis issues

org.openrewrite.java.cleanup.CommonStaticAnalysis Resolve common static analysis issues discovered through 3rd party tools.

Source

  • groupId: org.openrewrite
  • artifactId: rewrite-java
  • version: 7.33.0

Usage

This recipe has no required configuration parameters and comes from a rewrite core library. It can be activated directly without adding any dependencies.
Gradle
Maven POM
Maven Command Line
build.gradle
plugins {
id("org.openrewrite.rewrite") version("5.32.0")
}
rewrite {
activeRecipe("org.openrewrite.java.cleanup.CommonStaticAnalysis")
}
repositories {
mavenCentral()
}
pom.xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>4.37.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.cleanup.CommonStaticAnalysis</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</project>
shell
mvn org.openrewrite.maven:rewrite-maven-plugin:4.37.0:run \
-DactiveRecipes=org.openrewrite.java.cleanup.CommonStaticAnalysis
Recipes can also be activated directly from the command line by adding the argument -Drewrite.activeRecipes=org.openrewrite.java.cleanup.CommonStaticAnalysis

Definition

Recipe List
Yaml Recipe List
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.cleanup.CommonStaticAnalysis
displayName: Common static analysis issues
description: Resolve common static analysis issues discovered through 3rd party tools.
recipeList:
- org.openrewrite.java.cleanup.AddSerialVersionUidToSerializable
- org.openrewrite.java.cleanup.AtomicPrimitiveEqualsUsesGet
- org.openrewrite.java.cleanup.BigDecimalRoundingConstantsToEnums
- org.openrewrite.java.cleanup.BooleanChecksNotInverted
- org.openrewrite.java.cleanup.CaseInsensitiveComparisonsDoNotChangeCase
- org.openrewrite.java.cleanup.CatchClauseOnlyRethrows
- org.openrewrite.java.cleanup.CovariantEquals
- org.openrewrite.java.cleanup.DefaultComesLast
- org.openrewrite.java.cleanup.EmptyBlock
- org.openrewrite.java.cleanup.EqualsAvoidsNull
- org.openrewrite.java.cleanup.ExplicitInitialization
- org.openrewrite.java.cleanup.ExternalizableHasNoArgsConstructor
- org.openrewrite.java.cleanup.FallThrough
- org.openrewrite.java.cleanup.FinalClass
- org.openrewrite.java.cleanup.FixStringFormatExpressions
- org.openrewrite.java.cleanup.ForLoopIncrementInUpdate
- org.openrewrite.java.cleanup.IndexOfChecksShouldUseAStartPosition
- org.openrewrite.java.cleanup.IndexOfReplaceableByContains
- org.openrewrite.java.cleanup.IndexOfShouldNotCompareGreaterThanZero
- org.openrewrite.java.cleanup.InlineVariable
- org.openrewrite.java.cleanup.IsEmptyCallOnCollections
- org.openrewrite.java.cleanup.LambdaBlockToExpression
- org.openrewrite.java.cleanup.LowercasePackage
- org.openrewrite.java.cleanup.MethodNameCasing:
- org.openrewrite.java.cleanup.MinimumSwitchCases
- org.openrewrite.java.cleanup.ModifierOrder
- org.openrewrite.java.cleanup.MultipleVariableDeclarations
- org.openrewrite.java.cleanup.NeedBraces
- org.openrewrite.java.cleanup.NestedEnumsAreNotStatic
- org.openrewrite.java.cleanup.NewStringBuilderBufferWithCharArgument
- org.openrewrite.java.cleanup.NoDoubleBraceInitialization
- org.openrewrite.java.cleanup.NoEmptyCollectionWithRawType
- org.openrewrite.java.cleanup.NoEqualityInForCondition
- org.openrewrite.java.cleanup.NoFinalizer
- org.openrewrite.java.cleanup.NoPrimitiveWrappersForToStringOrCompareTo
- org.openrewrite.java.cleanup.NoRedundantJumpStatements
- org.openrewrite.java.cleanup.NoToStringOnStringType
- org.openrewrite.java.cleanup.NoValueOfOnStringType
- org.openrewrite.java.cleanup.ObjectFinalizeCallsSuper
- org.openrewrite.java.cleanup.PrimitiveWrapperClassConstructorToValueOf
- org.openrewrite.java.cleanup.RedundantFileCreation
- org.openrewrite.java.cleanup.RemoveExtraSemicolons
- org.openrewrite.java.cleanup.RenameLocalVariablesToCamelCase
- org.openrewrite.java.cleanup.RenameMethodsNamedHashcodeEqualOrTostring
- org.openrewrite.java.cleanup.RenamePrivateFieldsToCamelCase
- org.openrewrite.java.cleanup.ReplaceLambdaWithMethodReference
- org.openrewrite.java.cleanup.SimplifyBooleanExpression
- org.openrewrite.java.cleanup.SimplifyBooleanReturn
- org.openrewrite.java.cleanup.StaticMethodNotFinal
- org.openrewrite.java.cleanup.StringLiteralEquality
- org.openrewrite.java.cleanup.UnnecessaryCloseInTryWithResources
- org.openrewrite.java.cleanup.UnnecessaryExplicitTypeArguments
- org.openrewrite.java.cleanup.UnnecessaryParentheses
- org.openrewrite.java.cleanup.UnnecessaryPrimitiveAnnotations
- org.openrewrite.java.cleanup.UpperCaseLiteralSuffixes
- org.openrewrite.java.cleanup.UseDiamondOperator
- org.openrewrite.java.cleanup.UseJavaStyleArrayDeclarations
- org.openrewrite.java.cleanup.UseLambdaForFunctionalInterface
- org.openrewrite.java.cleanup.WhileInsteadOfFor
- org.openrewrite.java.cleanup.WriteOctalValuesAsDecimal