}
private void analyzeMethod(ClassContext classContext, Method method, Set<Method> lockedMethodSet) throws CFGBuilderException,
DataflowAnalysisException {
InnerClassAccessMap icam = AnalysisContext.currentAnalysisContext().getInnerClassAccessMap();
ConstantPoolGen cpg = classContext.getConstantPoolGen();
MethodGen methodGen = classContext.getMethodGen(method);
if (methodGen == null) {
return;
}
CFG cfg = classContext.getCFG(method);
LockChecker lockChecker = classContext.getLockChecker(method);
ValueNumberDataflow vnaDataflow = classContext.getValueNumberDataflow(method);
boolean isGetterMethod = isGetterMethod(classContext, method);
MethodDescriptor methodDescriptor = DescriptorFactory.instance().getMethodDescriptor(classContext.getJavaClass(), method);
if (DEBUG) {
System.out.println("**** Analyzing method " + SignatureConverter.convertMethodSignature(methodGen));
}
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
try {
Instruction ins = location.getHandle().getInstruction();
XField xfield = null;
boolean isWrite = false;
boolean isLocal = false;
boolean isNullCheck = false;
if (ins instanceof FieldInstruction) {
InstructionHandle n = location.getHandle().getNext();
isNullCheck = n.getInstruction() instanceof IFNONNULL || n.getInstruction() instanceof IFNULL;
if (DEBUG && isNullCheck) {
System.out.println("is null check");
}
FieldInstruction fins = (FieldInstruction) ins;
xfield = Hierarchy.findXField(fins, cpg);
if (xfield == null) {
continue;
}
isWrite = ins.getOpcode() == Constants.PUTFIELD;
isLocal = fins.getClassName(cpg).equals(classContext.getJavaClass().getClassName());
if (DEBUG) {
System.out.println("Handling field access: " + location.getHandle() + " (frame="
+ vnaDataflow.getFactAtLocation(location) + ") :" + n);
}
} else if (ins instanceof INVOKESTATIC) {
INVOKESTATIC inv = (INVOKESTATIC) ins;
InnerClassAccess access = icam.getInnerClassAccess(inv, cpg);
if (access != null && access.getMethodSignature().equals(inv.getSignature(cpg))) {
xfield = access.getField();
isWrite = !access.isLoad();
isLocal = false;
if (DEBUG) {