Is JDK ClassLoader.getResourceAsStream broken? (unclosed resources)
I will try to prove that ClassLoader.getResourceAsStream() is opening two InputStreams , closing none of it and returning only one to client. Is my logic correct? JDK sources are picked from jdk1.8.0_25 I've get into unclosed resources problem using Spring ClassPathResource in interval ( original question ), that is using ClassLoader.getResourceAsStream to get InputStream to a properties file. After investigation, I found that classLoader.getResourceAsStream is getting an URL by URL url = getResource(name); and then it is opening that stream, but URL url = getResource(name) already opens that