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:
parent
8f675dd3cb
commit
2fb9e71da6
|
@ -173,12 +173,11 @@ public abstract class ToStringStyle implements Serializable {
|
|||
*/
|
||||
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 @@ public abstract class ToStringStyle implements Serializable {
|
|||
*/
|
||||
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()) {
|
||||
|
|
Loading…
Reference in New Issue