Skip to content

Commit 3dba0d7

Browse files
committed
Polish
See gh-37878
1 parent dbc06fa commit 3dba0d7

File tree

1 file changed

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

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.gradle.api.internal.file.copy.CopyActionProcessingStream;
4545
import org.gradle.api.java.archives.Attributes;
4646
import org.gradle.api.java.archives.Manifest;
47-
import org.gradle.api.provider.Provider;
4847
import org.gradle.api.specs.Spec;
4948
import org.gradle.api.tasks.WorkResult;
5049
import org.gradle.api.tasks.WorkResults;
@@ -417,15 +416,11 @@ private int getFileMode(FileCopyDetails details) {
417416
: UnixStat.FILE_FLAG | getPermissions(details);
418417
}
419418

420-
@SuppressWarnings("unchecked")
421419
private int getPermissions(FileCopyDetails details) {
422420
if (GradleVersion.current().compareTo(GradleVersion.version("8.3")) >= 0) {
423421
try {
424-
Object permissions = ((Provider<Object>) details.getClass()
425-
.getMethod("getPermissions")
426-
.invoke(details)).get();
427-
return ((Provider<Integer>) permissions.getClass().getMethod("toUnixNumeric").invoke(permissions))
428-
.get();
422+
Object permissions = details.getClass().getMethod("getPermissions").invoke(details);
423+
return (int) permissions.getClass().getMethod("toUnixNumeric").invoke(permissions);
429424
}
430425
catch (Exception ex) {
431426
throw new GradleException("Failed to get permissions", ex);

0 commit comments

Comments
 (0)