promote uniformity between branches by using registry accessor

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@907126 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2010-02-05 23:11:43 +00:00
parent 8f675dd3cb
commit 2fb9e71da6
1 changed files with 4 additions and 5 deletions

View File

@ -173,12 +173,11 @@ static boolean isRegistered(Object value) {
*/
static void register(Object value) {
if (value != null) {
WeakHashMap<Object, Object> m = REGISTRY.get();
Map<Object, Object> m = getRegistry();
if (m == null) {
m = new WeakHashMap<Object, Object>();
REGISTRY.set(m);
REGISTRY.set(new WeakHashMap<Object, Object>());
}
m.put(value, null);
getRegistry().put(value, null);
}
}
@ -196,7 +195,7 @@ static void register(Object value) {
*/
static void unregister(Object value) {
if (value != null) {
WeakHashMap<Object, Object> m = REGISTRY.get();
Map<Object, Object> m = getRegistry();
if (m != null) {
m.remove(value);
if (m.isEmpty()) {