diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassPathElement.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassPathElement.java index 99e32e0984df76..2378ecdfafb701 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassPathElement.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/ClassPathElement.java @@ -132,6 +132,7 @@ public void close() { }; default List getResources(String name) { - return List.of(getResource(name)); + ClassPathResource resource = getResource(name); + return resource == null ? List.of() : List.of(resource); } } diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/PathTreeClassPathElement.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/PathTreeClassPathElement.java index 6d005f294c424b..61bf42a4cb9a58 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/PathTreeClassPathElement.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/PathTreeClassPathElement.java @@ -113,7 +113,7 @@ public List getResources(String name) { final String sanitized = sanitize(name); final Set resources = this.resources; if (resources != null && !resources.contains(sanitized)) { - return null; + return List.of(); } List ret = new ArrayList<>(); apply(tree -> { @@ -123,7 +123,7 @@ public List getResources(String name) { } }); - return null; + return List.of(); }); return ret; }