Skip to content

Commit f9f530d

Browse files
committed
Remove method references to improve compatibility
The use of method references requires the referenced method to be present even if it isn't called. This made it impossible for Gradle to remove the deprecated methods as it would break our plugin. By switching the lambdas, the methods only have to be present when they're called which will only happen with Gradle 8.2 and earlier. Closes gh-41599
1 parent 7161f92 commit f9f530d

File tree

1 file changed

+3
-3
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling

1 file changed

+3
-3
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 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.
@@ -150,11 +150,11 @@ CopyAction createCopyAction(Jar jar, ResolvedDependencies resolvedDependencies,
150150
}
151151

152152
private Integer getDirMode(CopySpec copySpec) {
153-
return getMode(copySpec, "getDirPermissions", copySpec::getDirMode);
153+
return getMode(copySpec, "getDirPermissions", () -> copySpec.getDirMode());
154154
}
155155

156156
private Integer getFileMode(CopySpec copySpec) {
157-
return getMode(copySpec, "getFilePermissions", copySpec::getFileMode);
157+
return getMode(copySpec, "getFilePermissions", () -> copySpec.getFileMode());
158158
}
159159

160160
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)