From 72a7824f2f1d78e9eefde02843e95c9c5b2c4938 Mon Sep 17 00:00:00 2001
From: Vitaly Litvak <vitaliy@fundcount.com>
Date: Tue, 28 Jan 2014 09:18:04 -0500
Subject: [PATCH] Added fisheye hook script
---
src/main/java/com/gitblit/utils/ObjectCache.java | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/gitblit/utils/ObjectCache.java b/src/main/java/com/gitblit/utils/ObjectCache.java
index 38f2e59..e75d4b8 100644
--- a/src/main/java/com/gitblit/utils/ObjectCache.java
+++ b/src/main/java/com/gitblit/utils/ObjectCache.java
@@ -25,9 +25,9 @@
* milliseconds and in fast, concurrent systems this cache is too simplistic.
* However, for the cases where its being used in Gitblit this cache technique
* is just fine.
- *
+ *
* @author James Moger
- *
+ *
*/
public class ObjectCache<X> implements Serializable {
@@ -52,6 +52,10 @@
public String toString() {
return getClass().getSimpleName() + ": " + name;
}
+ }
+
+ public void clear() {
+ cache.clear();
}
public boolean hasCurrent(String name, Date date) {
@@ -85,13 +89,13 @@
obj.object = object;
}
- public Object remove(String name) {
+ public X remove(String name) {
if (cache.containsKey(name)) {
return cache.remove(name).object;
}
return null;
}
-
+
public int size() {
return cache.size();
}
--
Gitblit v1.9.1