* the object store cannot be accessed.
*/
public boolean has(final AnyObjectId objectId) throws IOException {
- final ObjectReader or = newReader();
- try {
+ try (final ObjectReader or = newReader()) {
return or.has(objectId);
- } finally {
- or.release();
}
}
public ObjectLoader open(AnyObjectId objectId, int typeHint)
throws MissingObjectException, IncorrectObjectTypeException,
IOException {
- final ObjectReader or = newReader();
- try {
+ try (final ObjectReader or = newReader()) {
return or.open(objectId, typeHint);
- } finally {
- or.release();
}
}