Skip to content

Commit

Permalink
ConvertToSecurityDslVisitor: adjusted pattern for changing methodType…
Browse files Browse the repository at this point in the history
… on methodInvocation to avoid misbehaviors when the method name identifier type is non-null
  • Loading branch information
Nick McKinney committed Jan 4, 2024
1 parent eead6cf commit 6a18fb3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ private List<J.MethodInvocation> computeAndMarkChain() {
Cursor cursor = getCursor();
J.MethodInvocation initialMethodInvocation = cursor.getValue();
createDesiredReplacementForArg(initialMethodInvocation).ifPresent(methodType ->
chain.add(initialMethodInvocation.withMethodType(methodType)
.withName(initialMethodInvocation.getName().withSimpleName(methodType.getName()))));
chain.add(initialMethodInvocation.withName(
initialMethodInvocation.getName().withType(methodType).withSimpleName(methodType.getName()))));
cursor = cursor.getParent(2);
for (; isApplicableCallCursor(cursor); cursor = cursor.getParent(2)) {
cursor.putMessage(MSG_FLATTEN_CHAIN, true);
Expand Down

0 comments on commit 6a18fb3

Please sign in to comment.