diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2015-04-11 00:21:39 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2015-05-21 02:05:45 +0200 |
commit | 686124bec32fcdee1545e7d9c312dcf0276b44af (patch) | |
tree | cd98b171d3b97de6972bf1f606f34d72eaf5fa12 /org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt | |
parent | 0e73d395061d1bfee365acaa2f79c392175d13bf (diff) | |
download | jgit-686124bec32fcdee1545e7d9c312dcf0276b44af.tar.gz jgit-686124bec32fcdee1545e7d9c312dcf0276b44af.zip |
Replace deprecated release() methods by close()
See the discussion [1] in the Gerrit mailing list.
[1] https://groups.google.com/forum/#!topic/repo-discuss/RRQT_xCqz4o
Change-Id: I2c67384309c5c2e8511a7d0d4e088b4e95f819ff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java index 087dbb0679..229fb67b0c 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java @@ -125,8 +125,7 @@ public class AbstractTreeIteratorHandler extends throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); - final ObjectReader curs = clp.getRepository().newObjectReader(); - try { + try (ObjectReader curs = clp.getRepository().newObjectReader()) { p.reset(curs, clp.getRevWalk().parseTree(id)); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); @@ -134,8 +133,6 @@ public class AbstractTreeIteratorHandler extends throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); - } finally { - curs.release(); } setter.addValue(p); |