-
Bug
-
Resolution: Fixed
-
P5
-
11, 17, 18, 19, 20
-
None
-
b19
There are 3 incorrect double-checked locking cases in ClassInfo:
private List<Method> methods;
private Map<String,PropertyInfo> properties;
private Map<String,EventSetInfo> eventSets;
For example:
public List<Method> getMethods() {
if (this.methods == null) {
synchronized (this.mutex) {
if (this.methods == null) {
this.methods = MethodInfo.get(this.type);
}
}
}
return this.methods;
}
'methods' is not volatile and read multiple times. This makes it an incorrect DCL.
private List<Method> methods;
private Map<String,PropertyInfo> properties;
private Map<String,EventSetInfo> eventSets;
For example:
public List<Method> getMethods() {
if (this.methods == null) {
synchronized (this.mutex) {
if (this.methods == null) {
this.methods = MethodInfo.get(this.type);
}
}
}
return this.methods;
}
'methods' is not volatile and read multiple times. This makes it an incorrect DCL.