#vulnerable code 
                                void store(CipherInputStream is, byte[] checksum) throws IOException {
        store.outputStream(checksum)
                .<IORunnable>map(u -> () -> {
                    logger.debug("-- store() - copying chunk into store: 0x{}", Hex.toHexString(checksum));
                    copy(is, u);
                })
                .orElse(() -> {
                    logger.debug("-- store() - store now contains chunk: 0x{}", Hex.toHexString(checksum));
                })
                .run();
    } 
                            #location 10 
                            #vulnerability type INTERFACE_NOT_THREAD_SAFE
#fixed code
                                Optional<Chunk> chunk(InputStream inputStream, ChunkServer.ChunkInfo chunkInfo, int index) throws IOException {
        logger.trace("<< chunk() - chunkInfo: {} index: {}", chunkInfo, index);

        BoundedInputStream bis = new BoundedInputStream(inputStream, chunkInfo.getChunkLength());
        bis.setPropagateClose(false);
        Optional<Chunk> chunk = chunk(bis, chunkInfo, index);
        consume(bis);

        logger.trace(">> chunk() - chunk: {}", chunk);
        return chunk;
    }