Closed zfqjava closed 1 year ago
Should ExternalContext#getResourcePaths
be returning an empty set rather than a null?
Doc says
Return the Set of resource paths for all application resources whose resource path starts with the specified argument.
Says it will return a Set, not that it will return a null
Agreed this should return a new empty Stack if bill
This is exactly how ServletContext#getResourcePaths()
is implemented: https://jakarta.ee/specifications/platform/10/apidocs/jakarta/servlet/servletcontext#getResourcePaths(java.lang.String) The ExternalContext#getResourcePaths()
is merely a facade thereof (i.e. it isn't intended to manipulate the results of underlying delegates).
We can of course deviate from this, but this is a breaking change and should be done in a major version only. I'd for now prefer to update the javadoc of ExternalContext#getResourcePaths()
for clarity.
Note that this PR is made for master branch, not for 2.3/3.0/4.0. If this was not your original intent, adjust accordingly.
No comment a week. Merging anyway.
To backport you'll need to create a PR for the desired version.
java.lang.NullPointerException: Cannot invoke "java.util.Collection.size()" because "c" is null at java.base/java.util.ArrayDeque.addAll(ArrayDeque.java:322) at com.sun.faces.application.resource.ResourcePathsIterator.visit(ResourcePathsIterator.java:67) at com.sun.faces.application.resource.ResourcePathsIterator.tryTake(ResourcePathsIterator.java:79) at com.sun.faces.application.resource.ResourcePathsIterator.hasNext(ResourcePathsIterator.java:51)