Skip to content

Commit 99f5c78

Browse files
committed
Merge branch '2.5.x' into 2.6.x
2 parents f395cfa + 350d27f commit 99f5c78

File tree

14 files changed

+37
-43
lines changed

14 files changed

+37
-43
lines changed

buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private void upgradeAsciidoctorJVersion(Project project) {
106106
private void createAsciidoctorExtensionsConfiguration(Project project) {
107107
project.getConfigurations().create(EXTENSIONS_CONFIGURATION_NAME, (configuration) -> {
108108
project.getConfigurations().matching((candidate) -> "dependencyManagement".equals(candidate.getName()))
109-
.all((dependencyManagement) -> configuration.extendsFrom(dependencyManagement));
109+
.all(configuration::extendsFrom);
110110
configuration.getDependencies().add(project.getDependencies()
111111
.create("io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.3"));
112112
configuration.getDependencies()

buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -43,18 +43,14 @@ public void apply(Project project) {
4343
project.getPlugins().apply(MavenRepositoryPlugin.class);
4444
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
4545
MavenPublication mavenPublication = publishing.getPublications().create("maven", MavenPublication.class);
46-
project.afterEvaluate((evaluated) -> {
47-
project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> {
48-
if (((Jar) project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME)).isEnabled()) {
49-
project.getComponents().matching((component) -> component.getName().equals("java"))
50-
.all((javaComponent) -> mavenPublication.from(javaComponent));
51-
}
52-
});
53-
});
54-
project.getPlugins().withType(JavaPlatformPlugin.class)
55-
.all((javaPlugin) -> project.getComponents()
56-
.matching((component) -> component.getName().equals("javaPlatform"))
57-
.all((javaComponent) -> mavenPublication.from(javaComponent)));
46+
project.afterEvaluate((evaluated) -> project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> {
47+
if (((Jar) project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME)).isEnabled()) {
48+
project.getComponents().matching((component) -> component.getName().equals("java"))
49+
.all(mavenPublication::from);
50+
}
51+
}));
52+
project.getPlugins().withType(JavaPlatformPlugin.class).all((javaPlugin) -> project.getComponents()
53+
.matching((component) -> component.getName().equals("javaPlatform")).all(mavenPublication::from));
5854
}
5955

6056
}

buildSrc/src/main/java/org/springframework/boot/build/ExtractResources.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -28,7 +28,6 @@
2828

2929
import org.gradle.api.DefaultTask;
3030
import org.gradle.api.GradleException;
31-
import org.gradle.api.Task;
3231
import org.gradle.api.file.DirectoryProperty;
3332
import org.gradle.api.tasks.Input;
3433
import org.gradle.api.tasks.OutputDirectory;
@@ -87,8 +86,7 @@ void extractResources() throws IOException {
8786
throw new GradleException("Resource '" + resourceName + "' does not exist");
8887
}
8988
String resource = FileCopyUtils.copyToString(new InputStreamReader(resourceStream, StandardCharsets.UTF_8));
90-
resource = this.propertyPlaceholderHelper.replacePlaceholders(resource,
91-
(placeholder) -> this.properties.get(placeholder));
89+
resource = this.propertyPlaceholderHelper.replacePlaceholders(resource, this.properties::get);
9290
FileCopyUtils.copy(resource,
9391
new FileWriter(this.destinationDirectory.file(resourceName).get().getAsFile()));
9492
}

buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -159,8 +159,8 @@ private void configureTestConventions(Project project) {
159159
project.getTasks().withType(Test.class, (test) -> {
160160
test.useJUnitPlatform();
161161
test.setMaxHeapSize("1024M");
162-
project.getTasks().withType(Checkstyle.class, (checkstyle) -> test.mustRunAfter(checkstyle));
163-
project.getTasks().withType(CheckFormat.class, (checkFormat) -> test.mustRunAfter(checkFormat));
162+
project.getTasks().withType(Checkstyle.class, test::mustRunAfter);
163+
project.getTasks().withType(CheckFormat.class, test::mustRunAfter);
164164
});
165165
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> project.getDependencies()
166166
.add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.platform:junit-platform-launcher"));

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -24,6 +24,7 @@
2424
import java.util.LinkedHashMap;
2525
import java.util.List;
2626
import java.util.Map;
27+
import java.util.Objects;
2728
import java.util.Set;
2829
import java.util.SortedSet;
2930
import java.util.stream.Collectors;
@@ -70,7 +71,7 @@ public List<Upgrade> resolveUpgrades(Collection<Library> libraries) {
7071
librariesByName.put(library.getName(), library);
7172
}
7273
return libraries.stream().filter((library) -> !library.getName().equals("Spring Boot"))
73-
.map((library) -> resolveUpgrade(library, librariesByName)).filter((upgrade) -> upgrade != null)
74+
.map((library) -> resolveUpgrade(library, librariesByName)).filter(Objects::nonNull)
7475
.collect(Collectors.toList());
7576
}
7677

buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForConflicts.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -68,7 +68,7 @@ public void checkForConflicts() throws IOException {
6868
for (File file : this.classpath) {
6969
if (file.isDirectory()) {
7070
Path root = file.toPath();
71-
Files.walk(root).filter((path) -> Files.isRegularFile(path))
71+
Files.walk(root).filter(Files::isRegularFile)
7272
.forEach((entry) -> classpathContents.add(root.relativize(entry).toString(), root.toString()));
7373
}
7474
else {

spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsR2dbcAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -63,7 +63,7 @@ void reset() {
6363

6464
@Test
6565
void autoConfiguredInMemoryConnectionFactoryIsShutdown() throws Exception {
66-
ConfigurableApplicationContext context = getContext(() -> createContext());
66+
ConfigurableApplicationContext context = getContext(this::createContext);
6767
ConnectionFactory connectionFactory = context.getBean(ConnectionFactory.class);
6868
context.close();
6969
assertThat(shutdowns).contains(connectionFactory);

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private TaskProvider<BootWar> configureBootWarTask(Project project) {
9191
.convention(resolveMainClassName.flatMap((resolver) -> manifestStartClass.isPresent()
9292
? manifestStartClass : resolveMainClassName.get().readMainClassName()));
9393
});
94-
bootWarProvider.map((bootWar) -> bootWar.getClasspath());
94+
bootWarProvider.map(War::getClasspath);
9595
return bootWarProvider;
9696
}
9797

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -56,7 +56,7 @@ public class EnvironmentPostProcessorApplicationListener implements SmartApplica
5656
* {@link EnvironmentPostProcessor} classes loaded via {@code spring.factories}.
5757
*/
5858
public EnvironmentPostProcessorApplicationListener() {
59-
this((classLoader) -> EnvironmentPostProcessorsFactory.fromSpringFactories(classLoader), new DeferredLogs());
59+
this(EnvironmentPostProcessorsFactory::fromSpringFactories, new DeferredLogs());
6060
}
6161

6262
/**

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -398,8 +398,7 @@ private static <T extends DataSource> MappedDataSourceProperties<T> lookupBasic(
398398
Class<T> dataSourceType) {
399399
MappedDataSourceProperties<T> result = null;
400400
result = lookup(classLoader, dataSourceType, result,
401-
"org.springframework.jdbc.datasource.SimpleDriverDataSource",
402-
() -> new SimpleDataSourceProperties());
401+
"org.springframework.jdbc.datasource.SimpleDriverDataSource", SimpleDataSourceProperties::new);
403402
result = lookup(classLoader, dataSourceType, result, "oracle.jdbc.datasource.OracleDataSource",
404403
OracleDataSourceProperties::new);
405404
result = lookup(classLoader, dataSourceType, result, "org.h2.jdbcx.JdbcDataSource",
@@ -660,7 +659,7 @@ private static class SimpleDataSourceProperties extends MappedDataSourceProperti
660659
SimpleDataSourceProperties() {
661660
add(DataSourceProperty.URL, SimpleDriverDataSource::getUrl, SimpleDriverDataSource::setUrl);
662661
add(DataSourceProperty.DRIVER_CLASS_NAME, Class.class, (dataSource) -> dataSource.getDriver().getClass(),
663-
(dataSource, driverClass) -> dataSource.setDriverClass(driverClass));
662+
SimpleDriverDataSource::setDriverClass);
664663
add(DataSourceProperty.USERNAME, SimpleDriverDataSource::getUsername, SimpleDriverDataSource::setUsername);
665664
add(DataSourceProperty.PASSWORD, SimpleDriverDataSource::getPassword, SimpleDriverDataSource::setPassword);
666665
}

0 commit comments

Comments
 (0)