Program: 85359
Project: 85359
Buggy source:
/** 
 * Does not require the method to have a body 
 */
public HashMutableDirectedGraph triviallyConservativeInfoFlowAnalysis(SootMethod sm){
  HashSet<EquivalentValue> fieldsStaticsParamsAccessed=new HashSet<EquivalentValue>();
  for (int i=0; i < sm.getParameterCount(); i++) {
    EquivalentValue parameterRefEqVal=InfoFlowAnalysis.getNodeForParameterRef(sm,i);
    fieldsStaticsParamsAccessed.add(parameterRefEqVal);
  }
  for (Iterator<SootField> it=sm.getDeclaringClass().getFields().iterator(); it.hasNext(); ) {
    SootField sf=it.next();
    if (sf.isStatic() || !sm.isStatic()) {
      EquivalentValue fieldRefEqVal=InfoFlowAnalysis.getNodeForFieldRef(sm,sf);
      fieldsStaticsParamsAccessed.add(fieldRefEqVal);
    }
  }
  SootClass superclass=sm.getDeclaringClass();
  if (superclass.hasSuperclass())   superclass=sm.getDeclaringClass().getSuperclass();
  while (superclass.hasSuperclass()) {
    Iterator<SootField> scFieldsIt=superclass.getFields().iterator();
    while (scFieldsIt.hasNext()) {
      SootField scField=scFieldsIt.next();
      if (scField.isStatic() || !sm.isStatic()) {
        EquivalentValue fieldRefEqVal=InfoFlowAnalysis.getNodeForFieldRef(sm,scField);
        fieldsStaticsParamsAccessed.add(fieldRefEqVal);
      }
    }
    superclass=superclass.getSuperclass();
  }
  HashMutableDirectedGraph<EquivalentValue> dataFlowGraph=new MemoryEfficientGraph<EquivalentValue>();
  Iterator<EquivalentValue> accessedIt1=fieldsStaticsParamsAccessed.iterator();
  while (accessedIt1.hasNext()) {
    EquivalentValue o=accessedIt1.next();
    dataFlowGraph.addNode(o);
  }
  ParameterRef returnValueRef=null;
  if (sm.getReturnType() != VoidType.v()) {
    returnValueRef=new ParameterRef(sm.getReturnType(),-1);
    dataFlowGraph.addNode(InfoFlowAnalysis.getNodeForReturnRef(sm));
  }
  ThisRef thisRef=null;
  if (!sm.isStatic()) {
    thisRef=new ThisRef(sootClass.getType());
    dataFlowGraph.addNode(InfoFlowAnalysis.getNodeForThisRef(sm));
    fieldsStaticsParamsAccessed.add(InfoFlowAnalysis.getNodeForThisRef(sm));
  }
  accessedIt1=fieldsStaticsParamsAccessed.iterator();
  while (accessedIt1.hasNext()) {
    EquivalentValue r=accessedIt1.next();
    Ref rRef=(Ref)r.getValue();
    if (!(rRef.getType() instanceof RefLikeType) && !dfa.includesPrimitiveInfoFlow())     continue;
    Iterator<EquivalentValue> accessedIt2=fieldsStaticsParamsAccessed.iterator();
    while (accessedIt2.hasNext()) {
      EquivalentValue s=accessedIt2.next();
      Ref sRef=(Ref)s.getValue();
      if (rRef instanceof ThisRef && sRef instanceof InstanceFieldRef)       ;
 else       if (sRef instanceof ThisRef && rRef instanceof InstanceFieldRef)       ;
 else       if (sRef.getType() instanceof RefLikeType)       dataFlowGraph.addEdge(r,s);
    }
    if (returnValueRef != null && (returnValueRef.getType() instanceof RefLikeType || dfa.includesPrimitiveInfoFlow()))     dataFlowGraph.addEdge(r,InfoFlowAnalysis.getNodeForReturnRef(sm));
  }
  return dataFlowGraph;
}

Fixed version (ground truth):
/** 
 * Does not require the method to have a body 
 */
public HashMutableDirectedGraph<EquivalentValue> triviallyConservativeInfoFlowAnalysis(SootMethod sm){
  HashSet<EquivalentValue> fieldsStaticsParamsAccessed=new HashSet<EquivalentValue>();
  for (int i=0; i < sm.getParameterCount(); i++) {
    EquivalentValue parameterRefEqVal=InfoFlowAnalysis.getNodeForParameterRef(sm,i);
    fieldsStaticsParamsAccessed.add(parameterRefEqVal);
  }
  for (Iterator<SootField> it=sm.getDeclaringClass().getFields().iterator(); it.hasNext(); ) {
    SootField sf=it.next();
    if (sf.isStatic() || !sm.isStatic()) {
      EquivalentValue fieldRefEqVal=InfoFlowAnalysis.getNodeForFieldRef(sm,sf);
      fieldsStaticsParamsAccessed.add(fieldRefEqVal);
    }
  }
  SootClass superclass=sm.getDeclaringClass();
  if (superclass.hasSuperclass())   superclass=sm.getDeclaringClass().getSuperclass();
  while (superclass.hasSuperclass()) {
    Iterator<SootField> scFieldsIt=superclass.getFields().iterator();
    while (scFieldsIt.hasNext()) {
      SootField scField=scFieldsIt.next();
      if (scField.isStatic() || !sm.isStatic()) {
        EquivalentValue fieldRefEqVal=InfoFlowAnalysis.getNodeForFieldRef(sm,scField);
        fieldsStaticsParamsAccessed.add(fieldRefEqVal);
      }
    }
    superclass=superclass.getSuperclass();
  }
  HashMutableDirectedGraph<EquivalentValue> dataFlowGraph=new MemoryEfficientGraph<EquivalentValue>();
  Iterator<EquivalentValue> accessedIt1=fieldsStaticsParamsAccessed.iterator();
  while (accessedIt1.hasNext()) {
    EquivalentValue o=accessedIt1.next();
    dataFlowGraph.addNode(o);
  }
  ParameterRef returnValueRef=null;
  if (sm.getReturnType() != VoidType.v()) {
    returnValueRef=new ParameterRef(sm.getReturnType(),-1);
    dataFlowGraph.addNode(InfoFlowAnalysis.getNodeForReturnRef(sm));
  }
  if (!sm.isStatic()) {
    dataFlowGraph.addNode(InfoFlowAnalysis.getNodeForThisRef(sm));
    fieldsStaticsParamsAccessed.add(InfoFlowAnalysis.getNodeForThisRef(sm));
  }
  accessedIt1=fieldsStaticsParamsAccessed.iterator();
  while (accessedIt1.hasNext()) {
    EquivalentValue r=accessedIt1.next();
    Ref rRef=(Ref)r.getValue();
    if (!(rRef.getType() instanceof RefLikeType) && !dfa.includesPrimitiveInfoFlow())     continue;
    Iterator<EquivalentValue> accessedIt2=fieldsStaticsParamsAccessed.iterator();
    while (accessedIt2.hasNext()) {
      EquivalentValue s=accessedIt2.next();
      Ref sRef=(Ref)s.getValue();
      if (rRef instanceof ThisRef && sRef instanceof InstanceFieldRef)       ;
 else       if (sRef instanceof ThisRef && rRef instanceof InstanceFieldRef)       ;
 else       if (sRef.getType() instanceof RefLikeType)       dataFlowGraph.addEdge(r,s);
    }
    if (returnValueRef != null && (returnValueRef.getType() instanceof RefLikeType || dfa.includesPrimitiveInfoFlow()))     dataFlowGraph.addEdge(r,InfoFlowAnalysis.getNodeForReturnRef(sm));
  }
  return dataFlowGraph;
}