title: Findbugs "Method May Fail to Close Stream" when using getResourceAsStream
body: <p>If I have the following code in a servlet:</p>
  
  <pre><code>Properties p = new Properties();
  p.load(getClass().getResourceAsStream("/test.properties"));
  </code></pre>
  
  <p>If I run the servlet through FindBugs, I would expect to get the warning <a href="http://findbugs.sourceforge.net/bugDescriptions.html#OS_OPEN_STREAM" rel="nofollow noreferrer">OS_OPEN_STREAM</a>, but I don't. If I use a similar approach to open an arbitrary file on the filesystem (ie not in the classpath), I get the Findbugs warning as expected:</p>
  
  <pre><code>Properties p = new Properties();
  p.load(new FileInputStream(new File("c:/test.properties")));
  </code></pre>
  
  <p>In the first example, is the warning absent because Findbugs is missing a valid warning (ie I should be closing the stream in a finally block after loading into the Properties object) or is there a reason I don't need to close the stream?</p>
  
  <p>Thanks</p>
  
  <p>Rich</p>