File tree Expand file tree Collapse file tree
build-plugin/spring-boot-maven-plugin/src
main/java/org/springframework/boot/maven
test/java/org/springframework/boot/maven Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import java .util .Collections ;
3030import java .util .List ;
3131import java .util .Locale ;
32- import java .util .function .UnaryOperator ;
32+ import java .util .function .Function ;
3333import java .util .stream .Collector ;
3434import 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 }
Original file line number Diff line number Diff line change 2222import java .util .Collections ;
2323import java .util .List ;
2424import java .util .Map ;
25- import java .util .function .UnaryOperator ;
25+ import java .util .function .Function ;
2626
2727import org .jspecify .annotations .Nullable ;
2828import 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
You can’t perform that action at this time.
0 commit comments