diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/UnpackedObjectCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/DeltaBaseCache.java similarity index 98% rename from org.eclipse.jgit/src/org/eclipse/jgit/storage/file/UnpackedObjectCache.java rename to org.eclipse.jgit/src/org/eclipse/jgit/storage/file/DeltaBaseCache.java index 92f482425..8b548242b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/UnpackedObjectCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/DeltaBaseCache.java @@ -45,7 +45,7 @@ import java.lang.ref.SoftReference; -class UnpackedObjectCache { +class DeltaBaseCache { private static final int CACHE_SZ = 1024; private static final SoftReference DEAD; @@ -164,7 +164,7 @@ private static void clearEntry(final Slot e) { e.sz = 0; } - private UnpackedObjectCache() { + private DeltaBaseCache() { throw new UnsupportedOperationException(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java index ed159ef38..523911162 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java @@ -220,7 +220,7 @@ void resolve(Set matches, AbbreviatedObjectId id, int matchLimit) * Close the resources utilized by this repository */ public void close() { - UnpackedObjectCache.purge(this); + DeltaBaseCache.purge(this); WindowCache.purge(this); synchronized (this) { loadedIdx = null; @@ -274,14 +274,6 @@ ObjectId findObjectForOffset(final long offset) throws IOException { return getReverseIdx().findObject(offset); } - private final UnpackedObjectCache.Entry readCache(final long position) { - return UnpackedObjectCache.get(this, position); - } - - private final void saveCache(final long position, final byte[] data, final int type) { - UnpackedObjectCache.store(this, position, data, type); - } - private final byte[] decompress(final long position, final long totalSize, final WindowCursor curs) throws IOException, DataFormatException { final byte[] dstbuf = new byte[(int) totalSize]; @@ -700,7 +692,7 @@ private ObjectLoader loadDelta(long posSelf, int hdrLen, long sz, byte[] data; int type; - UnpackedObjectCache.Entry e = readCache(posBase); + DeltaBaseCache.Entry e = DeltaBaseCache.get(this, posBase); if (e != null) { data = e.data; type = e.type; @@ -715,7 +707,7 @@ private ObjectLoader loadDelta(long posSelf, int hdrLen, long sz, } data = p.getCachedBytes(); type = p.getType(); - saveCache(posBase, data, type); + DeltaBaseCache.store(this, posBase, data, type); } // At this point we have the base, and its small, and the delta diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCache.java index 68fa19120..f533af48c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCache.java @@ -187,7 +187,7 @@ public static void reconfigure(final WindowCacheConfig cfg) { oc.removeAll(); cache = nc; streamFileThreshold = cfg.getStreamFileThreshold(); - UnpackedObjectCache.reconfigure(cfg); + DeltaBaseCache.reconfigure(cfg); } static int getStreamFileThreshold() { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java index 90ea376b5..95ec6f7c7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java @@ -146,7 +146,7 @@ public void setPackedGitMMAP(final boolean usemmap) { } /** - * @return maximum number of bytes to cache in {@link UnpackedObjectCache} + * @return maximum number of bytes to cache in {@link DeltaBaseCache} * for inflated, recently accessed objects, without delta chains. * Default 10 MB. */ @@ -157,7 +157,7 @@ public int getDeltaBaseCacheLimit() { /** * @param newLimit * maximum number of bytes to cache in - * {@link UnpackedObjectCache} for inflated, recently accessed + * {@link DeltaBaseCache} for inflated, recently accessed * objects, without delta chains. */ public void setDeltaBaseCacheLimit(final int newLimit) {