File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
rewrite-java/src/main/java/org/openrewrite/java
rewrite-kotlin/src/test/java/org/openrewrite/kotlin Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ public J.VariableDeclarations.NamedVariable visitVariable(J.VariableDeclarations
394
394
if (v != variable ) {
395
395
if (v .getSimpleName ().equals (decapitalize (originalType .getClassName ()))) {
396
396
if (targetType instanceof JavaType .FullyQualified ) {
397
- if (v .getVariableType () != null && TypeUtils .isOfType (targetType , v .getVariableType ().getType ())) {
397
+ if (v .getVariableType () != null && TypeUtils .isAssignableTo (targetType , v .getVariableType ().getType ())) {
398
398
String newName = VariableNameUtils .generateVariableName (
399
399
decapitalize (((JavaType .FullyQualified ) targetType ).getClassName ()),
400
400
updateCursor (v ),
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ fun test(original: Original<String>) { }
195
195
196
196
import x.y.Target
197
197
198
- fun test(original : Target<String>) { }
198
+ fun test(target : Target<String>) { }
199
199
"""
200
200
)
201
201
);
@@ -231,7 +231,7 @@ fun test(original: MyAlias<String>) { }
231
231
232
232
import x.y.Target as MyAlias
233
233
234
- fun test(original : MyAlias<String>) { }
234
+ fun test(target : MyAlias<String>) { }
235
235
"""
236
236
)
237
237
);
@@ -263,7 +263,7 @@ fun test(original: a.b.Original<String>) { }
263
263
264
264
import x.y.Target
265
265
266
- fun test(original : Target<String>) { }
266
+ fun test(target : Target<String>) { }
267
267
"""
268
268
)
269
269
);
You can’t perform that action at this time.
0 commit comments