Repository navigation
Releases
Releases · openrewrite/rewrite-static-analysis
2.53.0
What's Changed
- Preserve intentional switch fall-through in common static analysis by @jkschneider in #1216
- Preserve Kotlin inferred-return method visibility in abstract classes by @jkschneider in #1217
- Keep native language syntax intact in WhileInsteadOfFor by @jkschneider in #1219
- Preserve Kotlin safe property comparisons with Boolean literals by @jkschneider in #1220
- Preserve abstract method contracts in MethodNameCasing by @jkschneider in #1221
- Respect source compatibility and preserve anonymous diamond arguments by @jkschneider in #1218
- Preserve finalizer cleanup in common static analysis by @jkschneider in #1222
- Preserve Kotlin rethrows before a later Throwable handler by @jkschneider in #1223
- Handle typed catches without a variable binding safely by @jkschneider in #1225
- Preserve implicit receivers in EqualsAvoidsNull by @jkschneider in #1226
- Limit Externalizable constructor generation to supported source languages by @jkschneider in #1228
- Preserve Groovy statement wrappers when replacing Class.isInstance by @jkschneider in #1229
- Replace only BigDecimal rounding expressions in Java templates by @jkschneider in #1224
- Restrict CovariantEquals to Java and Groovy by @jkschneider in #1227
- Preserve legacy Groovy labels when adding braces by @jkschneider in #1230
- Erase the instanceof template dummy without changing operand attribution by @jkschneider in #1233
- Retain reflection for recursive generic bounds on legacy runtimes by @jkschneider in #1234
- Preserve evaluation of empty Kotlin if conditions by @jkschneider in #1236
- Avoid changing semantics in
InlineVariable(C20 of #1116) by @Niloyyy in #1180 - Preserve published public and protected constructor API by @jkschneider in #1240
- AllBranchesIdentical to hoist side-effect statements by @greg-at-moderne in #1032
- Preserve published public and protected class modifiers by @jkschneider in #1241
- Keep BigDecimal decimal round-trip conversion opt-in by @jkschneider in #1237
- Preserve nested boolean negation precedence and Groovy coercion by @jkschneider in #1244
- Preserve generated superclass method contracts when standardizing names by @jkschneider in #1242
- Preserve definite assignment for constructor early returns by @jkschneider in #1243
- Keep observable method-name refactoring out of common static analysis by @jkschneider in #1245
- Preserve size comparisons on known mock receivers by @jkschneider in #1246
- Keep parentheses needed for precedence in
SimplifyRedundantLogicalExpression(E4 of #1116) by @Niloyyy in #1178 - Handle implicit
thisinCollectionToArrayShouldHaveProperType(part of C21 of #1116) by @Niloyyy in #1179 - Preserve known mock receivers declared in for initializers by @jkschneider in #1249
- Inline variables whose initializer is a subtype of the declared type by @timtebeek in #1250
- Upgrade Gradle wrapper to 9.9.0 by @timtebeek in #1251
Full Changelog: v2.52.0...v2.53.0
2.52.0
What's Changed
- Fix thread-safety of
EqualsToContentEqualsby @greg-at-moderne in #1211 - Skip contentEquals rewrite when
toStringis inherited from Object inEqualsToContentEqualsby @greg-at-moderne in #1212 - Inline calls to deprecated OpenRewrite methods by @timtebeek in #1213
- Remove test Java parsers the build plugin provides by @timtebeek in #1214
- Add
VariableReferences.isEffectivelyFinaland use it in three recipes by @knutwannheden in #1215
Full Changelog: v2.50.0...v2.52.0
2.51.0
What's Changed
- Keep unconditional
instanceofchecks before Java 21 inInstanceOfPatternMatchby @timtebeek in #1181 - Preserve comments when removing overrides that only call super by @jkschneider in #1152
- Preserve Refaster before-template lambda patterns by @jkschneider in #1182
- Preserve Refaster string comparison and toString patterns by @jkschneider in #1183
- Retain type witnesses that target-type functional arguments by @jkschneider in #1186
- Preserve Refaster boolean template bodies by @jkschneider in #1185
- Preserve switch selector evaluation when lowering cases by @jkschneider in #1189
- Keep Java control-flow rewrites off Python trees by @jkschneider in #1187
- Preserve JavaScript semantics in Java static-analysis recipes by @jkschneider in #1188
- Preserve default-only switch bodies and local scope by @jkschneider in #1190
- Preserve unboxing when simplifying boolean returns by @jkschneider in #1191
- Preserve lazy receiver evaluation in lambda conversions by @jkschneider in #1193
- Cover distinct Kotlin nullable-string guards in boolean simplification by @jkschneider in #1184
- Preserve explicit null switch labels in MinimumSwitchCases by @jkschneider in #1192
- Preserve Groovy equality dispatch and statement shape by @jkschneider in #1194
- Preserve Boolean unboxing in empty if conditions by @jkschneider in #1197
- Preserve explicit type witnesses in targetless expression contexts by @jkschneider in #1196
- Preserve unboxing in negated boxed Boolean returns by @jkschneider in #1199
- Preserve StringBuilder string identity and evaluation contracts by @jkschneider in #1198
- Preserve unsupported switch source and case-label semantics by @jkschneider in #1200
- Use the recipe formatting service in NeedBraces by @jkschneider in #1201
- Retain required C# constant initializers by @jkschneider in #1195
- Preserve generic array inference in varargs constructors by @jkschneider in #1202
- Preserve explicitly typed lambdas for wildcard targets by @jkschneider in #1203
- Use bundled Java formatter when platform services are shared by @jkschneider in #1205
- Preserve explicitly referenced finalizer overrides by @jkschneider in #1204
- Preserve size comparisons inside isEmpty implementations by @jkschneider in #1206
- Preserve intentional fall-through documented in switch headers by @jkschneider in #1207
- Preserve fresh wrapper identity in CommonStaticAnalysis by @jkschneider in #1208
- Preserve resource state when removing redundant closes by @jkschneider in #1209
- Preserve outer fields assigned by nested class initializers by @jkschneider in #1210
Full Changelog: v2.49.0...v2.51.0
2.50.0
What's Changed
- Keep unconditional
instanceofchecks before Java 21 inInstanceOfPatternMatchby @timtebeek in #1181 - Preserve comments when removing overrides that only call super by @jkschneider in #1152
- Preserve Refaster before-template lambda patterns by @jkschneider in #1182
- Preserve Refaster string comparison and toString patterns by @jkschneider in #1183
- Retain type witnesses that target-type functional arguments by @jkschneider in #1186
- Preserve Refaster boolean template bodies by @jkschneider in #1185
- Preserve switch selector evaluation when lowering cases by @jkschneider in #1189
- Keep Java control-flow rewrites off Python trees by @jkschneider in #1187
- Preserve JavaScript semantics in Java static-analysis recipes by @jkschneider in #1188
- Preserve default-only switch bodies and local scope by @jkschneider in #1190
- Preserve unboxing when simplifying boolean returns by @jkschneider in #1191
- Preserve lazy receiver evaluation in lambda conversions by @jkschneider in #1193
- Cover distinct Kotlin nullable-string guards in boolean simplification by @jkschneider in #1184
- Preserve explicit null switch labels in MinimumSwitchCases by @jkschneider in #1192
- Preserve Groovy equality dispatch and statement shape by @jkschneider in #1194
- Preserve Boolean unboxing in empty if conditions by @jkschneider in #1197
- Preserve explicit type witnesses in targetless expression contexts by @jkschneider in #1196
- Preserve unboxing in negated boxed Boolean returns by @jkschneider in #1199
- Preserve StringBuilder string identity and evaluation contracts by @jkschneider in #1198
- Preserve unsupported switch source and case-label semantics by @jkschneider in #1200
- Use the recipe formatting service in NeedBraces by @jkschneider in #1201
- Retain required C# constant initializers by @jkschneider in #1195
- Preserve generic array inference in varargs constructors by @jkschneider in #1202
- Preserve explicitly typed lambdas for wildcard targets by @jkschneider in #1203
- Use bundled Java formatter when platform services are shared by @jkschneider in #1205
- Preserve explicitly referenced finalizer overrides by @jkschneider in #1204
- Preserve size comparisons inside isEmpty implementations by @jkschneider in #1206
- Preserve intentional fall-through documented in switch headers by @jkschneider in #1207
- Preserve fresh wrapper identity in CommonStaticAnalysis by @jkschneider in #1208
- Preserve resource state when removing redundant closes by @jkschneider in #1209
- Preserve outer fields assigned by nested class initializers by @jkschneider in #1210
Full Changelog: v2.49.0...v2.50.0
2.49.0
What's Changed
- Fix qualified
thisresolution inReplaceLambdaWithMethodReferenceby @Niloyyy in #1153 - Skip
ReplaceClassIsInstanceWithInstanceofon incompatible types or primitives (C12 of #1116) by @Niloyyy in #1164 - Keep type arguments of an anonymous class assigned to a wildcard type in
UseDiamondOperator(C10 of #1116) by @Niloyyy in #1161 - Keep a comment once when wrapping an argument in String.valueOf by @timtebeek in #1172
- Don't move a for loop increment whose variable the body also updates by @timtebeek in #1171
Full Changelog: v2.48.0...v2.49.0
2.48.0
What's Changed
- Don't replace a call used as a statement with an expression that cannot stand alone by @knutwannheden in #1162
Full Changelog: v2.47.0...v2.48.0
2.47.0
What's Changed
- Retain raw empty collections used as cast operands by @jkschneider in #1155
- Preserve value comparison for boxed subtraction operands by @jkschneider in #1157
- Preserve casts nested in variable initializers by @jkschneider in #1156
- Compare types with TypeUtils.isOfType instead of JavaType.equals by @knutwannheden in #1158
- Drop the dependency on the archived rewrite-analysis by @jkschneider in #1154
- Move test-only parser jars for JUnit 4, TestNG and Gson to a test type table by @timtebeek in #1159
- Remove the parentheses of a cast operand in RemoveUnnecessaryBitwiseOperation, now parsed as J.Parentheses by @timtebeek in #1160
Full Changelog: v2.46.0...v2.47.0
2.46.0
What's Changed
- UsePortableNewlines: skip escaped backslashes and CRLF by @greg-at-moderne in #1086
- Stop
FixStringFormatExpressionsfrom 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
ObjectFinalizeCallsSuperto Java, Groovy by @greg-at-moderne in #1095 doNotChangeDifferentRecordPatternstest case forRemoveDuplicateConditionsby @greg-at-moderne in #1097- InterruptedExceptionHandling: rename unnamed
_multi-catch variable b… by @greg-at-moderne in #1096 - Advertise RSPEC-S2970 on
FindIgnoredCheckReturnValueby @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
RemoveRedundantTypeCastby @shukla-pranjal in #1109 - AnnotateRequiredParameters, CatchClauseOnlyRethrows and ReplaceStackWithDeque remove the imports they leave unused by @knutwannheden in #1113
- Set Java version marker directly in
InstanceOfPatternMatchTestby @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:
EmptyBlockkeepsfinallystatements andswitchselector side effects, and leavessynchronizedalone 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:
RedundantFileCreationonly unwrapsnew File(String)by @timtebeek in #1124 - A7 + B6: scope follow-up visitors to what each recipe changed by @timtebeek in #1122
- C1:
NoValueOfOnStringTypekeeps oneString.valueOfwhen both concatenation operands arevalueOfcalls by @timtebeek in #1127 - C17:
SimplifyBooleanExpressionkeeps== trueon Kotlin calls returningBoolean?by @timtebeek in #1126 - C2:
NoEqualityInForConditionflips 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
excludedBoundsinCommonDeclarationSiteTypeVariancesby @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
contentEqualsinEqualsAvoidsNullby @timtebeek in #1133 - Clean up
@Issuelinks in tests (M14) by @timtebeek in #1135 - Fix
FinalizePrivateFieldsfor initializer reads, Kotlinvarand Groovy (C9) by @timtebeek in #1139 - Add a delegating
equals(Object)inCovariantEquals(A8 of #1116) by @timtebeek in #1134 - Load every YAML recipe in a test (M13) by @timtebeek in #1136
- Remove stale
@Incubatingannotations (M15) by @timtebeek in #1137 - Skip JavaScript/TypeScript sources in
RemoveExtraSemicolonsby @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
ReplaceStringBuilderWithStringliteral conversion,CharSequenceseeds and Kotlin output by @greg-at-moderne in #1150 - Remove
//noinspectionlines, IDE-only suppressions and comments that restate the code (M6) by @timtebeek in #1146 - Replace
assert, useJavaIsoVisitorandListUtils, and remove dead code (M7) by @timtebeek in #1147 - C11:
UseJavaStyleArrayDeclarationsonly rewrites declarations with matching dimensions by @Niloyyy in #1132 - Keep labelled
continueand the comments of a removedreturn;(B9 from #1116) by @tashen247 in #1148 - Leave a
Stackas 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
- @shukla-pranjal made their first contribution in #1109
- @ds-xdev made their first contribution in #1145
- @tashen247 made their first contribution in #1148
Full Changelog: v2.45.0...v2.46.0
2.45.0
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
InstanceOfPatternMatchremoves by @jkschneider in #1078 - Remove ignored getter calls in
NewStringBuilderBufferWithCharArgumentandUnnecessaryThrowsby @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.execreplacements out of non-Java sources by @martinfrancois in #990
New Contributors
- @LouisDeconinck made their first contribution in #1056
- @myhau made their first contribution in #1077
- @devsuyash-Hq made their first contribution in #1083
Full Changelog: v2.44.0...v2.45.0
2.44.0
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