Quick fix for threading issue. Should maybe look into synchronizing this method instead.
This commit is contained in:
parent
9ad3358728
commit
aa89773008
|
@ -159,12 +159,13 @@ public final class FieldAttributes {
|
||||||
public Collection<Annotation> getAnnotations() {
|
public Collection<Annotation> getAnnotations() {
|
||||||
if (annotations == null) {
|
if (annotations == null) {
|
||||||
Pair<Class<?>, String> key = new Pair<Class<?>, String>(declaringClazz, name);
|
Pair<Class<?>, String> key = new Pair<Class<?>, String>(declaringClazz, name);
|
||||||
annotations = ANNOTATION_CACHE.getElement(key);
|
Collection<Annotation> cachedValue = ANNOTATION_CACHE.getElement(key);
|
||||||
if (annotations == null) {
|
if (cachedValue == null) {
|
||||||
annotations = Collections.unmodifiableCollection(
|
cachedValue = Collections.unmodifiableCollection(
|
||||||
Arrays.asList(field.getAnnotations()));
|
Arrays.asList(field.getAnnotations()));
|
||||||
ANNOTATION_CACHE.addElement(key, annotations);
|
ANNOTATION_CACHE.addElement(key, cachedValue);
|
||||||
}
|
}
|
||||||
|
annotations = cachedValue;
|
||||||
}
|
}
|
||||||
return annotations;
|
return annotations;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user