summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-11-08 12:22:37 -0800
committerShawn O. Pearce <spearce@spearce.org>2011-11-08 12:23:44 -0800
commita6677ef28a2abfd0c5b8971a74f7a987e504d26f (patch)
tree166334007571b028b1ddd21095b01d5c9bcd3613 /org.eclipse.jgit
parent00235c77d6e636aac5896f0b1e76b1e43e84410f (diff)
downloadjgit-a6677ef28a2abfd0c5b8971a74f7a987e504d26f.tar.gz
jgit-a6677ef28a2abfd0c5b8971a74f7a987e504d26f.zip
DfsBlockCache: Fix NPE when evicting empty cell
The cache starts with a single empty Ref that has no data, as the clock list does not support being empty. When this Ref is removed, the size has to be decremented from the associated DfsPackKey, which was previously null. Make it always be non-null. Change-Id: I2af99903e8039405ea6d67f383576ffa43839cff
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java
index d3dadbe295..e8733701df 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java
@@ -206,7 +206,7 @@ public final class DfsBlockCache {
blockSizeShift = Integer.numberOfTrailingZeros(blockSize);
clockLock = new ReentrantLock(true /* fair */);
- clockHand = new Ref<Object>(null, -1, 0, null);
+ clockHand = new Ref<Object>(new DfsPackKey(), -1, 0, null);
clockHand.next = clockHand;
readAheadLimit = cfg.getReadAheadLimit();