diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java index 7c27a86f4..27077c13a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java @@ -70,7 +70,15 @@ public class PlotCommitList extends private final TreeSet freeLanes = new TreeSet(); - private HashSet activeLanes = new HashSet(32); + private final HashSet activeLanes = new HashSet(32); + + @Override + public void clear() { + super.clear(); + lanesAllocated = 0; + freeLanes.clear(); + activeLanes.clear(); + } @Override public void source(final RevWalk w) { @@ -139,7 +147,7 @@ public class PlotCommitList extends final PlotCommit c = currCommit.children[i]; if (activeLanes.remove(c.lane)) { recycleLane((L) c.lane); - freeLanes.add(Integer.valueOf(c.lane.position)); + freeLanes.add(Integer.valueOf(c.lane.getPosition())); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java index 3ae1a71f1..c67b1006f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java @@ -1,4 +1,5 @@ /* + * Copyright (C) 2009, Jonas Fonseca * Copyright (C) 2008, Shawn O. Pearce * and other copyright owners as documented in the project's IP log. * @@ -56,13 +57,12 @@ public class RevObjectList extends AbstractList { static final int BLOCK_SIZE = 1 << BLOCK_SHIFT; - Block contents; + protected Block contents = new Block(0); - int size; + protected int size = 0; /** Create an empty object list. */ public RevObjectList() { - clear(); } public void add(final int index, final E element) { @@ -113,7 +113,7 @@ public class RevObjectList extends AbstractList { size = 0; } - static class Block { + protected static class Block { final Object[] contents = new Object[BLOCK_SIZE]; final int shift;