Skip to content

Releases: openrewrite/rewrite-static-analysis

2.46.0

Choose a tag to compare

@code-genome-project-ci code-genome-project-ci released this 27 Oct 02:12
95d46d5

What's Changed

  • UsePortableNewlines: skip escaped backslashes and CRLF by @greg-at-moderne in #1086
  • Stop FixStringFormatExpressions from rewriting \n to %n by @greg-at-moderne in #1087
  • TernaryOperatorsShouldNotBeNested support for assignemnts and declara… by @greg-at-moderne in #1088
  • Don't use CLI's Go RPC binary in tests by @greg-at-moderne in #1091
  • Refactoring: use ListUtils more by @greg-at-moderne in #1090
  • TernaryOperatorsShouldNotBeNested not to mangle primitive numeric types by @greg-at-moderne in #1089
  • Add RemoveUnnecessaryBitwiseOperation recipe by @Jammy-Louie in #1085
  • AnnotateNullableMethods to skip JS sources by @greg-at-moderne in #1093
  • MissingOverrideAnnotation: only apply to Java and Groovy sources by @timtebeek in #1094
  • Limit ObjectFinalizeCallsSuper to Java, Groovy by @greg-at-moderne in #1095
  • doNotChangeDifferentRecordPatterns test case for RemoveDuplicateConditions by @greg-at-moderne in #1097
  • InterruptedExceptionHandling: rename unnamed _ multi-catch variable b… by @greg-at-moderne in #1096
  • Advertise RSPEC-S2970 on FindIgnoredCheckReturnValue by @Jammy-Louie in #1098
  • Match fully qualified System.out and class literals by type by @jkschneider in #1099
  • Use the parent cursor for the visited tree and new ids for nested copies by @jkschneider in #1100
  • Tell the block's visit about default-only switches in a cursor message, not a marker by @jkschneider in #1101
  • Write literals, catches and && chains as the parser builds them by @jkschneider in #1102
  • Merge every closed resource of a try in one pass in UseTryWithResources by @knutwannheden in #1105
  • Keep close order and resource scope when merging closes in UseTryWithResources by @knutwannheden in #1106
  • Keep the method type in sync with the return type in UseCollectionInterfaces by @knutwannheden in #1107
  • Add FindNonCaseLabelsInSwitch recipe (RSPEC-S1219) by @Jammy-Louie in #1108
  • Upgrade to Gradle 9.8.2 by @jkschneider in #1110
  • Preserve raw cast on non-parameterized subtype argument in RemoveRedundantTypeCast by @shukla-pranjal in #1109
  • AnnotateRequiredParameters, CatchClauseOnlyRethrows and ReplaceStackWithDeque remove the imports they leave unused by @knutwannheden in #1113
  • Set Java version marker directly in InstanceOfPatternMatchTest by @timtebeek in #1114
  • Preserve comments before unwrapped else blocks by @martinfrancois in #992
  • ObjectFinalizeCallsSuper: declare the overridden finalize() exceptions when adding super.finalize() by @martinfrancois in #969
  • Correct recipe display names, descriptions and option descriptions (M9) by @timtebeek in #1118
  • Tighten recipe preconditions (M8 from #1115) by @timtebeek in #1121
  • B3: EmptyBlock keeps finally statements and switch selector side effects, and leaves synchronized alone by @timtebeek in #1117
  • Correct RSPEC tags and declare Sonar effort estimates (M10) by @timtebeek in #1119
  • SimplifyArraysAsList: do not unwrap primitive arrays (C16 from #1116) by @timtebeek in #1125
  • B5: RedundantFileCreation only unwraps new File(String) by @timtebeek in #1124
  • A7 + B6: scope follow-up visitors to what each recipe changed by @timtebeek in #1122
  • C1: NoValueOfOnStringType keeps one String.valueOf when both concatenation operands are valueOf calls by @timtebeek in #1127
  • C17: SimplifyBooleanExpression keeps == true on Kotlin calls returning Boolean? by @timtebeek in #1126
  • C2: NoEqualityInForCondition flips the operator when the loop variable is on the right by @timtebeek in #1128
  • Add IsEmptyCallOnMaps recipe by @neil-mushell in #1112
  • A7 + B6 follow-up: side effects, comments and formatting scope by @timtebeek in #1123
  • Register warmJavaScriptRpcCache without the deprecated registering delegate by @timtebeek in #1130
  • Use excludedBounds in CommonDeclarationSiteTypeVariances by @timtebeek in #1131
  • Preserve nonzero long field initializers at full width by @jkschneider in #1141
  • Preserve NaN semantics when simplifying negated comparisons by @jkschneider in #1142
  • Preserve Float double constructor conversions (1116 C7) by @jkschneider in #1143
  • EqualsAvoidsNull: keep the null check before contentEquals by @timtebeek in #1138
  • Keep the null check before contentEquals in EqualsAvoidsNull by @timtebeek in #1133
  • Clean up @Issue links in tests (M14) by @timtebeek in #1135
  • Fix FinalizePrivateFields for initializer reads, Kotlin var and Groovy (C9) by @timtebeek in #1139
  • Add a delegating equals(Object) in CovariantEquals (A8 of #1116) by @timtebeek in #1134
  • Load every YAML recipe in a test (M13) by @timtebeek in #1136
  • Remove stale @Incubating annotations (M15) by @timtebeek in #1137
  • Skip JavaScript/TypeScript sources in RemoveExtraSemicolons by @ds-xdev in #1145
  • Resolve stale disabled tests, fold language variants and tidy test names (M12) by @timtebeek in #1144
  • Don’t leave a null body when removing the only statement of a brace-less if or loop by @greg-at-moderne in #1149
  • Fix ReplaceStringBuilderWithString literal conversion, CharSequence seeds and Kotlin output by @greg-at-moderne in #1150
  • Remove //noinspection lines, IDE-only suppressions and comments that restate the code (M6) by @timtebeek in #1146
  • Replace assert, use JavaIsoVisitor and ListUtils, and remove dead code (M7) by @timtebeek in #1147
  • C11: UseJavaStyleArrayDeclarations only rewrites declarations with matching dimensions by @Niloyyy in #1132
  • Keep labelled continue and the comments of a removed return; (B9 from #1116) by @tashen247 in #1148
  • Leave a Stack as it is when rewrite-analysis cannot follow where it flows, as its last release cannot through an anonymous class by @jkschneider in #1151

New Contributors

Full Changelog: v2.45.0...v2.46.0

2.45.0

Choose a tag to compare

@bryceatmoderne bryceatmoderne released this 09 Oct 19:56

What's Changed

  • Add FindMainWithThrowsClause recipe (RSPEC-S2096) by @steve-aom-elliott in #1072
  • Fix serialVersionUID for generic Serializable classes by @LouisDeconinck in #1056
  • Add some scala() assertions to selected recipe tests by @greg-at-moderne in #1073
  • Null-safety for space in RemoveExtraSemicolons by @greg-at-moderne in #1076
  • Run MoveFieldAnnotationToType only on Java sources by @myhau in #1077
  • Preserve the comments on a cast declaration InstanceOfPatternMatch removes by @jkschneider in #1078
  • Remove ignored getter calls in NewStringBuilderBufferWithCharArgument and UnnecessaryThrows by @timtebeek in #1081
  • Remove imports left unused after RemoveMethodsOnlyCallSuper runs by @motlin in #1082
  • Add FindIgnoredCheckReturnValue recipe by @timtebeek in #1080
  • FindIgnoredCheckReturnValue: skip calls on the current instance in AssertJ assertion constructors by @timtebeek in #1084
  • Fix InstanceOfPatternMatch: don't replace cast after variable reassignment by @devsuyash-Hq in #1083
  • Keep Java Runtime.exec replacements out of non-Java sources by @martinfrancois in #990

New Contributors

Full Changelog: v2.44.0...v2.45.0

2.44.0

Choose a tag to compare

@Jammy-Louie Jammy-Louie released this 23 Sep 16:14
424b8d9

What's Changed

  • Add FindWaitWithMultipleLocksHeld (Sonar S3046) by @steve-aom-elliott in #1059
  • Add FindSystemAndRuntimeExitCalls recipe (RSPEC-S1147) by @steve-aom-elliott in #1058
  • Add FindThreadGroupUsages recipe (RSPEC-S3014) by @steve-aom-elliott in #1063
  • FallThrough: don't add a break after a guarded early exit by @Niloyyy in #1008
  • NoDoubleBraceInitialization: don't retarget invocations inside nested anonymous classes by @Niloyyy in #1035
  • DeclarationSiteTypeVariance: skip @OverRide methods when the supertype is unresolved by @Niloyyy in #1036
  • Track taint through derived locals in FindNewExceptionWithoutCause by @knutwannheden in #1065
  • UnwrapRepeatableAnnotations: only unwrap container annotations by @Niloyyy in #1064
  • Only remove catch clauses backed by complete type information in UnnecessaryCatch by @knutwannheden in #1066
  • Add UnnecessaryFinalInTryWithResources by @sullis in #1046
  • fix: treat unresolved call sites as possible throw sites in UnnecessaryThrows by @knutwannheden in #1067
  • ForLoopIncrementInUpdate: do not move increment skipped by continue by @koppor in #1062
  • Collapse MethodNameCasing edit phase to single traversal by @greg-at-moderne in #1069
  • FinalizePrivateFields not to run for JavaScript sources by @greg-at-moderne in #1070
  • Add regression test for RemoveRedundantTypeCast on generic method in Stream.map by @timtebeek in #1071

New Contributors

Full Changelog: v2.43.0...v2.44.0

2.43.0

Choose a tag to compare

@Jammy-Louie Jammy-Louie released this 09 Sep 16:51
c8479e2

What's Changed

Full Changelog: v2.42.0...v2.43.0

2.42.0

Choose a tag to compare

@kmccarp kmccarp released this 26 Aug 18:10
e5883e5

What's Changed

Full Changelog: v2.41.1...v2.42.0

2.41.1

Choose a tag to compare

@greg-at-moderne greg-at-moderne released this 19 Aug 07:44

What's Changed

  • Add RemoveDuplicateAnnotations by @timtebeek in #1000
  • Revert "Skip the JavaScript RPC tests when their npm package is unavailable" by @timtebeek in #1001
  • Do not remove catch (Exception e) covering a checked exception by @timtebeek in #1003
  • UnnecessaryExplicitTypeArguments: retain witness when enclosing method has dependent type parameters by @Niloyyy in #998
  • Add recipe optimizing map iteration by @sambsnyd in #1004
  • WhileInsteadOfFor not to run for Go code by @greg-at-moderne in #999
  • Keep annotated and strictfp overrides that only call super by @martinfrancois in #988

New Contributors

Full Changelog: v2.41.0...v2.41.1

2.41.0

Choose a tag to compare

@timtebeek timtebeek released this 12 Aug 15:44
43b51de

What's Changed

  • Pre-install the JavaScript RPC npm package before running tests by @timtebeek in #956
  • UnnecessaryExplicitTypeArguments: retain witness for a return-only ty… by @neil-mushell in #958
  • Do not delete expressions that may have side effects by @timtebeek in #959
  • OpenRewrite recipe best practices by @timtebeek in #960
  • UseLambdaForFunctionalInterface: only convert when the anonymous class implements the SAM by @timtebeek in #962
  • ReplaceStringBuilderWithString: wrap char[] appends in String.valueOf by @martinfrancois in #977
  • RemoveMethodsOnlyCallSuper: keep synchronized and deprecated overrides by @martinfrancois in #971
  • Make sure ModifierOrder doesn't alter Python's def quasi-modifier by @greg-at-moderne in #981
  • NullableOnMethodReturnType: only move annotations applicable to TYPE_USE by @martinfrancois in #968
  • FallThrough to work only for Java files by @greg-at-moderne in #982
  • Retry a failed npx warm, and survive a machine without Node by @timtebeek in #984
  • Make DefaultComesLast apply only to Java by @greg-at-moderne in #983

New Contributors

Full Changelog: v2.40.0...v2.41.0

2.40.0

Choose a tag to compare

@timtebeek timtebeek released this 29 Jul 17:50
00641d2

What's Changed

  • Retain UnnecessaryThrows on overridable methods (#939) by @timtebeek in #940
  • Qualify this for outer-class methods in ReplaceLambdaWithMethodReference by @timtebeek in #942
  • FixStringFormatExpressions: don't strip args with no matched specifiers by @neil-mushell in #943
  • UnnecessaryExplicitTypeArguments: retain load-bearing witness in argument position on instance methods too by @neil-mushell in #946
  • Set Develocity projectId to "openrewrite" by @timtebeek in #947
  • Add recipe for finding public methods missing javadoc by @sambsnyd in #948
  • Add recipes for migrating off a variety of legacy collection types by @sambsnyd in #949
  • exception-without-cause by @sambsnyd in #950
  • Do not wrap operators onto a new line in Kotlin sources by @vlsi in #936
  • Do not remove casts from raw types to their parameterized form by @timtebeek in #954
  • Forward Code Genome Project publish credentials to ci-gradle.yml by @jkschneider in #955

New Contributors

Full Changelog: v2.39.0...v2.40.0

2.39.0

Choose a tag to compare

@greg-at-moderne greg-at-moderne released this 14 Jul 05:34

What's Changed

  • Fix UseStringCaseInsensitiveOrder lambda matching by @timtebeek in #933
  • Keep (Object) cast on array argument at varargs position by @timtebeek in #935
  • Python: add Python tests for selected 7 recipes by @greg-at-moderne in #929
  • Consolidate UseStringCaseInsensitiveOrder into a single Refaster template by @timtebeek in #937

Full Changelog: v2.38.0...v2.39.0

2.38.0

Choose a tag to compare

@greg-at-moderne greg-at-moderne released this 01 Jul 06:00
6ed9dfd

What's Changed

  • Fix UseTryWithResources moving resource out of scope for catch block by @timtebeek in #921
  • Fix MinimumSwitchCases crash on Java 21 sealed-interface pattern switch by @timtebeek in #922
  • Fix RemoveUnusedPrivateMethods deleting methods called with raw collection arguments by @habiibullahm in #898
  • Add UseStringCaseInsensitiveOrder by @steve-aom-elliott in #923
  • Add 7 cross-language code quality recipes by @jkschneider in #853
  • Fix RemoveRedundantTypeCast removing cast that gives a var lambda its target type by @timtebeek in #925
  • Tests for Kotlin, Groovy, TS for cross-language code quality recipes by @greg-at-moderne in #928
  • Add RemoveUnreachableMultiCatchAlternative by @steve-aom-elliott in #926
  • Use unnamed variable for unused try-with-resources resource on Java 21+ by @timtebeek in #930

New Contributors

Full Changelog: v2.37.0...v2.38.0