Skip to content

Commit

Permalink
Also update type on name identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Dec 8, 2023
1 parent c237a18 commit 823b454
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method,
}

JavaType.Method type = m.getMethodType();

if (type == null || methodExists(type, newMethodName)) {
return m;
}

type = type.withName(newMethodName);
return m.withName(m.getName()
.withSimpleName(newMethodName))
return m.withName(m.getName().withSimpleName(newMethodName).withType(type))
.withMethodType(type);
}

Expand Down

0 comments on commit 823b454

Please sign in to comment.