@@ -194,7 +194,7 @@ public J visitArrayAccessExpression(KtArrayAccessExpression expression, Executio
194
194
}
195
195
196
196
JContainer <Expression > args = JContainer .build (Space .EMPTY , expressions , markers );
197
- return new J .MethodInvocation (
197
+ return mapType ( new J .MethodInvocation (
198
198
randomId (),
199
199
prefix (expression ),
200
200
markers ,
@@ -203,7 +203,7 @@ public J visitArrayAccessExpression(KtArrayAccessExpression expression, Executio
203
203
name ,
204
204
args ,
205
205
type
206
- );
206
+ )) ;
207
207
}
208
208
209
209
@ Override
@@ -2370,7 +2370,7 @@ public J visitDotQualifiedExpression(KtDotQualifiedExpression expression, Execut
2370
2370
padLeft (suffix (expression .getReceiverExpression ()), (J .Identifier ) pt .getClazz ()),
2371
2371
pt .getType ()
2372
2372
));
2373
- return pt .withClazz (newName ).withPrefix (prefix );
2373
+ return mapType ( pt .withClazz (newName ).withPrefix (prefix ) );
2374
2374
} else if (j instanceof J .MethodInvocation ) {
2375
2375
J .MethodInvocation m = (J .MethodInvocation ) j ;
2376
2376
return m .getPadding ().withSelect (padRight (receiver , suffix (expression .getReceiverExpression ())))
@@ -3307,7 +3307,7 @@ private J.MethodInvocation mapFunctionCall(KtBinaryExpression expression, Execut
3307
3307
JContainer <Expression > args = JContainer .build (Space .EMPTY , expressions , paramMarkers );
3308
3308
JavaType .Method methodType = methodInvocationType (expression );
3309
3309
3310
- return new J .MethodInvocation (
3310
+ return mapType ( new J .MethodInvocation (
3311
3311
randomId (),
3312
3312
prefix (expression ),
3313
3313
markers ,
@@ -3316,7 +3316,7 @@ private J.MethodInvocation mapFunctionCall(KtBinaryExpression expression, Execut
3316
3316
name ,
3317
3317
args ,
3318
3318
methodType
3319
- );
3319
+ )) ;
3320
3320
}
3321
3321
3322
3322
private J .ControlParentheses <Expression > buildIfCondition (KtIfExpression expression ) {
@@ -3482,19 +3482,11 @@ private J.FieldAccess mapType(J.FieldAccess tree) {
3482
3482
}
3483
3483
3484
3484
private J .MethodDeclaration mapType (J .MethodDeclaration tree ) {
3485
- J .MethodDeclaration m = tree ;
3486
- if (!(m .getName ().getType () instanceof JavaType .Method )) {
3487
- m = m .withName (m .getName ().withType (m .getMethodType ()));
3488
- }
3489
- return m ;
3485
+ return tree .withName (tree .getName ().withType (tree .getMethodType ()));
3490
3486
}
3491
3487
3492
3488
private J .MethodInvocation mapType (J .MethodInvocation tree ) {
3493
- J .MethodInvocation m = tree ;
3494
- if (!(m .getName ().getType () instanceof JavaType .Method )) {
3495
- m = m .withName (m .getName ().withType (m .getMethodType ()));
3496
- }
3497
- return m ;
3489
+ return tree .withName (tree .getName ().withType (tree .getMethodType ()));
3498
3490
}
3499
3491
3500
3492
private J .NewClass mapType (J .NewClass tree ) {
0 commit comments