Browse Source

Simplify exception handling in RevWalk#iterator

MissingObjectException and IncorrectObjectTypeException are subclasses
of IOException.

Change-Id: Ib4e1f37ce1b0b08e69ba3375bbdb6ee82ee4f036
Signed-off-by: Jonathan Nieder <jrn@google.com>
stable-5.2
Jonathan Nieder 6 years ago
parent
commit
aeba003200
  1. 8
      org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java

8
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java

@ -1356,10 +1356,6 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable {
final RevCommit first;
try {
first = RevWalk.this.next();
} catch (MissingObjectException e) {
throw new RevWalkException(e);
} catch (IncorrectObjectTypeException e) {
throw new RevWalkException(e);
} catch (IOException e) {
throw new RevWalkException(e);
}
@ -1378,10 +1374,6 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable {
final RevCommit r = next;
next = RevWalk.this.next();
return r;
} catch (MissingObjectException e) {
throw new RevWalkException(e);
} catch (IncorrectObjectTypeException e) {
throw new RevWalkException(e);
} catch (IOException e) {
throw new RevWalkException(e);
}

Loading…
Cancel
Save