Skip to content

Commit d107f34

Browse files
committed
Merge branch '4.0.x' into 4.1.x
Closes gh-51104
2 parents e42c01e + 38e03cf commit d107f34

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ClassPath.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.util.Collections;
3030
import java.util.List;
3131
import java.util.Locale;
32-
import java.util.function.UnaryOperator;
32+
import java.util.function.Function;
3333
import java.util.stream.Collector;
3434
import java.util.stream.Collectors;
3535

@@ -123,16 +123,16 @@ static ClassPath of(List<URL> urls) {
123123

124124
/**
125125
* Factory method to create a {@link ClassPath} of the given URLs.
126-
* @param getSystemProperty {@link UnaryOperator} allowing access to system properties
126+
* @param getSystemProperty {@link Function} allowing access to system properties
127127
* @param urls the class path URLs
128128
* @return a new {@link ClassPath} instance
129129
*/
130-
static ClassPath of(UnaryOperator<@Nullable String> getSystemProperty, List<URL> urls) {
130+
static ClassPath of(Function<String, @Nullable String> getSystemProperty, List<URL> urls) {
131131
boolean preferArgFile = urls.size() > 1 && isWindows(getSystemProperty);
132132
return new ClassPath(preferArgFile, urls.stream().map(ClassPath::toPathString).collect(JOIN_BY_PATH_SEPARATOR));
133133
}
134134

135-
private static boolean isWindows(UnaryOperator<@Nullable String> getSystemProperty) {
135+
private static boolean isWindows(Function<String, @Nullable String> getSystemProperty) {
136136
String os = getSystemProperty.apply("os.name");
137137
return StringUtils.hasText(os) && os.toLowerCase(Locale.ROOT).contains("win");
138138
}

build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ClassPathTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import java.util.Collections;
2323
import java.util.List;
2424
import java.util.Map;
25-
import java.util.function.UnaryOperator;
25+
import java.util.function.Function;
2626

2727
import org.jspecify.annotations.Nullable;
2828
import org.junit.jupiter.api.Test;
@@ -94,11 +94,11 @@ void toStringShouldReturnClassPath(@TempDir Path temp) throws Exception {
9494
assertThat(classPath.toString()).isEqualTo(path1 + File.pathSeparator + path2);
9595
}
9696

97-
private UnaryOperator<@Nullable String> onWindows() {
97+
private Function<String, @Nullable String> onWindows() {
9898
return Map.of("os.name", "windows")::get;
9999
}
100100

101-
private UnaryOperator<@Nullable String> onLinux() {
101+
private Function<String, @Nullable String> onLinux() {
102102
return Map.of("os.name", "linux")::get;
103103
}
104104

0 commit comments

Comments
 (0)