]> source.dussan.org Git - jgit.git/commitdiff
Simplify exception handling in RevWalk#iterator 60/132160/1
authorJonathan Nieder <jrn@google.com>
Fri, 9 Nov 2018 01:55:19 +0000 (17:55 -0800)
committerJonathan Nieder <jrn@google.com>
Fri, 9 Nov 2018 01:55:19 +0000 (17:55 -0800)
MissingObjectException and IncorrectObjectTypeException are subclasses
of IOException.

Change-Id: Ib4e1f37ce1b0b08e69ba3375bbdb6ee82ee4f036
Signed-off-by: Jonathan Nieder <jrn@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java

index 4d555d21789013e3cecce9119f360b7806ca2ffa..a42721afafe37f9af1d3c66139c4eb1a5aa5d1ff 100644 (file)
@@ -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);
                                }