@Override
public void report() {
if(statMap.isEmpty()){
return;
}
JCIPAnnotationDatabase jcipAnotationDatabase = AnalysisContext.currentAnalysisContext().getJCIPAnnotationDatabase();
for (XField xfield : statMap.keySet()) {
FieldStats stats = statMap.get(xfield);
if (!stats.isInteresting()) {
continue;
}
boolean notThreadSafe = jcipAnotationDatabase.hasClassAnnotation(xfield.getClassName(), "NotThreadSafe");
if (notThreadSafe) {
continue;
}
ElementValue guardedByValue = jcipAnotationDatabase.getFieldAnnotation(xfield, "GuardedBy");
boolean guardedByThis;
if(guardedByValue != null){
guardedByThis = guardedByValue.stringifyValue().equals("this");
} else {
guardedByThis = false;
}
boolean threadSafe = jcipAnotationDatabase.hasClassAnnotation(xfield.getClassName(), "ThreadSafe");
WarningPropertySet<InconsistentSyncWarningProperty> propertySet = new WarningPropertySet<InconsistentSyncWarningProperty>();
int numReadUnlocked = stats.getNumAccesses(READ_UNLOCKED);
int numWriteUnlocked = stats.getNumAccesses(WRITE_UNLOCKED);