@@ -119,12 +119,12 @@ public void visitClassContext(ClassContext classContext) {
119
119
for (Method method : classContext .getMethodsInCallOrder ()) {
120
120
collectFieldsForAtomicityCheck (classContext , method );
121
121
}
122
- for (Method method : classContext .getMethodsInCallOrder ()) {
123
- analyzeFieldsForAtomicityViolations (classContext , method );
124
- }
125
- removePresynchronizedPrivateMethodCalls ();
126
- accumulateFieldsForAtomicityAnalysis ();
127
- accumulateLocalVariables ();
122
+ // for (Method method : classContext.getMethodsInCallOrder()) {
123
+ // analyzeFieldsForAtomicityViolations(classContext, method);
124
+ // }
125
+ // removePresynchronizedPrivateMethodCalls();
126
+ // accumulateFieldsForAtomicityAnalysis();
127
+ // accumulateLocalVariables();
128
128
} catch (CheckedAnalysisException e ) {
129
129
bugReporter .logError (String .format ("Detector %s caught exception while analyzing class %s" ,
130
130
getClass ().getName (), classContext .getJavaClass ().getClassName ()), e );
@@ -145,7 +145,11 @@ private void collectFieldsForAtomicityCheck(ClassContext classContext, Method me
145
145
OpcodeStack stack = OpcodeStackScanner .getStackAt (classContext .getJavaClass (), method , handle .getPosition ());
146
146
OpcodeStack .Item stackItem = stack .getStackItem (0 );
147
147
if (isAtomicField (stackItem .getReturnValueOf ())) {
148
- fieldsForAtomicityCheck .add (XFactory .createXField ((FieldInstruction ) instruction , cpg ));
148
+ //fieldsForAtomicityCheck.add(XFactory.createXField((FieldInstruction) instruction, cpg));
149
+ BugPrototype bugPrototype = new BugPrototype (classContext , method , location );
150
+ bugPrototype .invokedField = XFactory .createXField ((FieldInstruction ) instruction , cpg );
151
+ BugInstance bugInstance = bugPrototype .toBugInstance (this , "AT_COMBINED_ATOMIC_OPERATIONS_ARE_NOT_ATOMIC" );
152
+ bugAccumulator .accumulateBug (bugInstance , bugInstance .getPrimarySourceLineAnnotation ());
149
153
}
150
154
}
151
155
}
0 commit comments