From 3286926d2ec11445f76cd170e4c2fcff597a0754 Mon Sep 17 00:00:00 2001
From: Fabrice Bacchella <fbacchella@spamcop.net>
Date: Tue, 26 May 2015 04:48:40 -0400
Subject: [PATCH] Two slight improvement for custom UserService: - try userRealm as a file only if class is not found, other exeptions are real error - log userService only after setup, for better logging, as it can use gitblit.properties for custom .toString
---
src/main/java/com/gitblit/utils/ObjectCache.java | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/gitblit/utils/ObjectCache.java b/src/main/java/com/gitblit/utils/ObjectCache.java
index 692669f..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) {
@@ -91,7 +95,7 @@
}
return null;
}
-
+
public int size() {
return cache.size();
}
--
Gitblit v1.9.1