Remove String.formatter from DefaultServerRequestObservationConvention

Closes gh-30218
This commit is contained in:
James Yuzawa 2023-03-28 08:21:07 -04:00 committed by Brian Clozel
parent 5609e67100
commit 5ba6944145
2 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ public class DefaultServerRequestObservationConvention implements ServerRequestO
public String getContextualName(ServerRequestObservationContext context) {
String httpMethod = context.getCarrier().getMethod().toLowerCase();
if (context.getPathPattern() != null) {
return "http %s %s".formatted(httpMethod, context.getPathPattern());
return "http " + httpMethod + " " + context.getPathPattern();
}
return "http " + httpMethod;
}

View File

@ -84,7 +84,7 @@ public class DefaultServerRequestObservationConvention implements ServerRequestO
public String getContextualName(ServerRequestObservationContext context) {
String httpMethod = context.getCarrier().getMethod().name().toLowerCase();
if (context.getPathPattern() != null) {
return "http %s %s".formatted(httpMethod, context.getPathPattern());
return "http " + httpMethod + " " + context.getPathPattern();
}
return "http " + httpMethod;
}