File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
src/main/java/org/sonarqube/gradle Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 2929import java .util .LinkedHashSet ;
3030import java .util .List ;
3131import java .util .Map ;
32+ import java .util .Objects ;
3233import java .util .Optional ;
3334import java .util .Set ;
3435import java .util .regex .Pattern ;
3536import java .util .stream .Collectors ;
37+ import java .util .stream .Stream ;
3638import java .util .stream .StreamSupport ;
3739import javax .annotation .Nullable ;
3840import org .gradle .api .Project ;
@@ -409,19 +411,7 @@ public static String constructPrefixedProjectName(String projectPath) {
409411 * Returns the collection of Java and Java FX runtime jars, if available.
410412 */
411413 public static Collection <File > getRuntimeJars () {
412- List <File > libraries = new ArrayList <>(2 );
413-
414- File runtimeJar = getRuntimeJar ();
415- if (runtimeJar != null ) {
416- libraries .add (runtimeJar );
417- }
418-
419- File fxRuntimeJar = getFxRuntimeJar ();
420- if (fxRuntimeJar != null ) {
421- libraries .add (fxRuntimeJar );
422- }
423-
424- return libraries ;
414+ return Stream .of (getRuntimeJar (), getFxRuntimeJar ()).filter (Objects ::nonNull ).collect (Collectors .toList ());
425415 }
426416
427417 @ Nullable
You can’t perform that action at this time.
0 commit comments