throws TransportException {
verifyPrerequisites();
try {
- ObjectInserter ins = transport.local.newObjectInserter();
- try {
+ try (ObjectInserter ins = transport.local.newObjectInserter()) {
PackParser parser = ins.newPackParser(bin);
parser.setAllowThin(true);
parser.setObjectChecker(transport.getObjectChecker());
parser.setLockMessage(lockMessage);
packLock = parser.parse(NullProgressMonitor.INSTANCE);
ins.flush();
- } finally {
- ins.release();
}
} catch (IOException err) {
close();
if (prereqs.isEmpty())
return;
- final RevWalk rw = new RevWalk(transport.local);
- try {
+ try (final RevWalk rw = new RevWalk(transport.local)) {
final RevFlag PREREQ = rw.newFlag("PREREQ"); //$NON-NLS-1$
final RevFlag SEEN = rw.newFlag("SEEN"); //$NON-NLS-1$
throw new MissingBundlePrerequisiteException(transport.uri,
missing);
}
- } finally {
- rw.release();
}
}