From 06f08d88c2feb2d2e44da2a76df77efc07a8a502 Mon Sep 17 00:00:00 2001 From: Piyal Ahmed Date: Tue, 20 Aug 2024 13:03:59 +0600 Subject: [PATCH 1/3] replace lambda with method reference --- .../boot/build/mavenplugin/MavenPluginPlugin.java | 3 ++- .../boot/gradle/tasks/bundling/BootArchiveSupport.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java index 09eb5d333d45..689d13e6f219 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java @@ -55,6 +55,7 @@ import org.gradle.api.attributes.DocsType; import org.gradle.api.attributes.Usage; import org.gradle.api.component.AdhocComponentWithVariants; +import org.gradle.api.component.ConfigurationVariantDetails; import org.gradle.api.component.SoftwareComponent; import org.gradle.api.file.CopySpec; import org.gradle.api.file.DirectoryProperty; @@ -132,7 +133,7 @@ private void publishOptionalDependenciesInPom(Project project) { if (component instanceof AdhocComponentWithVariants componentWithVariants) { componentWithVariants.addVariantsFromConfiguration( project.getConfigurations().getByName(OptionalDependenciesPlugin.OPTIONAL_CONFIGURATION_NAME), - (variant) -> variant.mapToOptional()); + ConfigurationVariantDetails::mapToOptional); } }); MavenPublication publication = (MavenPublication) project.getExtensions() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java index 6cdd36d5f2a4..23cf11417560 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java @@ -150,11 +150,11 @@ CopyAction createCopyAction(Jar jar, ResolvedDependencies resolvedDependencies, } private Integer getDirMode(CopySpec copySpec) { - return getMode(copySpec, "getDirPermissions", () -> copySpec.getDirMode()); + return getMode(copySpec, "getDirPermissions", copySpec::getDirMode); } private Integer getFileMode(CopySpec copySpec) { - return getMode(copySpec, "getFilePermissions", () -> copySpec.getFileMode()); + return getMode(copySpec, "getFilePermissions", copySpec::getFileMode); } @SuppressWarnings("unchecked") From 1df2804560270e28e91af1b50db346fd82774cef Mon Sep 17 00:00:00 2001 From: Piyal Ahmed Date: Tue, 20 Aug 2024 13:04:21 +0600 Subject: [PATCH 2/3] fix typo: compatibilty --- .../boot/autoconfigure/flyway/FlywayAutoConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java index 36a732624102..d04d240f5eb6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java @@ -227,7 +227,7 @@ private void applyConnectionDetails(FlywayConnectionDetails connectionDetails, D */ private void configureProperties(FluentConfiguration configuration, FlywayProperties properties) { // NOTE: Using method references in the mapper methods can break - // back-compatibilty (see gh-38164) + // back-compatibility (see gh-38164) PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); String[] locations = new LocationResolver(configuration.getDataSource()) .resolveLocations(properties.getLocations()) From b518f159de59d027b1f8435bcf0a4581419bcf60 Mon Sep 17 00:00:00 2001 From: Piyal Ahmed Date: Tue, 20 Aug 2024 14:01:55 +0600 Subject: [PATCH 3/3] revert changes to use lambda instead of method reference for compatibility --- .../boot/gradle/tasks/bundling/BootArchiveSupport.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java index 23cf11417560..6cdd36d5f2a4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java @@ -150,11 +150,11 @@ CopyAction createCopyAction(Jar jar, ResolvedDependencies resolvedDependencies, } private Integer getDirMode(CopySpec copySpec) { - return getMode(copySpec, "getDirPermissions", copySpec::getDirMode); + return getMode(copySpec, "getDirPermissions", () -> copySpec.getDirMode()); } private Integer getFileMode(CopySpec copySpec) { - return getMode(copySpec, "getFilePermissions", copySpec::getFileMode); + return getMode(copySpec, "getFilePermissions", () -> copySpec.getFileMode()); } @SuppressWarnings("unchecked")