Skip to content

Commit a0089c5

Browse files
committed
Merge branch '2.7.x' into 3.0.x
2 parents 31d2886 + 46773dd commit a0089c5

File tree

6 files changed

+33
-36
lines changed

6 files changed

+33
-36
lines changed

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

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -108,31 +108,13 @@ private void applyUpgrades(GitHubRepository repository, List<String> issueLabels
108108
Issue existingUpgradeIssue = findExistingUpgradeIssue(existingUpgradeIssues, upgrade);
109109
try {
110110
Path modified = upgradeApplicator.apply(upgrade);
111-
int issueNumber;
112-
if (existingUpgradeIssue != null && existingUpgradeIssue.getState() == Issue.State.OPEN) {
113-
issueNumber = existingUpgradeIssue.getNumber();
114-
}
115-
else {
116-
issueNumber = repository.openIssue(title,
117-
(existingUpgradeIssue != null) ? "Supersedes #" + existingUpgradeIssue.getNumber() : "",
118-
issueLabels, milestone);
119-
if (existingUpgradeIssue != null && existingUpgradeIssue.getState() == Issue.State.CLOSED) {
120-
existingUpgradeIssue.label(Arrays.asList("type: task", "status: superseded"));
121-
}
122-
}
123-
if (existingUpgradeIssue != null) {
124-
if (existingUpgradeIssue.getState() == Issue.State.CLOSED) {
125-
System.out.println(" Issue: " + issueNumber + " - " + title + " (supersedes #"
126-
+ existingUpgradeIssue.getNumber() + " " + existingUpgradeIssue.getTitle() + ")");
127-
}
128-
else {
129-
System.out
130-
.println(" Issue: " + issueNumber + " - " + title + " (completes existing upgrade)");
131-
}
132-
}
133-
else {
134-
System.out.println(" Issue: " + issueNumber + " - " + title);
111+
int issueNumber = getOrOpenUpgradeIssue(repository, issueLabels, milestone, title,
112+
existingUpgradeIssue);
113+
if (existingUpgradeIssue != null && existingUpgradeIssue.getState() == Issue.State.CLOSED) {
114+
existingUpgradeIssue.label(Arrays.asList("type: task", "status: superseded"));
135115
}
116+
System.out.println(" Issue: " + issueNumber + " - " + title
117+
+ getExistingUpgradeIssueMessageDetails(existingUpgradeIssue));
136118
if (new ProcessBuilder().command("git", "add", modified.toFile().getAbsolutePath())
137119
.start()
138120
.waitFor() != 0) {
@@ -153,6 +135,25 @@ private void applyUpgrades(GitHubRepository repository, List<String> issueLabels
153135
}
154136
}
155137

138+
private int getOrOpenUpgradeIssue(GitHubRepository repository, List<String> issueLabels, Milestone milestone,
139+
String title, Issue existingUpgradeIssue) {
140+
if (existingUpgradeIssue != null && existingUpgradeIssue.getState() == Issue.State.OPEN) {
141+
return existingUpgradeIssue.getNumber();
142+
}
143+
String body = (existingUpgradeIssue != null) ? "Supersedes #" + existingUpgradeIssue.getNumber() : "";
144+
return repository.openIssue(title, body, issueLabels, milestone);
145+
}
146+
147+
private String getExistingUpgradeIssueMessageDetails(Issue existingUpgradeIssue) {
148+
if (existingUpgradeIssue == null) {
149+
return "";
150+
}
151+
if (existingUpgradeIssue.getState() != Issue.State.CLOSED) {
152+
return " (completes existing upgrade)";
153+
}
154+
return " (supersedes #" + existingUpgradeIssue.getNumber() + " " + existingUpgradeIssue.getTitle() + ")";
155+
}
156+
156157
private List<String> verifyLabels(GitHubRepository repository) {
157158
Set<String> availableLabels = repository.getLabels();
158159
List<String> issueLabels = this.bom.getUpgrade().getGitHub().getIssueLabels();

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherApplicationRunner.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,11 @@ public JobLauncherApplicationRunner(JobLauncher jobLauncher, JobExplorer jobExpl
113113

114114
@Override
115115
public void afterPropertiesSet() {
116-
if (this.jobs.size() > 1 && !StringUtils.hasText(this.jobName)) {
117-
throw new IllegalArgumentException("Job name must be specified in case of multiple jobs");
118-
}
116+
Assert.isTrue(this.jobs.size() <= 1 || StringUtils.hasText(this.jobName),
117+
"Job name must be specified in case of multiple jobs");
119118
if (StringUtils.hasText(this.jobName)) {
120-
if (!isLocalJob(this.jobName) && !isRegisteredJob(this.jobName)) {
121-
throw new IllegalArgumentException("No job found with name '" + this.jobName + "'");
122-
}
119+
Assert.isTrue(isLocalJob(this.jobName) || isRegisteredJob(this.jobName),
120+
() -> "No job found with name '" + this.jobName + "'");
123121
}
124122
}
125123

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/ssl/KeyStoreFactoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,7 @@ private void reportConfigurationErrorsIfNecessary(LoggerContext loggerContext) {
267267
}
268268
IllegalStateException ex = new IllegalStateException(
269269
String.format("Logback configuration error detected: %n%s", errors));
270-
for (Throwable suppressedException : suppressedExceptions) {
271-
ex.addSuppressed(suppressedException);
272-
}
270+
suppressedExceptions.forEach(ex::addSuppressed);
273271
throw ex;
274272
}
275273

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)