Skip to content

Commit

Permalink
Fix template typo that missed a closing parenthesis (#100)
Browse files Browse the repository at this point in the history
* Add failing test

* Fix a template typo that caused errors
  • Loading branch information
kunli2 authored Apr 11, 2023
1 parent ddb29ac commit 48ab1a3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ConvertLogMessageMessageOnlyToLogMessageAndThrowable extends Recipe

@Override
public String getDisplayName() {
return "Convert Logger#error|warn(Throwable#message) to Logger#error|warn(<log-message>, e)";
return "Convert `Logger#error|warn(Throwable#message)` to `Logger#error|warn(<log-message>, e)`";
}

@Override
Expand Down Expand Up @@ -85,7 +85,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
String type = mi.getSimpleName();
String message = logMessage == null ? "" : logMessage;
mi = mi.withTemplate(
JavaTemplate.builder(this::getCursor, "#{any(org.slf4j.Logger)}.#{}(\"#{}\", #{any(java.lang.Throwable)}")
JavaTemplate.builder(this::getCursor, "#{any(org.slf4j.Logger)}.#{}(\"#{}\", #{any(java.lang.Throwable)})")
.javaParser(() -> JavaParser.fromJavaVersion().classpath("slf4j-api").build()).build(), mi.getCoordinates().replace(),
mi.getSelect(), type, message, throwableMessage);
}
Expand Down

0 comments on commit 48ab1a3

Please sign in to comment.