Skip to content

Commit 76d0609

Browse files
committed
Fix failing test by rewriting adjusting the MethodType
1 parent c8d2f76 commit 76d0609

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/openrewrite/java/migrate/lang/MigrateSecurityManagerMulticast.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
5353
J.MethodInvocation m = super.visitMethodInvocation(method, ctx);
5454

5555
if (MULTICAST_METHOD.matches(m) && m.getArguments().size() == 2) {
56-
return m.withArguments(Collections.singletonList(m.getArguments().get(0)));
56+
return m.withArguments(Collections.singletonList(m.getArguments().get(0)))
57+
.withMethodType(m.getMethodType()
58+
.withParameterNames(m.getMethodType().getParameterNames().subList(0, 1))
59+
.withParameterTypes(m.getMethodType().getParameterTypes().subList(0, 1))
60+
);
5761
}
5862
return m;
5963
}

0 commit comments

Comments
 (0)