]> source.dussan.org Git - jgit.git/commitdiff
Fix ObjectReader resources leak 93/47993/1
authorHugo Arès <hugo.ares@ericsson.com>
Fri, 15 May 2015 19:15:28 +0000 (15:15 -0400)
committerHugo Arès <hugo.ares@ericsson.com>
Fri, 15 May 2015 20:10:49 +0000 (16:10 -0400)
In 77030a5e, AutoClosable was implemented on classes that use release().
This caused a resource leak because the ObjectReader.close method  was
not calling the now deprecated release method, which is the method that
sub classes implements to release resources.

Change-Id: I247651ec8fd7ca9941d256ca46d14cc43cc35c6e
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java

index 4c4e53455f1f06b02f6538725920b7093fdab32b..f686c419a45be3e4255c01c45029e2cf522d2c78 100644 (file)
@@ -429,7 +429,7 @@ public abstract class ObjectReader implements AutoCloseable {
         */
        @Deprecated
        public void release() {
-               close();
+               // Do nothing.
        }
 
        /**
@@ -442,6 +442,6 @@ public abstract class ObjectReader implements AutoCloseable {
         */
        @Override
        public void close() {
-               // Do nothing.
+               release();
        }
 }