diff options
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java | 56 |
1 files changed, 6 insertions, 50 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java index 445ff7afe2..be753bee8c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java @@ -43,12 +43,12 @@ package org.eclipse.jgit.diff; -import java.util.AbstractList; import java.util.ArrayList; -import java.util.Collection; /** Specialized list of {@link Edit}s in a document. */ -public class EditList extends AbstractList<Edit> { +public class EditList extends ArrayList<Edit> { + private static final long serialVersionUID = 1L; + /** * Construct an edit list containing a single edit. * @@ -62,11 +62,9 @@ public class EditList extends AbstractList<Edit> { return res; } - private final ArrayList<Edit> container; - /** Create a new, empty edit list. */ public EditList() { - container = new ArrayList<Edit>(); + super(16); } /** @@ -77,53 +75,11 @@ public class EditList extends AbstractList<Edit> { * added to the list, it will be grown to support them. */ public EditList(int capacity) { - container = new ArrayList<Edit>(capacity); - } - - @Override - public int size() { - return container.size(); - } - - @Override - public Edit get(final int index) { - return container.get(index); - } - - @Override - public Edit set(final int index, final Edit element) { - return container.set(index, element); - } - - @Override - public void add(final int index, final Edit element) { - container.add(index, element); - } - - @Override - public boolean addAll(Collection<? extends Edit> c) { - return container.addAll(c); - } - - @Override - public Edit remove(final int index) { - return container.remove(index); - } - - @Override - public int hashCode() { - return container.hashCode(); - } - - @Override - public boolean equals(final Object o) { - if (o instanceof EditList) - return container.equals(((EditList) o).container); - return false; + super(capacity); } @Override public String toString() { - return "EditList" + container.toString(); + return "EditList" + super.toString(); } } |