Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f83c032e6bc1
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 11aad5b0d5c1
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Aug 11, 2016

  1. Explicitly close input stream in CompoundJarURLStreamHandler

    This commit ensures that the stream which is opened for a `URL` within
    `CompoundJarURLStreamHandler` is explicitly closed before it falls out
    of scope.  Previously, the stream would still eventually be closed but
    only after Garbage Collection.
    camlow325 committed Aug 11, 2016
    Copy the full SHA
    d9b9a19 View commit details
  2. Merge pull request #4063 from camlow325/explicitly-close-jar-handler-…

    …stream-when-done-using
    
    Explicitly close input stream in CompoundJarURLStreamHandler
    kares authored Aug 11, 2016
    Copy the full SHA
    11aad5b View commit details
Showing with 3 additions and 5 deletions.
  1. +3 −5 core/src/main/java/org/jruby/util/CompoundJarURLStreamHandler.java
Original file line number Diff line number Diff line change
@@ -155,13 +155,11 @@ public InputStream getInputStream() throws IOException {
try {
result = openEntryWithCache(path, baseInputStream, 1);
} catch (IOException ex) {
close(baseInputStream);

throw ex;
} catch (RuntimeException ex) {
close(baseInputStream);

throw ex;
} finally {
close(baseInputStream);
}
} else {
result = baseInputStream;
@@ -179,4 +177,4 @@ public InputStream getInputStream() throws IOException {
protected URLConnection openConnection(URL url) throws IOException {
return new CompoundJarURLConnection(url);
}
}
}