nus-yam/ex-repair huggingface dataset:
Program: 99630
Project: 99630
Buggy source:
/** 
 * @param d2
 * @return set of c s.t. {@literal <c, d1> -> <s_p, d2>} was recorded as call flow (for some d1), or null if none found.
 */
public IntSet getCallFlowSourceNodes(int d2){
  IntSet s=identityEdges.get(d2);
  IBinaryNaturalRelation R=edges.get(d2);
  IntSet result=null;
  if (R == null) {
    if (s != null) {
      result=s;
    }
  }
 else {
    if (s == null) {
      result=getDomain(R);
    }
 else {
      result=MutableSparseIntSet.make(s);
      ((MutableSparseIntSet)result).addAll(getDomain(R));
    }
  }
  if (TabulationSolver.DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + d2 + "String_Node_Str"+ result);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param d2
 * @return set of c s.t. {@literal <c, d1> -> <s_p, d2>} was recorded as call flow (for some d1), or null if none found.
 */
@SuppressWarnings("String_Node_Str") public IntSet getCallFlowSourceNodes(int d2){
  IntSet s=identityEdges.get(d2);
  IBinaryNaturalRelation R=edges.get(d2);
  IntSet result=null;
  if (R == null) {
    if (s != null) {
      result=s;
    }
  }
 else {
    if (s == null) {
      result=getDomain(R);
    }
 else {
      result=MutableSparseIntSet.make(s);
      ((MutableSparseIntSet)result).addAll(getDomain(R));
    }
  }
  if (TabulationSolver.DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + d2 + "String_Node_Str"+ result);
  }
  return result;
}
Program: 99631
Project: 99631
Buggy source:
/** 
 * Record that in this procedure we've discovered a same-level realizable path from (s_p,0) to (n,d_j)
 * @param n local block number of the basic block n
 * @param j
 */
private void addZeroPathEdge(int n,int j){
  BitVectorIntSet z=(BitVectorIntSet)zeroPaths.get(j);
  if (z == null) {
    z=new BitVectorIntSet();
    zeroPaths.set(j,z);
  }
  z.add(n);
  if (altPaths != null) {
    IBinaryNaturalRelation R=altPaths.get(0);
    if (R == null) {
      R=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
      altPaths.set(0,R);
    }
    R.add(n,j);
  }
  if (TabulationSolver.DEBUG_LEVEL > 1) {
    System.err.println("String_Node_Str" + j + "String_Node_Str"+ z);
  }
}

Fixed version (ground truth):
/** 
 * Record that in this procedure we've discovered a same-level realizable path from (s_p,0) to (n,d_j)
 * @param n local block number of the basic block n
 * @param j
 */
@SuppressWarnings("String_Node_Str") private void addZeroPathEdge(int n,int j){
  BitVectorIntSet z=(BitVectorIntSet)zeroPaths.get(j);
  if (z == null) {
    z=new BitVectorIntSet();
    zeroPaths.set(j,z);
  }
  z.add(n);
  if (altPaths != null) {
    IBinaryNaturalRelation R=altPaths.get(0);
    if (R == null) {
      R=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
      altPaths.set(0,R);
    }
    R.add(n,j);
  }
  if (TabulationSolver.DEBUG_LEVEL > 1) {
    System.err.println("String_Node_Str" + j + "String_Node_Str"+ z);
  }
}
Program: 99632
Project: 99632
Buggy source:
/** 
 * Record that in this procedure we've discovered a same-level realizable path from (s_p,i) to (n,i)
 * @param n local block number of the basic block n
 */
private void addIdentityPathEdge(int i,int n){
  BitVectorIntSet s=(BitVectorIntSet)identityPaths.get(i);
  if (s == null) {
    s=new BitVectorIntSet();
    identityPaths.set(i,s);
  }
  s.add(n);
  if (altPaths != null) {
    IBinaryNaturalRelation R2=altPaths.get(i);
    if (R2 == null) {
      R2=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
      altPaths.set(i,R2);
    }
    R2.add(n,i);
  }
  if (TabulationSolver.DEBUG_LEVEL > 1) {
    System.err.println("String_Node_Str" + i + "String_Node_Str"+ s);
  }
}

Fixed version (ground truth):
/** 
 * Record that in this procedure we've discovered a same-level realizable path from (s_p,i) to (n,i)
 * @param n local block number of the basic block n
 */
@SuppressWarnings("String_Node_Str") private void addIdentityPathEdge(int i,int n){
  BitVectorIntSet s=(BitVectorIntSet)identityPaths.get(i);
  if (s == null) {
    s=new BitVectorIntSet();
    identityPaths.set(i,s);
  }
  s.add(n);
  if (altPaths != null) {
    IBinaryNaturalRelation R2=altPaths.get(i);
    if (R2 == null) {
      R2=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
      altPaths.set(i,R2);
    }
    R2.add(n,i);
  }
  if (TabulationSolver.DEBUG_LEVEL > 1) {
    System.err.println("String_Node_Str" + i + "String_Node_Str"+ s);
  }
}
Program: 99633
Project: 99633
Buggy source:
/** 
 * Record that in this procedure we've discovered a same-level realizable path from (s_p,d_i) to (n,d_j)
 * @param i
 * @param n local block number of the basic block n
 * @param j
 */
public void addPathEdge(int i,int n,int j){
  if (i == 0) {
    addZeroPathEdge(n,j);
  }
 else {
    if (i == j) {
      addIdentityPathEdge(i,n);
    }
 else {
      IBinaryNaturalRelation R=paths.get(j);
      if (R == null) {
        R=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
        paths.set(j,R);
      }
      R.add(n,i);
      if (altPaths != null) {
        IBinaryNaturalRelation R2=altPaths.get(i);
        if (R2 == null) {
          R2=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
          altPaths.set(i,R2);
        }
        R2.add(n,j);
      }
      if (TabulationSolver.DEBUG_LEVEL > 1) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Record that in this procedure we've discovered a same-level realizable path from (s_p,d_i) to (n,d_j)
 * @param i
 * @param n local block number of the basic block n
 * @param j
 */
@SuppressWarnings("String_Node_Str") public void addPathEdge(int i,int n,int j){
  if (i == 0) {
    addZeroPathEdge(n,j);
  }
 else {
    if (i == j) {
      addIdentityPathEdge(i,n);
    }
 else {
      IBinaryNaturalRelation R=paths.get(j);
      if (R == null) {
        R=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
        paths.set(j,R);
      }
      R.add(n,i);
      if (altPaths != null) {
        IBinaryNaturalRelation R2=altPaths.get(i);
        if (R2 == null) {
          R2=new BasicNaturalRelation(new byte[]{BasicNaturalRelation.SIMPLE_SPACE_STINGY},BasicNaturalRelation.TWO_LEVEL);
          altPaths.set(i,R2);
        }
        R2.add(n,j);
      }
      if (TabulationSolver.DEBUG_LEVEL > 1) {
      }
    }
  }
}
Program: 99634
Project: 99634
Buggy source:
/** 
 * Propagate information to a particular return site.
 * @param c the corresponding call site
 * @param entries entry nodes in the caller
 * @param retSite the return site
 * @param d4 a fact s.t. {@literal <c, d4> -> <callee, d2>} wasrecorded as call flow and  {@literal <callee, d2>} is thesource of the summary edge being applied
 * @param D5 facts to propagate to return site
 * @param edge the path edge ending at the exit site of the callee
 */
private void propToReturnSite(final T c,final T[] entries,final T retSite,final int d4,final IntSet D5,final PathEdge<T> edge){
  if (D5 != null) {
    D5.foreach(new IntSetAction(){
      @Override public void act(      final int d5){
        for (int i=0; i < entries.length; i++) {
          final T s_p=entries[i];
          if (DEBUG_LEVEL > 1) {
            System.err.println("String_Node_Str" + s_p);
          }
          IntSet D3=getInversePathEdges(s_p,c,d4);
          if (DEBUG_LEVEL > 1) {
            System.err.println("String_Node_Str" + D3);
          }
          if (D3 != null) {
            D3.foreach(new IntSetAction(){
              @Override public void act(              int d3){
                curPathEdge=PathEdge.createPathEdge(s_p,d3,c,d4);
                newSummaryEdge(curPathEdge,edge,retSite,d5);
                propagate(s_p,d3,retSite,d5);
              }
            }
);
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Propagate information to a particular return site.
 * @param c the corresponding call site
 * @param entries entry nodes in the caller
 * @param retSite the return site
 * @param d4 a fact s.t. {@literal <c, d4> -> <callee, d2>} wasrecorded as call flow and  {@literal <callee, d2>} is thesource of the summary edge being applied
 * @param D5 facts to propagate to return site
 * @param edge the path edge ending at the exit site of the callee
 */
private void propToReturnSite(final T c,final T[] entries,final T retSite,final int d4,final IntSet D5,final PathEdge<T> edge){
  if (D5 != null) {
    D5.foreach(new IntSetAction(){
      @SuppressWarnings("String_Node_Str") @Override public void act(      final int d5){
        for (int i=0; i < entries.length; i++) {
          final T s_p=entries[i];
          if (DEBUG_LEVEL > 1) {
            System.err.println("String_Node_Str" + s_p);
          }
          IntSet D3=getInversePathEdges(s_p,c,d4);
          if (DEBUG_LEVEL > 1) {
            System.err.println("String_Node_Str" + D3);
          }
          if (D3 != null) {
            D3.foreach(new IntSetAction(){
              @Override public void act(              int d3){
                curPathEdge=PathEdge.createPathEdge(s_p,d3,c,d4);
                newSummaryEdge(curPathEdge,edge,retSite,d5);
                propagate(s_p,d3,retSite,d5);
              }
            }
);
          }
        }
      }
    }
);
  }
}
Program: 99635
Project: 99635
Buggy source:
/** 
 * Propagate the fact <s_p,i> -> <n, j> has arisen as a path edge. Returns <code>true</code> iff the path edge was not previously observed.
 * @param s_p entry block
 * @param i dataflow fact on entry
 * @param n reached block
 * @param j dataflow fact reached
 */
protected boolean propagate(T s_p,int i,T n,int j){
}

Fixed version (ground truth):
/** 
 * Propagate the fact <s_p,i> -> <n, j> has arisen as a path edge. Returns <code>true</code> iff the path edge was not previously observed.
 * @param s_p entry block
 * @param i dataflow fact on entry
 * @param n reached block
 * @param j dataflow fact reached
 */
@SuppressWarnings("String_Node_Str") protected boolean propagate(T s_p,int i,T n,int j){
}
Program: 99636
Project: 99636
Buggy source:
/** 
 * Handle lines [21 - 32] of the algorithm, propagating information from an exit node. Note that we've changed the way we record summary edges. Summary edges are now associated with a callee (s_p,exit), where the original algorithm used a call, return pair in the caller.
 */
protected void processExit(final PathEdge<T> edge){
}

Fixed version (ground truth):
/** 
 * Handle lines [21 - 32] of the algorithm, propagating information from an exit node. Note that we've changed the way we record summary edges. Summary edges are now associated with a callee (s_p,exit), where the original algorithm used a call, return pair in the caller.
 */
@SuppressWarnings("String_Node_Str") protected void processExit(final PathEdge<T> edge){
}
Program: 99637
Project: 99637
Buggy source:
/** 
 * See POPL 95 paper for this algorithm, Figure 3
 * @throws CancelException
 */
private void forwardTabulateSLRPs() throws CancelException {
}

Fixed version (ground truth):
/** 
 * See POPL 95 paper for this algorithm, Figure 3
 * @throws CancelException
 */
@SuppressWarnings("String_Node_Str") private void forwardTabulateSLRPs() throws CancelException {
}
Program: 99638
Project: 99638
Buggy source:
/** 
 * @return f(call_d, exit_d);
 */
protected IntSet computeBinaryFlow(int call_d,int exit_d,IBinaryReturnFlowFunction f){
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + f);
  }
  IntSet result=f.getTargets(call_d,exit_d);
  return result;
}

Fixed version (ground truth):
/** 
 * @return f(call_d, exit_d);
 */
@SuppressWarnings("String_Node_Str") protected IntSet computeBinaryFlow(int call_d,int exit_d,IBinaryReturnFlowFunction f){
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + f);
  }
  IntSet result=f.getTargets(call_d,exit_d);
  return result;
}
Program: 99639
Project: 99639
Buggy source:
/** 
 * handle a particular callee for some call node.
 * @param edge the path edge being processed
 * @param callNodeNum the number of the call node in the supergraph
 * @param allReturnSites a set collecting return sites for the call. This set is mutated with the return sites for this callee.
 * @param calleeEntry the entry node of the callee in question
 */
protected void processParticularCallee(final PathEdge<T> edge,final int callNodeNum,Collection<T> allReturnSites,final T calleeEntry){
}

Fixed version (ground truth):
/** 
 * handle a particular callee for some call node.
 * @param edge the path edge being processed
 * @param callNodeNum the number of the call node in the supergraph
 * @param allReturnSites a set collecting return sites for the call. This set is mutated with the return sites for this callee.
 * @param calleeEntry the entry node of the callee in question
 */
@SuppressWarnings("String_Node_Str") protected void processParticularCallee(final PathEdge<T> edge,final int callNodeNum,Collection<T> allReturnSites,final T calleeEntry){
}
Program: 99641
Project: 99641
Buggy source:
/** 
 * @return f(d1)
 */
protected IntSet computeFlow(int d1,IUnaryFlowFunction f){
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + f);
  }
  IntSet result=f.getTargets(d1);
  if (result == null) {
    return null;
  }
 else {
    return result;
  }
}

Fixed version (ground truth):
/** 
 * @return f(d1)
 */
@SuppressWarnings("String_Node_Str") protected IntSet computeFlow(int d1,IUnaryFlowFunction f){
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + f);
  }
  IntSet result=f.getTargets(d1);
  if (result == null) {
    return null;
  }
 else {
    return result;
  }
}
Program: 99642
Project: 99642
Buggy source:
/** 
 * Handle lines [33-37] of the algorithm
 * @param edge
 */
private void processNormal(final PathEdge<T> edge){
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + edge);
  }
  for (Iterator<? extends T> it=supergraph.getSuccNodes(edge.target); it.hasNext(); ) {
    final T m=it.next();
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + m);
    }
    IUnaryFlowFunction f=flowFunctionMap.getNormalFlowFunction(edge.target,m);
    IntSet D3=computeFlow(edge.d2,f);
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + D3);
    }
    if (D3 != null) {
      D3.foreach(new IntSetAction(){
        @Override public void act(        int d3){
          newNormalExplodedEdge(edge,m,d3);
          propagate(edge.entry,edge.d1,m,d3);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
/** 
 * Handle lines [33-37] of the algorithm
 * @param edge
 */
@SuppressWarnings("String_Node_Str") private void processNormal(final PathEdge<T> edge){
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + edge);
  }
  for (Iterator<? extends T> it=supergraph.getSuccNodes(edge.target); it.hasNext(); ) {
    final T m=it.next();
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + m);
    }
    IUnaryFlowFunction f=flowFunctionMap.getNormalFlowFunction(edge.target,m);
    IntSet D3=computeFlow(edge.d2,f);
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + D3);
    }
    if (D3 != null) {
      D3.foreach(new IntSetAction(){
        @Override public void act(        int d3){
          newNormalExplodedEdge(edge,m,d3);
          propagate(edge.entry,edge.d1,m,d3);
        }
      }
);
    }
  }
}
Program: 99643
Project: 99643
Buggy source:
protected void addToWorkList(T s_p,int i,T n,int j){
  if (worklist == null) {
    worklist=makeWorklist();
  }
  worklist.insert(PathEdge.createPathEdge(s_p,i,n,j));
  if (DEBUG_LEVEL >= 3) {
    System.err.println("String_Node_Str" + worklist);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void addToWorkList(T s_p,int i,T n,int j){
  if (worklist == null) {
    worklist=makeWorklist();
  }
  worklist.insert(PathEdge.createPathEdge(s_p,i,n,j));
  if (DEBUG_LEVEL >= 3) {
    System.err.println("String_Node_Str" + worklist);
  }
}
Program: 99644
Project: 99644
Buggy source:
/** 
 * Handle lines [14 - 19] of the algorithm, propagating information into and across a call site.
 */
protected void processCall(final PathEdge<T> edge){
}

Fixed version (ground truth):
/** 
 * Handle lines [14 - 19] of the algorithm, propagating information into and across a call site.
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected void processCall(final PathEdge<T> edge){
}
Program: 99645
Project: 99645
Buggy source:
protected boolean addAllToP2Set(Map<PointerKeyAndState,MutableIntSet> p2setMap,PointerKeyAndState pkAndState,IntSet vals,IFlowLabel label){
  final PointerKey pk=pkAndState.getPointerKey();
  if (pk instanceof FilteredPointerKey) {
    if (DEBUG) {
      System.err.println("String_Node_Str" + pk);
    }
    final TypeFilter typeFilter=((FilteredPointerKey)pk).getTypeFilter();
    vals=updateValsForFilter(vals,typeFilter);
  }
  if (label instanceof IFlowLabelWithFilter) {
    TypeFilter typeFilter=((IFlowLabelWithFilter)label).getFilter();
    if (typeFilter != null) {
      vals=updateValsForFilter(vals,typeFilter);
    }
  }
  boolean added=findOrCreate(p2setMap,pkAndState).addAll(vals);
  if (DEBUG && added) {
    System.err.println("String_Node_Str" + pkAndState + "String_Node_Str");
    for (    InstanceKeyAndState ikAndState : makeOrdinalSet(vals)) {
      System.err.println(ikAndState);
    }
    System.err.println("String_Node_Str");
  }
  return added;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected boolean addAllToP2Set(Map<PointerKeyAndState,MutableIntSet> p2setMap,PointerKeyAndState pkAndState,IntSet vals,IFlowLabel label){
  final PointerKey pk=pkAndState.getPointerKey();
  if (pk instanceof FilteredPointerKey) {
    if (DEBUG) {
      System.err.println("String_Node_Str" + pk);
    }
    final TypeFilter typeFilter=((FilteredPointerKey)pk).getTypeFilter();
    vals=updateValsForFilter(vals,typeFilter);
  }
  if (label instanceof IFlowLabelWithFilter) {
    TypeFilter typeFilter=((IFlowLabelWithFilter)label).getFilter();
    if (typeFilter != null) {
      vals=updateValsForFilter(vals,typeFilter);
    }
  }
  boolean added=findOrCreate(p2setMap,pkAndState).addAll(vals);
  if (DEBUG && added) {
    System.err.println("String_Node_Str" + pkAndState + "String_Node_Str");
    for (    InstanceKeyAndState ikAndState : makeOrdinalSet(vals)) {
      System.err.println(ikAndState);
    }
    System.err.println("String_Node_Str");
  }
  return added;
}
Program: 99646
Project: 99646
Buggy source:
private void populate(CGNode n){
  if (ALWAYS_BUILD_IR || n.getMethod().isSynthetic()) {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    IR ir=n.getIR();
    if (ir == null) {
      return;
    }
    SSAInstruction[] statements=ir.getInstructions();
    SSAMemoryAccessVisitor v=new SSAMemoryAccessVisitor(n);
    for (int i=0; i < statements.length; i++) {
      SSAInstruction s=statements[i];
      if (s != null) {
        v.setInstructionIndex(i);
        s.visit(v);
      }
    }
  }
 else {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    ShrikeCTMethod sm=(ShrikeCTMethod)n.getMethod();
    MemoryAccessVisitor v=new MemoryAccessVisitor(n.getMethod().getReference().getDeclaringClass().getClassLoader(),n);
    try {
      IInstruction[] statements=sm.getInstructions();
      if (statements == null) {
        return;
      }
      if (DEBUG) {
        for (int i=0; i < statements.length; i++) {
          System.err.println(i + "String_Node_Str" + statements[i]);
        }
      }
      for (int i=0; i < statements.length; i++) {
        IInstruction s=statements[i];
        if (s != null) {
          v.setInstructionIndex(i);
          s.visit(v);
        }
      }
    }
 catch (    InvalidClassFileException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void populate(CGNode n){
  if (ALWAYS_BUILD_IR || n.getMethod().isSynthetic()) {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    IR ir=n.getIR();
    if (ir == null) {
      return;
    }
    SSAInstruction[] statements=ir.getInstructions();
    SSAMemoryAccessVisitor v=new SSAMemoryAccessVisitor(n);
    for (int i=0; i < statements.length; i++) {
      SSAInstruction s=statements[i];
      if (s != null) {
        v.setInstructionIndex(i);
        s.visit(v);
      }
    }
  }
 else {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    ShrikeCTMethod sm=(ShrikeCTMethod)n.getMethod();
    MemoryAccessVisitor v=new MemoryAccessVisitor(n.getMethod().getReference().getDeclaringClass().getClassLoader(),n);
    try {
      IInstruction[] statements=sm.getInstructions();
      if (statements == null) {
        return;
      }
      if (DEBUG) {
        for (int i=0; i < statements.length; i++) {
          System.err.println(i + "String_Node_Str" + statements[i]);
        }
      }
      for (int i=0; i < statements.length; i++) {
        IInstruction s=statements[i];
        if (s != null) {
          v.setInstructionIndex(i);
          s.visit(v);
        }
      }
    }
 catch (    InvalidClassFileException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}
Program: 99647
Project: 99647
Buggy source:
/** 
 * Add a module file to the scope for a loader. The classes in the added jar file will override classes added to the scope so far.
 */
public void addToScopeHead(ClassLoaderReference loader,Module m){
  if (m == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  List<Module> s=MapUtil.findOrCreateList(moduleMap,loader);
  if (DEBUG_LEVEL > 0) {
    System.err.println(("String_Node_Str" + m));
  }
  s.add(0,m);
}

Fixed version (ground truth):
/** 
 * Add a module file to the scope for a loader. The classes in the added jar file will override classes added to the scope so far.
 */
@SuppressWarnings("String_Node_Str") public void addToScopeHead(ClassLoaderReference loader,Module m){
  if (m == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  List<Module> s=MapUtil.findOrCreateList(moduleMap,loader);
  if (DEBUG_LEVEL > 0) {
    System.err.println(("String_Node_Str" + m));
  }
  s.add(0,m);
}
Program: 99648
Project: 99648
Buggy source:
/** 
 * @param klass a class
 * @return an int set which represents the subset of S that correspond to subtypes of klass
 */
protected IntSet filterForClass(IntSet S,IClass klass){
  MutableIntSet filter=null;
  if (klass.getReference().equals(TypeReference.JavaLangObject)) {
    return S;
  }
 else {
    filter=getMutableInstanceKeysForClass(klass);
    boolean debug=false;
    if (DEBUG_FILTER) {
      String s="String_Node_Str" + klass;
      System.err.println(s);
      System.err.println("String_Node_Str" + filter);
    }
    filter.intersectWith(S);
    if (DEBUG_FILTER && debug) {
      System.err.println("String_Node_Str" + filter);
    }
  }
  return filter;
}

Fixed version (ground truth):
/** 
 * @param klass a class
 * @return an int set which represents the subset of S that correspond to subtypes of klass
 */
@SuppressWarnings("String_Node_Str") protected IntSet filterForClass(IntSet S,IClass klass){
  MutableIntSet filter=null;
  if (klass.getReference().equals(TypeReference.JavaLangObject)) {
    return S;
  }
 else {
    filter=getMutableInstanceKeysForClass(klass);
    boolean debug=false;
    if (DEBUG_FILTER) {
      String s="String_Node_Str" + klass;
      System.err.println(s);
      System.err.println("String_Node_Str" + filter);
    }
    filter.intersectWith(S);
    if (DEBUG_FILTER && debug) {
      System.err.println("String_Node_Str" + filter);
    }
  }
  return filter;
}
Program: 99649
Project: 99649
Buggy source:
/** 
 * If key is unified, returns the representative
 * @param key
 * @return the dataflow variable that tracks the points-to set for key
 */
public PointsToSetVariable findOrCreatePointsToSet(PointerKey key){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (pointsToMap.isImplicit(key)) {
    System.err.println("String_Node_Str");
    System.err.println(key);
    Assertions.UNREACHABLE();
  }
  PointsToSetVariable result=pointsToMap.getPointsToSet(key);
  if (result == null) {
    result=new PointsToSetVariable(key);
    pointsToMap.put(key,result);
  }
 else {
    if (!pointsToMap.isUnified(key) && key instanceof FilteredPointerKey) {
      PointerKey pk=result.getPointerKey();
      if (!(pk instanceof FilteredPointerKey)) {
        result.setPointerKey(key);
        pk=key;
      }
      FilteredPointerKey fpk=(FilteredPointerKey)pk;
      if (fpk == null) {
        Assertions.UNREACHABLE("String_Node_Str");
      }
      if (key == null) {
        Assertions.UNREACHABLE("String_Node_Str");
      }
      if (fpk.getTypeFilter() == null) {
        Assertions.UNREACHABLE("String_Node_Str");
      }
      if (!fpk.getTypeFilter().equals(((FilteredPointerKey)key).getTypeFilter())) {
        Assertions.UNREACHABLE("String_Node_Str" + ((FilteredPointerKey)key).getTypeFilter() + "String_Node_Str"+ key+ "String_Node_Str"+ fpk.getTypeFilter());
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * If key is unified, returns the representative
 * @param key
 * @return the dataflow variable that tracks the points-to set for key
 */
public PointsToSetVariable findOrCreatePointsToSet(PointerKey key){
}
Program: 99651
Project: 99651
Buggy source:
/** 
 * Generate constraints which assign exception values into an exception pointer
 * @param node governing node
 * @param peis list of PEI instructions
 * @param exceptionVar PointerKey representing a pointer to an exception value
 * @param catchClasses the types "caught" by the exceptionVar
 */
private void addExceptionDefConstraints(IRView ir,DefUse du,CGNode node,List<ProgramCounter> peis,PointerKey exceptionVar,Set<IClass> catchClasses){
}

Fixed version (ground truth):
/** 
 * Generate constraints which assign exception values into an exception pointer
 * @param node governing node
 * @param peis list of PEI instructions
 * @param exceptionVar PointerKey representing a pointer to an exception value
 * @param catchClasses the types "caught" by the exceptionVar
 */
@SuppressWarnings("String_Node_Str") private void addExceptionDefConstraints(IRView ir,DefUse du,CGNode node,List<ProgramCounter> peis,PointerKey exceptionVar,Set<IClass> catchClasses){
}
Program: 99653
Project: 99653
Buggy source:
private void addEntryAndExitEdgesToCaller(CGNode n,T entryBlock,T exitBlock,CGNode caller){
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void addEntryAndExitEdgesToCaller(CGNode n,T entryBlock,T exitBlock,CGNode caller){
}
Program: 99654
Project: 99654
Buggy source:
/** 
 * Add an edge from the exit() block of a callee to a return site in the caller
 * @param callBlock the return site for a call
 * @param targetCFG the called method
 */
private void addEdgesFromCallToEntry(CGNode caller,T callBlock,CGNode target,ControlFlowGraph<SSAInstruction,? extends T> targetCFG){
}

Fixed version (ground truth):
/** 
 * Add an edge from the exit() block of a callee to a return site in the caller
 * @param callBlock the return site for a call
 * @param targetCFG the called method
 */
@SuppressWarnings("String_Node_Str") private void addEdgesFromCallToEntry(CGNode caller,T callBlock,CGNode target,ControlFlowGraph<SSAInstruction,? extends T> targetCFG){
}
Program: 99655
Project: 99655
Buggy source:
/** 
 * Add edges to the IPCFG for the incoming edges incident on a basic block bb.
 * @param n a call graph node
 * @param cfg the CFG for n
 * @param instrs the instructions for node n
 * @param bb a basic block in the CFG
 */
protected void addEdgesToNonEntryBlock(CGNode n,ControlFlowGraph<?,T> cfg,SSAInstruction[] instrs,T bb){
}

Fixed version (ground truth):
/** 
 * Add edges to the IPCFG for the incoming edges incident on a basic block bb.
 * @param n a call graph node
 * @param cfg the CFG for n
 * @param instrs the instructions for node n
 * @param bb a basic block in the CFG
 */
@SuppressWarnings("String_Node_Str") protected void addEdgesToNonEntryBlock(CGNode n,ControlFlowGraph<?,T> cfg,SSAInstruction[] instrs,T bb){
}
Program: 99656
Project: 99656
Buggy source:
/** 
 * If n is relevant and its cfg has not already been added, add nodes and edges for n
 * @param n
 */
private void addIntraproceduralNodesAndEdgesForCGNodeIfNeeded(CGNode n){
  if (!cgNodesVisited.contains(cg.getNumber(n)) && relevant.test(n)) {
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + n);
    }
    cgNodesVisited.add(cg.getNumber(n));
    ControlFlowGraph<SSAInstruction,T> cfg=getCFG(n);
    if (cfg != null) {
      addNodeForEachBasicBlock(cfg,n);
      SSAInstruction[] instrs=cfg.getInstructions();
      for (Iterator<T> bbs=cfg.iterator(); bbs.hasNext(); ) {
        T bb=bbs.next();
        if (bb != cfg.entry())         addEdgesToNonEntryBlock(n,cfg,instrs,bb);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * If n is relevant and its cfg has not already been added, add nodes and edges for n
 * @param n
 */
@SuppressWarnings("String_Node_Str") private void addIntraproceduralNodesAndEdgesForCGNodeIfNeeded(CGNode n){
  if (!cgNodesVisited.contains(cg.getNumber(n)) && relevant.test(n)) {
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + n);
    }
    cgNodesVisited.add(cg.getNumber(n));
    ControlFlowGraph<SSAInstruction,T> cfg=getCFG(n);
    if (cfg != null) {
      addNodeForEachBasicBlock(cfg,n);
      SSAInstruction[] instrs=cfg.getInstructions();
      for (Iterator<T> bbs=cfg.iterator(); bbs.hasNext(); ) {
        T bb=bbs.next();
        if (bb != cfg.entry())         addEdgesToNonEntryBlock(n,cfg,instrs,bb);
      }
    }
  }
}
Program: 99657
Project: 99657
Buggy source:
/** 
 * Add the incoming edges to the entry() block and the outgoing edges from the exit() block for a call graph node.
 * @param n a node in the call graph
 * @param bb the entry() block for n
 */
private void addInterproceduralEdgesForEntryAndExitBlocks(CGNode n,ControlFlowGraph<SSAInstruction,? extends T> cfg){
  T entryBlock=cfg.entry();
  T exitBlock=cfg.exit();
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + n);
  }
  for (Iterator callers=cg.getPredNodes(n); callers.hasNext(); ) {
    CGNode caller=(CGNode)callers.next();
    if (DEBUG_LEVEL > 1) {
      System.err.println("String_Node_Str" + caller);
    }
    if (relevant.test(caller)) {
      addEntryAndExitEdgesToCaller(n,entryBlock,exitBlock,caller);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add the incoming edges to the entry() block and the outgoing edges from the exit() block for a call graph node.
 * @param n a node in the call graph
 * @param bb the entry() block for n
 */
@SuppressWarnings("String_Node_Str") private void addInterproceduralEdgesForEntryAndExitBlocks(CGNode n,ControlFlowGraph<SSAInstruction,? extends T> cfg){
  T entryBlock=cfg.entry();
  T exitBlock=cfg.exit();
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + n);
  }
  for (Iterator callers=cg.getPredNodes(n); callers.hasNext(); ) {
    CGNode caller=(CGNode)callers.next();
    if (DEBUG_LEVEL > 1) {
      System.err.println("String_Node_Str" + caller);
    }
    if (relevant.test(caller)) {
      addEntryAndExitEdgesToCaller(n,entryBlock,exitBlock,caller);
    }
  }
}
Program: 99658
Project: 99658
Buggy source:
/** 
 * Add a node to the IPCFG for each node in a CFG. side effect: populates the hasCallVector
 * @param cfg a control-flow graph
 */
private void addNodeForEachBasicBlock(ControlFlowGraph<? extends SSAInstruction,? extends T> cfg,CGNode N){
  for (Iterator<? extends T> bbs=cfg.iterator(); bbs.hasNext(); ) {
    T bb=bbs.next();
    if (DEBUG_LEVEL > 1) {
      System.err.println("String_Node_Str" + bb);
    }
    BasicBlockInContext<T> b=new BasicBlockInContext<T>(N,bb);
    addNodeForBasicBlockIfNeeded(b);
  }
}

Fixed version (ground truth):
/** 
 * Add a node to the IPCFG for each node in a CFG. side effect: populates the hasCallVector
 * @param cfg a control-flow graph
 */
@SuppressWarnings("String_Node_Str") private void addNodeForEachBasicBlock(ControlFlowGraph<? extends SSAInstruction,? extends T> cfg,CGNode N){
  for (Iterator<? extends T> bbs=cfg.iterator(); bbs.hasNext(); ) {
    T bb=bbs.next();
    if (DEBUG_LEVEL > 1) {
      System.err.println("String_Node_Str" + bb);
    }
    BasicBlockInContext<T> b=new BasicBlockInContext<T>(N,bb);
    addNodeForBasicBlockIfNeeded(b);
  }
}
Program: 99659
Project: 99659
Buggy source:
/** 
 * Add an edge from the exit() block of a callee to a return site in the caller
 * @param returnBlock the return site for a call
 * @param targetCFG the called method
 */
private void addEdgesFromExitToReturn(CGNode caller,T returnBlock,CGNode target,ControlFlowGraph<SSAInstruction,? extends T> targetCFG){
}

Fixed version (ground truth):
/** 
 * Add an edge from the exit() block of a callee to a return site in the caller
 * @param returnBlock the return site for a call
 * @param targetCFG the called method
 */
@SuppressWarnings("String_Node_Str") private void addEdgesFromExitToReturn(CGNode caller,T returnBlock,CGNode target,ControlFlowGraph<SSAInstruction,? extends T> targetCFG){
}
Program: 99660
Project: 99660
Buggy source:
/** 
 * add edges to callee entry for call block, and edges from callee exit to corresponding return blocks
 */
private void addCalleeEdgesForCall(CGNode n,BasicBlockInContext<T> callBlock){
  int num=g.getNumber(callBlock);
  if (!handledCalls.contains(num)) {
    handledCalls.add(num);
    ControlFlowGraph<SSAInstruction,T> cfg=getCFG(n);
    CallSiteReference site=getCallSiteForCallBlock(callBlock,cfg);
    if (DEBUG_LEVEL > 1) {
      System.err.println("String_Node_Str" + site);
    }
    boolean irrelevantTargets=false;
    for (Iterator ts=cg.getPossibleTargets(n,site).iterator(); ts.hasNext(); ) {
      CGNode tn=(CGNode)ts.next();
      if (!relevant.test(tn)) {
        if (DEBUG_LEVEL > 1) {
          System.err.println("String_Node_Str" + tn);
        }
        irrelevantTargets=true;
        continue;
      }
      if (DEBUG_LEVEL > 1) {
        System.err.println("String_Node_Str" + tn);
      }
      ControlFlowGraph<SSAInstruction,? extends T> tcfg=getCFG(tn);
      if (tcfg != null) {
        final T cbDelegate=callBlock.getDelegate();
        addEdgesFromCallToEntry(n,cbDelegate,tn,tcfg);
        for (Iterator<? extends T> returnBlocks=cfg.getSuccNodes(cbDelegate); returnBlocks.hasNext(); ) {
          T retBlock=returnBlocks.next();
          addEdgesFromExitToReturn(n,retBlock,tn,tcfg);
          if (irrelevantTargets) {
            g.addEdge(callBlock,new BasicBlockInContext<T>(n,retBlock));
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * add edges to callee entry for call block, and edges from callee exit to corresponding return blocks
 */
@SuppressWarnings("String_Node_Str") private void addCalleeEdgesForCall(CGNode n,BasicBlockInContext<T> callBlock){
  int num=g.getNumber(callBlock);
  if (!handledCalls.contains(num)) {
    handledCalls.add(num);
    ControlFlowGraph<SSAInstruction,T> cfg=getCFG(n);
    CallSiteReference site=getCallSiteForCallBlock(callBlock,cfg);
    if (DEBUG_LEVEL > 1) {
      System.err.println("String_Node_Str" + site);
    }
    boolean irrelevantTargets=false;
    for (Iterator ts=cg.getPossibleTargets(n,site).iterator(); ts.hasNext(); ) {
      CGNode tn=(CGNode)ts.next();
      if (!relevant.test(tn)) {
        if (DEBUG_LEVEL > 1) {
          System.err.println("String_Node_Str" + tn);
        }
        irrelevantTargets=true;
        continue;
      }
      if (DEBUG_LEVEL > 1) {
        System.err.println("String_Node_Str" + tn);
      }
      ControlFlowGraph<SSAInstruction,? extends T> tcfg=getCFG(tn);
      if (tcfg != null) {
        final T cbDelegate=callBlock.getDelegate();
        addEdgesFromCallToEntry(n,cbDelegate,tn,tcfg);
        for (Iterator<? extends T> returnBlocks=cfg.getSuccNodes(cbDelegate); returnBlocks.hasNext(); ) {
          T retBlock=returnBlocks.next();
          addEdgesFromExitToReturn(n,retBlock,tn,tcfg);
          if (irrelevantTargets) {
            g.addEdge(callBlock,new BasicBlockInContext<T>(n,retBlock));
          }
        }
      }
    }
  }
}
Program: 99661
Project: 99661
Buggy source:
public SummarizedMethodWithNames(MethodReference ref,VolatileMethodSummary summary,IClass declaringClass) throws NullPointerException {
  super(ref,summary.getMethodSummary(),declaringClass);
  this.summary=summary.getMethodSummary();
  this.localNames=((VolatileMethodSummary)summary).getLocalNames();
  if (DEBUG && this.localNames.isEmpty()) {
    System.err.println("String_Node_Str" + ref);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public SummarizedMethodWithNames(MethodReference ref,VolatileMethodSummary summary,IClass declaringClass) throws NullPointerException {
  super(ref,summary.getMethodSummary(),declaringClass);
  this.summary=summary.getMethodSummary();
  this.localNames=((VolatileMethodSummary)summary).getLocalNames();
  if (DEBUG && this.localNames.isEmpty()) {
    System.err.println("String_Node_Str" + ref);
  }
}
Program: 99665
Project: 99665
Buggy source:
/** 
 * If the function associated with the node is handled by this class.
 * @throws IllegalArgumentException if the given node is null
 */
@Override public boolean understands(CGNode node){
  if (node == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final MethodReference target=node.getMethod().getReference();
{
    if (target.toString().contains("String_Node_Str")) {
      return true;
    }
  }
  return (intentStarters.isStarter(target));
}

Fixed version (ground truth):
/** 
 * If the function associated with the node is handled by this class.
 * @throws IllegalArgumentException if the given node is null
 */
@Override public boolean understands(CGNode node){
  if (node == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final MethodReference target=node.getMethod().getReference();
  return (intentStarters.isStarter(target));
}
Program: 99666
Project: 99666
Buggy source:
public SymbolicPropagator(DexCFG dexCFG,SSAInstruction[] instructions,SSA2LocalMap localMap,SSACFG cfg,SSAPiNodePolicy piNodePolicy){
  super(dexCFG);
  this.piNodePolicy=null;
  this.cfg=cfg;
  this.creators=new SSAInstruction[0];
  this.dexCFG=dexCFG;
  this.instructions=instructions;
  this.loader=dexCFG.getMethod().getDeclaringClass().getClassLoader().getReference();
  init(this.new NodeVisitor(cfg),this.new EdgeVisitor());
}

Fixed version (ground truth):
public SymbolicPropagator(DexCFG dexCFG,SSAInstruction[] instructions,SSA2LocalMap localMap,SSACFG cfg,SSAPiNodePolicy piNodePolicy){
  super(dexCFG);
  this.piNodePolicy=piNodePolicy;
  this.cfg=cfg;
  this.creators=new SSAInstruction[0];
  this.dexCFG=dexCFG;
  this.instructions=instructions;
  this.loader=dexCFG.getMethod().getDeclaringClass().getClassLoader().getReference();
  init(this.new NodeVisitor(cfg),this.new EdgeVisitor());
}
Program: 99669
Project: 99669
Buggy source:
public IntraproceduralNullPointerAnalysis(IR ir){
  if (ir == null || ir.isEmptyIR()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.ir=ir;
  final int maxVarNum=ir.getSymbolTable().getMaxValueNumber();
  final int[] paramValNum=ir.getParameterValueNumbers();
  final NullPointerFrameWork<ISSABasicBlock> problem=new NullPointerFrameWork<ISSABasicBlock>(ir.getControlFlowGraph(),ir);
  this.solver=new NullPointerSolver<ISSABasicBlock>(problem,maxVarNum,paramValNum,ir);
  try {
    this.solver.solve(NO_PROGRESS_MONITOR);
  }
 catch (  final CancelException e) {
  }
}

Fixed version (ground truth):
public IntraproceduralNullPointerAnalysis(IR ir){
  if (ir == null || ir.isEmptyIR()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.ir=ir;
  final int maxVarNum=ir.getSymbolTable().getMaxValueNumber();
  final int[] paramValNum=ir.getParameterValueNumbers();
  SSACFG cfg=ir.getControlFlowGraph();
  final NullPointerFrameWork<ISSABasicBlock> problem=new NullPointerFrameWork<ISSABasicBlock>(cfg,ir);
  this.solver=new NullPointerSolver<ISSABasicBlock>(problem,maxVarNum,paramValNum,ir,cfg.entry());
  try {
    this.solver.solve(NO_PROGRESS_MONITOR);
  }
 catch (  final CancelException e) {
  }
}
Program: 99670
Project: 99670
Buggy source:
public void addPhi(Integer dst,Integer src1,Integer src2){
  this.phis.add(dst);
  this.addEdge(src1,dst);
  this.addEdge(src2,dst);
}

Fixed version (ground truth):
public void addPhi(Integer dst){
  this.phis.add(dst);
}
Program: 99671
Project: 99671
Buggy source:
@Override public List<Pair<Integer,SSAInstruction>> getPis(SSAConditionalBranchInstruction cond,SSAInstruction def1,SSAInstruction def2,SymbolTable symbolTable){
  LinkedList<Pair<Integer,SSAInstruction>> result=new LinkedList<>();
  result.addAll(getPis(cond,def1,def2,symbolTable));
  return result;
}

Fixed version (ground truth):
@Override public List<Pair<Integer,SSAInstruction>> getPis(SSAConditionalBranchInstruction cond,SSAInstruction def1,SSAInstruction def2,SymbolTable symbolTable){
  LinkedList<Pair<Integer,SSAInstruction>> result=new LinkedList<>();
  result.addAll(p1.getPis(cond,def1,def2,symbolTable));
  result.addAll(p2.getPis(cond,def1,def2,symbolTable));
  return result;
}
Program: 99672
Project: 99672
Buggy source:
@Override public boolean hasNormalEdge(Block src,Block dst){
  boolean result=true;
  final SSAInstruction relevantInstruction=src.getLastInstruction();
  if (relevantInstruction != null && this.filter.alwaysThrowsException(relevantInstruction)) {
    result=false;
  }
  return result && this.cfg.getNormalSuccessors(src).contains(dst);
}

Fixed version (ground truth):
@Override public boolean hasNormalEdge(Block src,Block dst){
  boolean result=true;
  if (src.getLastInstructionIndex() >= 0) {
    final SSAInstruction relevantInstruction=src.getLastInstruction();
    if (relevantInstruction != null && this.filter.alwaysThrowsException(relevantInstruction)) {
      result=false;
    }
  }
  return result && this.cfg.getNormalSuccessors(src).contains(dst);
}
Program: 99673
Project: 99673
Buggy source:
/** 
 * @return true iff there's a unique catch block which catches all exceptions thrown by a certain call site.
 */
protected static boolean hasUniqueCatchBlock(SSAAbstractInvokeInstruction call,IR ir){
  ISSABasicBlock[] bb=ir.getBasicBlocksForCall(call.getCallSite());
  if (bb.length == 1) {
    Iterator it=ir.getControlFlowGraph().getExceptionalSuccessors(bb[0]).iterator();
    if (it.hasNext()) {
      it.next();
      return (!it.hasNext());
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return true iff there's a unique catch block which catches all exceptions thrown by a certain call site.
 */
protected static boolean hasUniqueCatchBlock(SSAAbstractInvokeInstruction call,IR ir){
  ISSABasicBlock[] bb=ir.getBasicBlocksForCall(call.getCallSite());
  if (bb.length == 1) {
    Iterator<ISSABasicBlock> it=ir.getControlFlowGraph().getExceptionalSuccessors(bb[0]).iterator();
    if (it.hasNext()) {
      ISSABasicBlock sb=it.next();
      return (!it.hasNext() && (sb.isExitBlock() || ((sb instanceof ExceptionHandlerBasicBlock) && ((ExceptionHandlerBasicBlock)sb).getCatchInstruction() != null)));
    }
  }
  return false;
}
Program: 99674
Project: 99674
Buggy source:
/** 
 * @param pc the byte code index.
 * @return The index of the instruction of given byte code index
 */
public int getIndexFromPc(int pc){
  return pc2index.get(pc);
}

Fixed version (ground truth):
/** 
 * @param pc the byte code index.
 * @return The index of the instruction of given byte code index
 */
public int getIndexFromPc(int pc){
  if (!pc2index.containsKey(pc) && pc2index.containsKey(pc + 1)) {
    pc++;
  }
  return pc2index.get(pc);
}
Program: 99675
Project: 99675
Buggy source:
private void computeCasesAndLabels(){
  casesAndLabels=pad.getLabelsAndOffsets();
  for (int i=1; i < casesAndLabels.length; i+=2)   casesAndLabels[i]=method.getInstructionIndex(pc + casesAndLabels[i]);
  defaultLabel=method.getInstructionIndex(pc + pad.getDefaultOffset());
}

Fixed version (ground truth):
private void computeCasesAndLabels(){
  casesAndLabels=pad.getLabelsAndOffsets();
  for (int i=1; i < casesAndLabels.length; i+=2)   casesAndLabels[i]=pc + casesAndLabels[i];
  defaultLabel=pc + pad.getDefaultOffset();
}
Program: 99676
Project: 99676
Buggy source:
@Override public int[] getBranchTargets(){
  int[] r=new int[casesAndLabels.length / 2 + 1];
  r[0]=defaultLabel;
  for (int i=1; i < r.length; i++) {
    r[i]=casesAndLabels[(i - 1) * 2 + 1];
  }
  return r;
}

Fixed version (ground truth):
@Override public int[] getBranchTargets(){
  int[] r=new int[casesAndLabels.length / 2 + 1];
  r[0]=method.getInstructionIndex(defaultLabel);
  for (int i=1; i < r.length; i++) {
    r[i]=method.getInstructionIndex(casesAndLabels[(i - 1) * 2 + 1]);
  }
  return r;
}
Program: 99677
Project: 99677
Buggy source:
@Override public void performVerboseAction(){
  super.performVerboseAction();
  if (DEBUG_MEMORY) {
    DEBUG_MEM_COUNTER++;
    if (DEBUG_MEM_COUNTER % DEBUG_MEM_INTERVAL == 0) {
      DEBUG_MEM_COUNTER=0;
      ReferenceCleanser.clearSoftCaches();
      System.err.println(flowGraph.spaceReport());
      System.err.println("String_Node_Str");
      HeapTracer.traceHeap(Collections.singleton(this),true);
      System.err.println("String_Node_Str");
    }
  }
  if (getFixedPointSystem() instanceof VerboseAction) {
    ((VerboseAction)getFixedPointSystem()).performVerboseAction();
  }
  AbstractStatement s=workList.takeStatement();
  System.err.println(printRHSInstances(s));
  workList.insertStatement(s);
  System.err.println("String_Node_Str" + cg.getNumberOfNodes());
}

Fixed version (ground truth):
@Override public void performVerboseAction(){
  super.performVerboseAction();
  if (DEBUG_MEMORY) {
    DEBUG_MEM_COUNTER++;
    if (DEBUG_MEM_COUNTER % DEBUG_MEM_INTERVAL == 0) {
      DEBUG_MEM_COUNTER=0;
      ReferenceCleanser.clearSoftCaches();
      System.err.println(flowGraph.spaceReport());
      System.err.println("String_Node_Str");
      HeapTracer.traceHeap(Collections.singleton(this),true);
      System.err.println("String_Node_Str");
    }
  }
  if (getFixedPointSystem() instanceof VerboseAction) {
    ((VerboseAction)getFixedPointSystem()).performVerboseAction();
  }
  if (!workList.isEmpty()) {
    AbstractStatement s=workList.takeStatement();
    System.err.println(printRHSInstances(s));
    workList.insertStatement(s);
    System.err.println("String_Node_Str" + cg.getNumberOfNodes());
  }
}
Program: 99679
Project: 99679
Buggy source:
public void addStatement(NullaryStatement<?> s){
  if (s == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IVariable<?> lhs=s.getLHS();
  graph.addNode(s);
  if (lhs != null) {
    variables.add(lhs);
    graph.addNode(lhs);
    graph.addEdge(s,lhs);
  }
  if (DEBUG) {
    checkGraph();
  }
}

Fixed version (ground truth):
public void addStatement(NullaryStatement<?> s){
  if (s == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IVariable<?> lhs=s.getLHS();
  equations.add(s);
  graph.addNode(s);
  if (lhs != null) {
    variables.add(lhs);
    graph.addNode(lhs);
    graph.addEdge(s,lhs);
  }
  if (DEBUG) {
    checkGraph();
  }
}