Based on this discussion thread: DC_DOUBLECHECK cannot properly retrieve field volatile modifier if it's declared in the superclass. Here's the testcase:
public class Bug1347 {
protected volatile List<Object> types;
protected List<Object> types2;
public static class B extends Bug1347 {
@NoWarning("DC_DOUBLECHECK")
List<Object> getTypes() {
if (types == null) {
synchronized (this) {
if (types == null) {
types = new ArrayList<>();
}
}
}
return types;
}
@ExpectWarning("DC_DOUBLECHECK")
List<Object> getTypes2() {
if (types2 == null) {
synchronized (this) {
if (types2 == null) {
types2 = new ArrayList<>();
}
}
}
return types2;
}
}
}
Fixed:
https://code.google.com/p/findbugs/source/detail?r=61da7f2d7e9920586c9fff329c75de4eb666b2ae