@@ -234,9 +234,71 @@ rewrite {
234234 // https://docs.openrewrite.org/recipes/java/shortenfullyqualifiedtypereferences
235235 activeRecipe(" org.openrewrite.java.ShortenFullyQualifiedTypeReferences" )
236236
237+ // activeRecipe("org.openrewrite.java.migrate.util.SequencedCollection") // TODO this was enabled, but it won't compile for all language versions
238+ activeRecipe(" org.openrewrite.java.migrate.lang.SwitchCaseAssignmentsToSwitchExpression" )
239+ activeRecipe(" org.openrewrite.java.migrate.lang.SwitchCaseReturnsToSwitchExpression" )
240+ activeRecipe(" org.openrewrite.java.jspecify.MigrateToJSpecify" ) // probably not necessary, but will point out "wrong" nullability imports
241+ activeRecipe(" org.openrewrite.java.ShortenFullyQualifiedTypeReferences" )
242+
237243 // Lots of static analysis
238- // activeRecipe("org.openrewrite.staticanalysis.RemoveExtraSemicolons")
244+ activeRecipe(" org.openrewrite.staticanalysis.RemoveExtraSemicolons" )
239245 activeRecipe(" org.openrewrite.staticanalysis.AnnotateNullableParameters" ) // if you check for null, it should be @Nullable
246+ activeRecipe(" org.openrewrite.staticanalysis.CatchClauseOnlyRethrows" )
247+ activeRecipe(" org.openrewrite.staticanalysis.CompareEnumsWithEqualityOperator" )
248+ // activeRecipe("org.openrewrite.staticanalysis.FinalClass") // maybe consider in the future
249+ activeRecipe(" org.openrewrite.staticanalysis.ForLoopIncrementInUpdate" )
250+ // activeRecipe("org.openrewrite.staticanalysis.UpperCaseLiteralSuffixes") // eventually maybe we can consider this
251+ // activeRecipe("org.openrewrite.staticanalysis.UseDiamondOperator") // TODO see what this does independently
252+ activeRecipe(" org.openrewrite.staticanalysis.BooleanChecksNotInverted" )
253+ // activeRecipe("org.openrewrite.staticanalysis.NeedBraces") // consider in the future
254+ // activeRecipe("org.openrewrite.staticanalysis.HideUtilityClassConstructor") // tries to make spring application class have private constructor
255+ // activeRecipe("org.openrewrite.staticanalysis.JavaApiBestPractices") // TODO enable
256+ activeRecipe(" org.openrewrite.staticanalysis.ModifierOrder" )
257+ activeRecipe(" org.openrewrite.staticanalysis.NestedEnumsAreNotStatic" )
258+ activeRecipe(" org.openrewrite.staticanalysis.UseJavaStyleArrayDeclarations" )
259+ activeRecipe(" org.openrewrite.staticanalysis.NoDoubleBraceInitialization" )
260+ // activeRecipe("org.openrewrite.staticanalysis.MultipleVariableDeclarations") // maybe consider in the future
261+ // activeRecipe("org.openrewrite.staticanalysis.OperatorWrap") // TODO enable - this is a good thing, but results in many many changes
262+ activeRecipe(" org.openrewrite.staticanalysis.PreferSystemGetPropertyOverGetenv" )
263+ activeRecipe(" org.openrewrite.staticanalysis.PreferEqualityComparisonOverDifferenceCheck" )
264+ activeRecipe(" org.openrewrite.staticanalysis.PreferIncrementOperator" )
265+ // activeRecipe("org.openrewrite.staticanalysis.CommonDeclarationSiteTypeVariances") // Could be useful, but honestly the `? super asdf` and `? extends asdf` gets old when it's unnecessary
266+ activeRecipe(" org.openrewrite.staticanalysis.UnnecessaryPrimitiveAnnotations" )
267+ activeRecipe(" org.openrewrite.staticanalysis.UnnecessaryCatch" )
268+ activeRecipe(" org.openrewrite.staticanalysis.EmptyBlock" )
269+ // activeRecipe("org.openrewrite.staticanalysis.RemoveRedundantTypeCast") // bug where it will sometimes remove (T) in unchecked code
270+ activeRecipe(" org.openrewrite.staticanalysis.RemoveRedundantNullCheckBeforeInstanceof" )
271+ activeRecipe(" org.openrewrite.staticanalysis.RemoveRedundantNullCheckBeforeLiteralEquals" )
272+ activeRecipe($$" org.openrewrite.staticanalysis.SimplifyTernaryRecipes$SimplifyTernaryFalseTrueRecipe " )
273+ activeRecipe($$" org.openrewrite.staticanalysis.SimplifyTernaryRecipes$SimplifyTernaryTrueFalseRecipe " )
274+ activeRecipe(" org.openrewrite.staticanalysis.UseListSort" )
275+ activeRecipe(" org.openrewrite.staticanalysis.SimplifyBooleanExpression" )
276+ activeRecipe(" org.openrewrite.staticanalysis.SimplifyBooleanReturn" )
277+ activeRecipe(" org.openrewrite.staticanalysis.StaticMethodNotFinal" )
278+ activeRecipe(" org.openrewrite.staticanalysis.NoToStringOnStringType" )
279+ activeRecipe(" org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources" )
280+ activeRecipe(" org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments" )
281+ activeRecipe(" org.openrewrite.staticanalysis.UnnecessaryReturnAsLastStatement" )
282+ activeRecipe(" org.openrewrite.staticanalysis.UnnecessaryThrows" )
283+ activeRecipe(" org.openrewrite.staticanalysis.UnwrapRepeatableAnnotations" )
284+ // activeRecipe("org.openrewrite.staticanalysis.UnwrapElseAfterReturn") // kinda annoying when I want to pick the style on a per if-else statement basis
285+ activeRecipe(" org.openrewrite.staticanalysis.UsePortableNewlines" )
286+ // activeRecipe("org.openrewrite.staticanalysis.UseCollectionInterfaces") // stops people from using something like an ArrayList in a return type // TODO enable
287+ // activeRecipe("org.openrewrite.staticanalysis.IsEmptyCallOnCollections") // eventually enable this, but first update some tests
288+ activeRecipe(" org.openrewrite.staticanalysis.NoEmptyCollectionWithRawType" )
289+ activeRecipe(" org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray" )
290+ activeRecipe(" org.openrewrite.staticanalysis.UseMapContainsKey" )
291+ activeRecipe(" org.openrewrite.staticanalysis.UseStandardCharset" )
292+ activeRecipe(" org.openrewrite.staticanalysis.EqualsToContentEquals" )
293+ activeRecipe(" org.openrewrite.staticanalysis.StringLiteralEquality" )
294+ activeRecipe(" org.openrewrite.staticanalysis.UseStringReplace" )
295+ activeRecipe(" org.openrewrite.staticanalysis.UseSystemLineSeparator" )
296+ activeRecipe(" org.openrewrite.staticanalysis.NoEqualityInForCondition" )
297+ // consider https://docs.openrewrite.org/recipes/staticanalysis/explicitlambdaargumenttypes later
298+ activeRecipe(" org.openrewrite.staticanalysis.IndexOfChecksShouldUseAStartPosition" )
299+ activeRecipe(" org.openrewrite.staticanalysis.PrimitiveWrapperClassConstructorToValueOf" )
300+ activeRecipe(" org.openrewrite.staticanalysis.RemoveHashCodeCallsFromArrayInstances" )
301+ activeRecipe(" org.openrewrite.staticanalysis.IndexOfReplaceableByContains" )
302+ activeRecipe(" org.openrewrite.staticanalysis.BigDecimalDoubleConstructorRecipe" )
240303
241- // TODO add more
242304}
0 commit comments