Reference
Recipes
Java
Cleanup
Design Partners
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.24.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
build.gradle
1
plugins {
2
id("org.openrewrite.rewrite") version("5.22.2")
3
}
4
5
rewrite {
6
activeRecipe("org.openrewrite.java.cleanup.CommonStaticAnalysis")
7
}
8
9
repositories {
10
mavenCentral()
11
}
Copied!
pom.xml
1
<project>
2
<build>
3
<plugins>
4
<plugin>
5
<groupId>org.openrewrite.maven</groupId>
6
<artifactId>rewrite-maven-plugin</artifactId>
7
<version>4.25.0</version>
8
<configuration>
9
<activeRecipes>
10
<recipe>org.openrewrite.java.cleanup.CommonStaticAnalysis</recipe>
11
</activeRecipes>
12
</configuration>
13
</plugin>
14
</plugins>
15
</build>
16
</project>
Copied!
Recipes can also be activated directly from the command line by adding the argument -Drewrite.activeRecipesorg.openrewrite.java.cleanup.CommonStaticAnalysis

Definition

Recipe List
Yaml Recipe List
1
---
2
type: specs.openrewrite.org/v1beta/recipe
3
name: org.openrewrite.java.cleanup.CommonStaticAnalysis
4
displayName: Common static analysis issues
5
description: Resolve common static analysis issues discovered through 3rd party tools
6
recipeList:
7
- org.openrewrite.java.cleanup.AddSerialVersionUidToSerializable
8
- org.openrewrite.java.cleanup.AtomicPrimitiveEqualsUsesGet
9
- org.openrewrite.java.cleanup.BigDecimalRoundingConstantsToEnums
10
- org.openrewrite.java.cleanup.BooleanChecksNotInverted
11
- org.openrewrite.java.cleanup.CaseInsensitiveComparisonsDoNotChangeCase
12
- org.openrewrite.java.cleanup.CatchClauseOnlyRethrows
13
- org.openrewrite.java.cleanup.ControlFlowIndentation
14
- org.openrewrite.java.cleanup.CovariantEquals
15
- org.openrewrite.java.cleanup.DefaultComesLast
16
- org.openrewrite.java.cleanup.EmptyBlock
17
- org.openrewrite.java.cleanup.EqualsAvoidsNull
18
- org.openrewrite.java.cleanup.ExplicitInitialization
19
- org.openrewrite.java.cleanup.ExplicitLambdaArgumentTypes
20
- org.openrewrite.java.cleanup.ExternalizableHasNoArgsConstructor
21
- org.openrewrite.java.cleanup.FallThrough
22
- org.openrewrite.java.cleanup.FinalClass
23
- org.openrewrite.java.cleanup.ForLoopIncrementInUpdate
24
- org.openrewrite.java.cleanup.HideUtilityClassConstructor
25
- org.openrewrite.java.cleanup.IndexOfChecksShouldUseAStartPosition
26
- org.openrewrite.java.cleanup.IndexOfReplaceableByContains
27
- org.openrewrite.java.cleanup.IndexOfShouldNotCompareGreaterThanZero
28
- org.openrewrite.java.cleanup.IsEmptyCallOnCollections
29
- org.openrewrite.java.cleanup.LambdaBlockToExpression
30
- org.openrewrite.java.cleanup.LowercasePackage
31
- org.openrewrite.java.cleanup.MethodNameCasing:
32
- org.openrewrite.java.cleanup.MinimumSwitchCases
33
- org.openrewrite.java.cleanup.ModifierOrder
34
- org.openrewrite.java.cleanup.MultipleVariableDeclarations
35
- org.openrewrite.java.cleanup.NeedBraces
36
- org.openrewrite.java.cleanup.NestedEnumsAreNotStatic
37
- org.openrewrite.java.cleanup.NewStringBuilderBufferWithCharArgument
38
- org.openrewrite.java.cleanup.NoDoubleBraceInitialization
39
- org.openrewrite.java.cleanup.NoEmptyCollectionWithRawType
40
- org.openrewrite.java.cleanup.NoEqualityInForCondition
41
- org.openrewrite.java.cleanup.NoFinalizer
42
- org.openrewrite.java.cleanup.NoPrimitiveWrappersForToStringOrCompareTo
43
- org.openrewrite.java.cleanup.NoRedundantJumpStatements
44
- org.openrewrite.java.cleanup.NoToStringOnStringType
45
- org.openrewrite.java.cleanup.NoValueOfOnStringType
46
- org.openrewrite.java.cleanup.ObjectFinalizeCallsSuper
47
- org.openrewrite.java.cleanup.PrimitiveWrapperClassConstructorToValueOf
48
- org.openrewrite.java.cleanup.RedundantFileCreation
49
- org.openrewrite.java.cleanup.RemoveExtraSemicolons
50
- org.openrewrite.java.cleanup.RemoveUnusedLocalVariables:
51
- org.openrewrite.java.cleanup.RenameLocalVariablesToCamelCase
52
- org.openrewrite.java.cleanup.RenameMethodsNamedHashcodeEqualOrTostring
53
- org.openrewrite.java.cleanup.RenamePrivateFieldsToCamelCase
54
- org.openrewrite.java.cleanup.ReplaceLambdaWithMethodReference
55
- org.openrewrite.java.cleanup.SimplifyBooleanExpression
56
- org.openrewrite.java.cleanup.SimplifyBooleanReturn
57
- org.openrewrite.java.cleanup.StaticMethodNotFinal
58
- org.openrewrite.java.cleanup.StringLiteralEquality
59
- org.openrewrite.java.cleanup.UnnecessaryCloseInTryWithResources
60
- org.openrewrite.java.cleanup.UnnecessaryExplicitTypeArguments
61
- org.openrewrite.java.cleanup.UnnecessaryParentheses
62
- org.openrewrite.java.cleanup.UnnecessaryPrimitiveAnnotations
63
- org.openrewrite.java.cleanup.UnnecessaryThrows
64
- org.openrewrite.java.cleanup.UseDiamondOperator
65
- org.openrewrite.java.cleanup.UseJavaStyleArrayDeclarations
66
- org.openrewrite.java.cleanup.UseLambdaForFunctionalInterface
67
- org.openrewrite.java.cleanup.UseStringReplace
68
- org.openrewrite.java.cleanup.WhileInsteadOfFor
69
- org.openrewrite.java.cleanup.WriteOctalValuesAsDecimal
Copied!
Export as PDF
Copy link