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 a76d68963b328..0e319d437e7b7 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 @@ -144,6 +144,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 5d6ca6c91855e..a1da4f0e74114 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; }