Skip to content

Commit 5354ad1

Browse files
committed
Merge branch '3.1.x'
Closes gh-38877
2 parents e1b1a62 + ae79a7c commit 5354ad1

File tree

45 files changed

+69
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+69
-71
lines changed

buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void checkArchitecture() throws IOException {
8989
if (!violations.isEmpty()) {
9090
StringBuilder report = new StringBuilder();
9191
for (EvaluationResult violation : violations) {
92-
report.append(violation.getFailureReport().toString());
92+
report.append(violation.getFailureReport());
9393
report.append(String.format("%n"));
9494
}
9595
Files.writeString(outputFile.toPath(), report.toString(), StandardOpenOption.CREATE,

buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private Provider<AutoConfigurationImports> autoConfigurationImports(Project proj
154154
});
155155
}
156156

157-
private static record AutoConfigurationImports(Path importsFile, List<String> imports) {
157+
private record AutoConfigurationImports(Path importsFile, List<String> imports) {
158158

159159
}
160160

buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private void addClassifiedManagedDependencies(Node dependencyManagement) {
221221
.collect(Collectors.toSet());
222222
Node target = dependency;
223223
for (String classifier : classifiers) {
224-
if (classifier.length() > 0) {
224+
if (!classifier.isEmpty()) {
225225
if (target == null) {
226226
target = new Node(null, "dependency");
227227
target.appendNode("groupId", groupId);

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/MavenMetadataVersionResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private URI normalize(URI uri) {
6969
if ("/".equals(uri.getPath())) {
7070
return uri;
7171
}
72-
return URI.create(uri.toString() + "/");
72+
return URI.create(uri + "/");
7373
}
7474

7575
@Override

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static class TestPathMatcher implements PathMapper {
125125
@Override
126126
public String getRootPath(EndpointId endpointId) {
127127
if (endpointId.toString().endsWith("one")) {
128-
return "1/" + endpointId.toString();
128+
return "1/" + endpointId;
129129
}
130130
return null;
131131
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,8 @@ private void assertNoDuplicateOperations(EndpointBean endpointBean, MultiValueMa
234234
String extensionBeanNames = extensions.stream()
235235
.map(ExtensionBean::getBeanName)
236236
.collect(Collectors.joining(", "));
237-
throw new IllegalStateException("Unable to map duplicate endpoint operations: " + duplicates.toString()
238-
+ " to " + endpointBean.getBeanName()
239-
+ (extensions.isEmpty() ? "" : " (" + extensionBeanNames + ")"));
237+
throw new IllegalStateException("Unable to map duplicate endpoint operations: " + duplicates + " to "
238+
+ endpointBean.getBeanName() + (extensions.isEmpty() ? "" : " (" + extensionBeanNames + ")"));
240239
}
241240
}
242241

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private Object getContributor(String[] path, int pathOffset) {
127127
private String getName(String[] path, int pathOffset) {
128128
StringBuilder name = new StringBuilder();
129129
while (pathOffset < path.length) {
130-
name.append((name.length() != 0) ? "/" : "");
130+
name.append((!name.isEmpty()) ? "/" : "");
131131
name.append(path[pathOffset]);
132132
pathOffset++;
133133
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ private String createOnBeanNoMatchReason(MatchResult matchResult) {
332332

333333
private void appendMessageForNoMatches(StringBuilder reason, Collection<String> unmatched, String description) {
334334
if (!unmatched.isEmpty()) {
335-
if (reason.length() > 0) {
335+
if (!reason.isEmpty()) {
336336
reason.append(" and ");
337337
}
338338
reason.append("did not find any beans ");
@@ -347,7 +347,7 @@ private String createOnMissingBeanNoMatchReason(MatchResult matchResult) {
347347
appendMessageForMatches(reason, matchResult.getMatchedAnnotations(), "annotated with");
348348
appendMessageForMatches(reason, matchResult.getMatchedTypes(), "of type");
349349
if (!matchResult.getMatchedNames().isEmpty()) {
350-
if (reason.length() > 0) {
350+
if (!reason.isEmpty()) {
351351
reason.append(" and ");
352352
}
353353
reason.append("found beans named ");
@@ -360,7 +360,7 @@ private void appendMessageForMatches(StringBuilder reason, Map<String, Collectio
360360
String description) {
361361
if (!matches.isEmpty()) {
362362
matches.forEach((key, value) -> {
363-
if (reason.length() > 0) {
363+
if (!reason.isEmpty()) {
364364
reason.append(" and ");
365365
}
366366
reason.append("found beans ");

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsHomePropertiesPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected File getHomeDirectory() {
144144
}
145145

146146
@SafeVarargs
147-
private final File getHomeDirectory(Supplier<String>... pathSuppliers) {
147+
private File getHomeDirectory(Supplier<String>... pathSuppliers) {
148148
for (Supplier<String> pathSupplier : pathSuppliers) {
149149
String path = pathSupplier.get();
150150
if (StringUtils.hasText(path)) {

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/AssertProviderApplicationContextInvocationHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private Object invokeApplicationContextMethod(Method method, Object[] args) thro
153153

154154
private ApplicationContext getStartedApplicationContext() {
155155
if (this.startupFailure != null) {
156-
throw new IllegalStateException(toString() + " failed to start", this.startupFailure);
156+
throw new IllegalStateException(this + " failed to start", this.startupFailure);
157157
}
158158
return this.applicationContext;
159159
}

0 commit comments

Comments
 (0)