Remove unnecessary toString() calls
See gh-38739
This commit is contained in:
committed by
Phillip Webb
parent
b6e87cee35
commit
8599e5a986
@@ -259,7 +259,7 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem implements BeanF
|
||||
for (Status status : loggerContext.getStatusManager().getCopyOfStatusList()) {
|
||||
if (status.getLevel() == Status.ERROR) {
|
||||
errors.append((!errors.isEmpty()) ? String.format("%n") : "");
|
||||
errors.append(status.toString());
|
||||
errors.append(status);
|
||||
if (status.getThrowable() != null) {
|
||||
suppressedExceptions.add(status.getThrowable());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -104,7 +104,7 @@ public class ApplicationPid {
|
||||
|
||||
private void assertCanOverwrite(File file) throws IOException {
|
||||
if (!file.canWrite() || !canWritePosixFile(file)) {
|
||||
throw new FileNotFoundException(file.toString() + " (permission denied)");
|
||||
throw new FileNotFoundException(file + " (permission denied)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -877,7 +877,7 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
|
||||
map.put("spring", "boot");
|
||||
}
|
||||
String suffix = (!resource.isProfileSpecific()) ? "" : ":ps";
|
||||
map.put(resource.toString() + suffix, "true");
|
||||
map.put(resource + suffix, "true");
|
||||
MapPropertySource propertySource = new MapPropertySource("loaded" + suffix, map);
|
||||
return new ConfigData(Collections.singleton(propertySource));
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ class StaticResourceJarsTests {
|
||||
void ignoreWildcardUrls() throws Exception {
|
||||
File jarFile = createResourcesJar("test-resources.jar");
|
||||
URL folderUrl = jarFile.getParentFile().toURI().toURL();
|
||||
URL wildcardUrl = new URL(folderUrl.toString() + "*.jar");
|
||||
URL wildcardUrl = new URL(folderUrl + "*.jar");
|
||||
List<URL> staticResourceJarUrls = new StaticResourceJars().getUrlsFrom(wildcardUrl);
|
||||
assertThat(staticResourceJarUrls).isEmpty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user