summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2016-01-20 07:41:08 -0800
committerShawn Pearce <spearce@spearce.org>2016-01-20 07:41:08 -0800
commit2262a794b48ea866d1de2a6a44b79accb8224a27 (patch)
treeb6c6b7384a4f9314c39b038cbe98b1990bc2192a /org.eclipse.jgit
parenta01d6c1e55093529aaddc54bb6082a818f0956c6 (diff)
downloadjgit-2262a794b48ea866d1de2a6a44b79accb8224a27.tar.gz
jgit-2262a794b48ea866d1de2a6a44b79accb8224a27.zip
TreeWalk: Remove CorruptObjectException from addTree(AbstractTreeIterator)
This form of addTree() does not parse any objects and cannot throw the declared checked exception. Callers are being forced to try-catch CorruptObjectException that cannot occur when the iterator instance has already been constructed. Change-Id: Id338035302903bab81569d1576eab063eee0885a
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
index 83fada4f95..5cd713da78 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
@@ -574,18 +574,13 @@ public class TreeWalk implements AutoCloseable, AttributesProvider {
* @param p
* an iterator to walk over. The iterator should be new, with no
* parent, and should still be positioned before the first entry.
- * The tree which the iterator operates on must have the same root
- * as other trees in the walk.
- *
+ * The tree which the iterator operates on must have the same
+ * root as other trees in the walk.
* @return position of this tree within the walker.
- * @throws CorruptObjectException
- * the iterator was unable to obtain its first entry, due to
- * possible data corruption within the backing data store.
*/
- public int addTree(final AbstractTreeIterator p)
- throws CorruptObjectException {
- final int n = trees.length;
- final AbstractTreeIterator[] newTrees = new AbstractTreeIterator[n + 1];
+ public int addTree(AbstractTreeIterator p) {
+ int n = trees.length;
+ AbstractTreeIterator[] newTrees = new AbstractTreeIterator[n + 1];
System.arraycopy(trees, 0, newTrees, 0, n);
newTrees[n] = p;