#vulnerable code 
                                public boolean consume(HttpServletRequest httpRequest,
                           HttpServletResponse httpResponse) throws IOException {

        if (staticResourceHandlers != null) {
            for (AbstractResourceHandler staticResourceHandler : staticResourceHandlers) {
                AbstractFileResolvingResource resource = staticResourceHandler.getResource(httpRequest);
                if (resource != null && resource.isReadable()) {
                    OutputStream wrappedOutputStream = GzipUtils.checkAndWrap(httpRequest, httpResponse, false);
                    customHeaders.forEach(httpResponse::setHeader); //add all user-defined headers to response
                    IOUtils.copy(resource.getInputStream(), wrappedOutputStream);
                    wrappedOutputStream.flush();
                    wrappedOutputStream.close();
                    return true;
                }
            }
        }

        return false;
    } 
                            #location 5 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public boolean consume(HttpServletRequest httpRequest,
                           HttpServletResponse httpResponse) throws IOException {

        if (consumeWithFileResourceHandlers(httpRequest, httpResponse)) {
            return true;
        }

        if (consumeWithJarResourceHandler(httpRequest, httpResponse)) {
            return true;
        }

        return false;
    }