AbstractFileResolvingResource.exists closes JAR resource input streams with v6.2.7 #34955
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Calling
org.springframework.core.io.Resource#exists
is called on a resource inside a JAR file (actuallyorg.springframework.core.io.AbstractFileResolvingResource#exists
in such cases), an input stream of whether the same or another resource in the same JAR file is (accidentally) closed. Trying to read (or continue reading) from such an input stream afterwards results in anjava.io.IOException: Stream closed
. Theexist
method should just answer it's intended question, but it should never change the state of an input stream.This issue was introduced with v6.2.7, apparently with the fix for #34796.
I've created a small test project that shows some different combinations of resource reading along with
exists
checks: jar-resource-loader-test.zipThe text was updated successfully, but these errors were encountered: