Remove unnecessary toString() calls

See gh-38739
This commit is contained in:
Yanming Zhou
2023-12-19 22:24:49 -08:00
committed by Phillip Webb
parent b6e87cee35
commit 8599e5a986
19 changed files with 30 additions and 31 deletions

View File

@@ -153,7 +153,7 @@ class AssertProviderApplicationContextInvocationHandler implements InvocationHan
private ApplicationContext getStartedApplicationContext() {
if (this.startupFailure != null) {
throw new IllegalStateException(toString() + " failed to start", this.startupFailure);
throw new IllegalStateException(this + " failed to start", this.startupFailure);
}
return this.applicationContext;
}

View File

@@ -956,7 +956,7 @@ public class TestRestTemplate {
private URI applyRootUriIfNecessary(URI uri) {
UriTemplateHandler uriTemplateHandler = this.restTemplate.getUriTemplateHandler();
if ((uriTemplateHandler instanceof RootUriTemplateHandler rootHandler) && uri.toString().startsWith("/")) {
return URI.create(rootHandler.getRootUri() + uri.toString());
return URI.create(rootHandler.getRootUri() + uri);
}
return uri;
}