nus-yam/ex-repair huggingface dataset:
Program: 40682
Project: 40682
Buggy source:
/** 
 * Find the possible receivers of a call to a method reference
 * @param ref method reference
 * @return the set of IMethods that this call can resolve to.
 */
private Set<IMethod> computePossibleTargets(IClass declaredClass,MethodReference ref){
  if (declaredClass.isInterface()) {
    HashSet<IMethod> result=HashSetFactory.make(3);
    Set impls=implementors.get(declaredClass);
    if (impls == null) {
      return Collections.emptySet();
    }
    for (Iterator it=impls.iterator(); it.hasNext(); ) {
      IClass klass=(IClass)it.next();
      if (Assertions.verifyAssertions) {
        Assertions._assert(!klass.isInterface());
      }
      result.addAll(computeTargetsNotInterface(ref,klass));
    }
    return result;
  }
 else {
    return computeTargetsNotInterface(ref,declaredClass);
  }
}

Fixed version (ground truth):
/** 
 * Find the possible receivers of a call to a method reference
 * @param ref method reference
 * @return the set of IMethods that this call can resolve to.
 */
private Set<IMethod> computePossibleTargets(IClass declaredClass,MethodReference ref){
  if (declaredClass.isInterface()) {
    HashSet<IMethod> result=HashSetFactory.make(3);
    Set impls=implementors.get(declaredClass);
    if (impls == null) {
      return Collections.emptySet();
    }
    for (Iterator it=impls.iterator(); it.hasNext(); ) {
      IClass klass=(IClass)it.next();
      if (!klass.isInterface()) {
        result.addAll(computeTargetsNotInterface(ref,klass));
      }
    }
    return result;
  }
 else {
    return computeTargetsNotInterface(ref,declaredClass);
  }
}
Program: 40683
Project: 40683
Buggy source:
/** 
 * Does an expression c1 x := c2 y typecheck? i.e. is c2 a subtype of c1?
 * @throws IllegalArgumentException if c1 is null
 * @throws IllegalArgumentException if c2 is null
 */
public boolean isAssignableFrom(IClass c1,IClass c2){
  if (c2 == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (c1 == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (c1.isInterface()) {
    if (c2.isInterface()) {
      return isSubclassOf(c2,c1);
    }
 else {
      return implementsInterface(c2,c1.getReference());
    }
  }
 else {
    if (c2.isInterface()) {
      return c1.equals(getRootClass());
    }
 else {
      return isSubclassOf(c2,c1);
    }
  }
}

Fixed version (ground truth):
/** 
 * Does an expression c1 x := c2 y typecheck? i.e. is c2 a subtype of c1?
 * @throws IllegalArgumentException if c1 is null
 * @throws IllegalArgumentException if c2 is null
 */
public boolean isAssignableFrom(IClass c1,IClass c2){
  if (c2 == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (c1 == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (c1.isInterface()) {
    return implementsInterface(c2,c1);
  }
 else {
    if (c2.isInterface()) {
      return c1.equals(getRootClass());
    }
 else {
      return isSubclassOf(c2,c1);
    }
  }
}
Program: 40684
Project: 40684
Buggy source:
/** 
 * Does c implement T?
 * @return true iff T is an interface and c is a class that implements T,
 */
public boolean implementsInterface(IClass c,TypeReference T);

Fixed version (ground truth):
/** 
 * Does c implement i?
 * @return true iff i is an interface and c is a class that implements i,
 */
public boolean implementsInterface(IClass c,IClass i);
Program: 40685
Project: 40685
Buggy source:
public Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException {
  Collection<IClass> realIfaces=realType.isInterface() ? realType.getAllAncestorInterfaces() : realType.getAllImplementedInterfaces();
  if (realType.isInterface()) {
    HashSet<IClass> result=HashSetFactory.make(realIfaces);
    result.add(realType);
    return result;
  }
 else {
    return realIfaces;
  }
}

Fixed version (ground truth):
public Collection<IClass> getAllImplementedInterfaces() throws ClassHierarchyException {
  Collection<IClass> realIfaces=realType.getAllImplementedInterfaces();
  if (realType.isInterface()) {
    HashSet<IClass> result=HashSetFactory.make(realIfaces);
    result.add(realType);
    return result;
  }
 else {
    return realIfaces;
  }
}
Program: 40686
Project: 40686
Buggy source:
public static <T>Dominators make(Graph<T> G,T root){
  if (G instanceof NumberedGraph) {
    return new NumberedDominators((NumberedGraph)G,(INodeWithNumber)root);
  }
 else {
    return new GenericDominators(G,root);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T>Dominators<T> make(Graph<T> G,T root){
  if (G instanceof NumberedGraph && root instanceof INodeWithNumber) {
    return new NumberedDominators((NumberedGraph)G,(INodeWithNumber)root);
  }
 else {
    return new GenericDominators<T>(G,root);
  }
}
Program: 40687
Project: 40687
Buggy source:
public String toString(){
  StringBuffer sb=new StringBuffer();
  for (Iterator<? extends T> i=G.iterator(); i.hasNext(); ) {
    T node=i.next();
    sb.append("String_Node_Str" + node + "String_Node_Str");
    for (Iterator j=dominators(node); j.hasNext(); )     sb.append("String_Node_Str" + j.next() + "String_Node_Str");
    sb.append("String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer sb=new StringBuffer();
  for (Iterator<? extends T> i=G.iterator(); i.hasNext(); ) {
    T node=i.next();
    sb.append("String_Node_Str" + node + "String_Node_Str");
    for (Iterator j=dominators(node); j.hasNext(); )     sb.append("String_Node_Str" + j.next() + "String_Node_Str");
    sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 40688
Project: 40688
Buggy source:
protected DominatorInfo getInfo(T node){
  if (!infoMap.containsKey(node))   infoMap.put(node,new DominatorInfo(node));
  return infoMap.get(node);
}

Fixed version (ground truth):
@Override protected DominatorInfo getInfo(T node){
  if (!infoMap.containsKey(node))   infoMap.put(node,new DominatorInfo(node));
  return infoMap.get(node);
}
Program: 40689
Project: 40689
Buggy source:
protected final DominatorInfo getInfo(T node){
  return (DominatorInfo)infoMap[node.getGraphNodeId()];
}

Fixed version (ground truth):
@Override protected final DominatorInfo getInfo(T node){
  return (DominatorInfo)infoMap[node.getGraphNodeId()];
}
Program: 40690
Project: 40690
Buggy source:
public NumberedGraph<T> getGraph(){
  return (NumberedGraph)G;
}

Fixed version (ground truth):
@Override public NumberedGraph<T> getGraph(){
  return (NumberedGraph<T>)G;
}
Program: 40692
Project: 40692
Buggy source:
/** 
 * @return Returns the iKeyFactory.
 */
protected ClassBasedInstanceKeys getIKeyFactory(){
  return iKeyFactory;
}

Fixed version (ground truth):
protected ClassBasedInstanceKeys getIKeyFactory(){
  return iKeyFactory;
}
Program: 40693
Project: 40693
Buggy source:
/** 
 */
private Map<PointerKey,Object> computePointerKeys(IClass klass){
  Map<PointerKey,Object> result=HashMapFactory.make();
  if (klass.isArrayClass()) {
    ArrayClass a=(ArrayClass)klass;
    if (a.getElementClass() != null && a.getElementClass().isReferenceType()) {
      PointerKey p=pointerKeys.getPointerKeyForArrayContents(new ConcreteTypeKey(a));
      result.put(p,p);
    }
  }
 else {
    try {
      for (Iterator<IField> it=klass.getAllFields().iterator(); it.hasNext(); ) {
        IField f=it.next();
        if (!f.getFieldTypeReference().isPrimitiveType()) {
          if (f.isStatic()) {
            PointerKey p=pointerKeys.getPointerKeyForStaticField(f);
            result.put(p,p);
          }
 else {
            PointerKey p=pointerKeys.getPointerKeyForInstanceField(new ConcreteTypeKey(klass),f);
            result.put(p,p);
          }
        }
      }
    }
 catch (    ClassHierarchyException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
  return result;
}

Fixed version (ground truth):
private Map<PointerKey,Object> computePointerKeys(IClass klass){
  Map<PointerKey,Object> result=HashMapFactory.make();
  if (klass.isArrayClass()) {
    ArrayClass a=(ArrayClass)klass;
    if (a.getElementClass() != null && a.getElementClass().isReferenceType()) {
      PointerKey p=pointerKeys.getPointerKeyForArrayContents(new ConcreteTypeKey(a));
      result.put(p,p);
    }
  }
 else {
    try {
      for (Iterator<IField> it=klass.getAllFields().iterator(); it.hasNext(); ) {
        IField f=it.next();
        if (!f.getFieldTypeReference().isPrimitiveType()) {
          if (f.isStatic()) {
            PointerKey p=pointerKeys.getPointerKeyForStaticField(f);
            result.put(p,p);
          }
 else {
            PointerKey p=pointerKeys.getPointerKeyForInstanceField(new ConcreteTypeKey(klass),f);
            result.put(p,p);
          }
        }
      }
    }
 catch (    ClassHierarchyException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
  return result;
}
Program: 40694
Project: 40694
Buggy source:
public PointerKey getPointerKeyForLocal(CGNode node,int valueNumber){
  initPKeysForNode(node);
  PointerKey p=pointerKeys.getPointerKeyForLocal(node,valueNumber);
  Object result=pKeys.get(p);
  if (result == null) {
    return null;
  }
  if (result instanceof FilteredPointerKey) {
    return (PointerKey)result;
  }
 else {
    if (result instanceof ConcreteTypeKey) {
      ConcreteTypeKey c=(ConcreteTypeKey)result;
      if (c.getConcreteType().getReference().equals(TypeReference.JavaLangString)) {
        return pointerKeys.getFilteredPointerKeyForLocal(node,valueNumber,new FilteredPointerKey.SingleClassFilter(c.getConcreteType()));
      }
 else {
        Assertions.UNREACHABLE("String_Node_Str" + result.getClass());
        return null;
      }
    }
 else {
      Assertions.UNREACHABLE("String_Node_Str" + result.getClass());
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Note that this always returns a    {@link FilteredPointerKey}, since the   {@link TypeBasedPointerAnalysis} relies on thetype filter to compute points to sets.
 * @see com.ibm.wala.ipa.callgraph.propagation.PointerKeyFactory#getPointerKeyForLocal(com.ibm.wala.ipa.callgraph.CGNode,int)
 */
public FilteredPointerKey getPointerKeyForLocal(CGNode node,int valueNumber){
  initPKeysForNode(node);
  PointerKey p=pointerKeys.getPointerKeyForLocal(node,valueNumber);
  Object result=pKeys.get(p);
  if (result == null) {
    return null;
  }
  if (result instanceof FilteredPointerKey) {
    return (FilteredPointerKey)result;
  }
 else {
    if (result instanceof ConcreteTypeKey) {
      ConcreteTypeKey c=(ConcreteTypeKey)result;
      if (c.getConcreteType().getReference().equals(TypeReference.JavaLangString)) {
        return pointerKeys.getFilteredPointerKeyForLocal(node,valueNumber,new FilteredPointerKey.SingleClassFilter(c.getConcreteType()));
      }
 else {
        Assertions.UNREACHABLE("String_Node_Str" + result.getClass());
        return null;
      }
    }
 else {
      Assertions.UNREACHABLE("String_Node_Str" + result.getClass());
      return null;
    }
  }
}
Program: 40695
Project: 40695
Buggy source:
/** 
 * Compute the set of   {@link InstanceKey}s which may represent a particular type.
 */
private OrdinalSet<InstanceKey> computeOrdinalInstanceSet(IClass type){
  Collection<IClass> klasses=null;
  if (type.isInterface()) {
    klasses=getCallGraph().getClassHierarchy().getImplementors(type.getReference());
  }
 else {
    Collection<IClass> sc=getCallGraph().getClassHierarchy().computeSubClasses(type.getReference());
    klasses=HashSetFactory.make();
    for (    IClass c : sc) {
      if (!c.isInterface()) {
        klasses.add(c);
      }
    }
  }
  klasses=HashSetFactory.make(klasses);
  klasses.retainAll(this.klasses);
  OrdinalSet<InstanceKey> result=toOrdinalInstanceKeySet(klasses);
  return result;
}

Fixed version (ground truth):
/** 
 * Compute the set of   {@link InstanceKey}s which may represent a particular type.
 */
private OrdinalSet<InstanceKey> computeOrdinalInstanceSet(IClass type){
  Collection<IClass> klasses=null;
  if (type.isInterface()) {
    klasses=getCallGraph().getClassHierarchy().getImplementors(type.getReference());
  }
 else {
    Collection<IClass> sc=getCallGraph().getClassHierarchy().computeSubClasses(type.getReference());
    klasses=HashSetFactory.make();
    for (    IClass c : sc) {
      if (!c.isInterface()) {
        klasses.add(c);
      }
    }
  }
  Collection<IClass> c=HashSetFactory.make();
  for (  IClass klass : klasses) {
    if (klass.isArrayClass()) {
      c.add(klass);
    }
 else     if (this.klasses.contains(klass)) {
      c.add(klass);
    }
  }
  OrdinalSet<InstanceKey> result=toOrdinalInstanceKeySet(c);
  return result;
}
Program: 40696
Project: 40696
Buggy source:
/** 
 * @param klasses Collection<IClass>
 * @throws AssertionError  if klasses is null
 */
private TypeBasedPointerAnalysis(AnalysisOptions options,Collection<IClass> klasses,CallGraph cg) throws AssertionError {
  super(cg,makeInstanceKeys(klasses));
  this.klasses=klasses;
  heapModel=new TypeBasedHeapModel(options,klasses,cg);
}

Fixed version (ground truth):
/** 
 * @param klasses Collection<IClass>
 * @throws AssertionError if klasses is null
 */
private TypeBasedPointerAnalysis(AnalysisOptions options,Collection<IClass> klasses,CallGraph cg) throws AssertionError {
  super(cg,makeInstanceKeys(klasses));
  this.klasses=klasses;
  heapModel=new TypeBasedHeapModel(options,klasses,cg);
}
Program: 40697
Project: 40697
Buggy source:
/** 
 * @throws IllegalArgumentException if dst is null
 */
public void addExceptionalEdge(T src,T dst){
  if (dst == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (dst.equals(exit())) {
    exceptionalToExit.set(getNumber(src));
  }
 else {
    exceptionalEdgeManager.addEdge(src,dst);
    SimpleIntVector v=exceptionalSuccessors.get(getNumber(src));
    if (v == null) {
      v=new SimpleIntVector(-1);
      exceptionalSuccessors.set(getNumber(src),v);
    }
    v.set(v.getMaxIndex() + 1,getNumber(dst));
  }
}

Fixed version (ground truth):
/** 
 * @throws IllegalArgumentException if dst is null
 */
public void addExceptionalEdge(T src,T dst){
  if (dst == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (dst.equals(exit())) {
    exceptionalToExit.set(getNumber(src));
  }
 else {
    exceptionalEdgeManager.addEdge(src,dst);
    SimpleIntVector v=exceptionalSuccessors.get(getNumber(src));
    if (v == null) {
      v=new SimpleIntVector(-1);
      exceptionalSuccessors.set(getNumber(src),v);
      v.set(0,getNumber(dst));
      return;
    }
    if (v.get(v.getMaxIndex()) != getNumber(dst)) {
      v.set(v.getMaxIndex() + 1,getNumber(dst));
    }
  }
}
Program: 40698
Project: 40698
Buggy source:
private OrdinalSet<InstanceKey> toOrdinalInstanceKeySet(Collection c){
  BimodalMutableIntSet s=new BimodalMutableIntSet();
  for (Iterator it=c.iterator(); it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    int index=getInstanceKeyMapping().getMappedIndex(new ConcreteTypeKey(klass));
    if (index >= 0) {
      s.add(index);
    }
  }
  return new OrdinalSet<InstanceKey>(s,getInstanceKeyMapping());
}

Fixed version (ground truth):
private OrdinalSet<InstanceKey> toOrdinalInstanceKeySet(Collection c){
  BimodalMutableIntSet s=new BimodalMutableIntSet();
  for (Iterator it=c.iterator(); it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    int index=getInstanceKeyMapping().add(new ConcreteTypeKey(klass));
    s.add(index);
  }
  return new OrdinalSet<InstanceKey>(s,getInstanceKeyMapping());
}
Program: 40700
Project: 40700
Buggy source:
/** 
 * TODO: move this elsewhere. Move it into shrike and develop new way to track peis.
 * @throws IllegalArgumentException  if s is null
 */
public static boolean isPEI(Instruction s){
  if (s == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (s.getOpcode()) {
case OP_iaload:
case OP_laload:
case OP_faload:
case OP_daload:
case OP_aaload:
case OP_baload:
case OP_caload:
case OP_saload:
case OP_iastore:
case OP_lastore:
case OP_fastore:
case OP_dastore:
case OP_aastore:
case OP_bastore:
case OP_castore:
case OP_sastore:
case OP_getfield:
case OP_putfield:
case OP_idiv:
case OP_invokevirtual:
case OP_invokespecial:
case OP_invokestatic:
case OP_invokeinterface:
case OP_irem:
case OP_new:
case OP_newarray:
case OP_anewarray:
case OP_arraylength:
case OP_athrow:
case OP_checkcast:
case OP_monitorenter:
case OP_monitorexit:
case OP_multianewarray:
    return true;
case OP_ldc_w:
  return (((ConstantInstruction)s).getType().equals(TYPE_Class));
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * TODO: move this elsewhere. Move it into shrike and develop new way to track peis.
 * @throws IllegalArgumentException  if s is null
 */
public static boolean isPEI(Instruction s){
  if (s == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (s.getOpcode()) {
case OP_iaload:
case OP_laload:
case OP_faload:
case OP_daload:
case OP_aaload:
case OP_baload:
case OP_caload:
case OP_saload:
case OP_iastore:
case OP_lastore:
case OP_fastore:
case OP_dastore:
case OP_aastore:
case OP_bastore:
case OP_castore:
case OP_sastore:
case OP_getfield:
case OP_putfield:
case OP_idiv:
case OP_invokevirtual:
case OP_invokespecial:
case OP_invokestatic:
case OP_invokeinterface:
case OP_irem:
case OP_ldiv:
case OP_lrem:
case OP_new:
case OP_newarray:
case OP_anewarray:
case OP_arraylength:
case OP_athrow:
case OP_checkcast:
case OP_monitorenter:
case OP_monitorexit:
case OP_multianewarray:
    return true;
case OP_ldc_w:
  return (((ConstantInstruction)s).getType().equals(TYPE_Class));
default :
return false;
}
}
Program: 40701
Project: 40701
Buggy source:
@Override public void putAll(Map<? extends K,? extends V> arg0){
  if (arg0 == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  Map.Entry<K,V> E : entrySet()) {
    put(E.getKey(),E.getValue());
  }
}

Fixed version (ground truth):
@Override public void putAll(Map<? extends K,? extends V> arg0){
  if (arg0 == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  Map.Entry<? extends K,? extends V> E : arg0.entrySet()) {
    put(E.getKey(),E.getValue());
  }
}
Program: 40702
Project: 40702
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public Collection<? extends Object> getRootsInput(){
  return rootsInput;
}

Fixed version (ground truth):
public Collection<? extends Object> getRootsInput(){
  return rootsInput;
}
Program: 40703
Project: 40703
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void setRootsInput(Collection<? extends Object> newRootsInput){
  rootsInput=newRootsInput;
}

Fixed version (ground truth):
public void setRootsInput(Collection<? extends Object> newRootsInput){
  rootsInput=newRootsInput;
}
Program: 40704
Project: 40704
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public List<IAction> getPopUpActions(){
  return popUpActions;
}

Fixed version (ground truth):
public List<IAction> getPopUpActions(){
  return popUpActions;
}
Program: 40705
Project: 40705
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public Graph getGraphInput(){
  return graphInput;
}

Fixed version (ground truth):
public Graph getGraphInput(){
  return graphInput;
}
Program: 40706
Project: 40706
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public NodeDecorator getNodeDecoratorInput(){
  return nodeDecoratorInput;
}

Fixed version (ground truth):
public NodeDecorator getNodeDecoratorInput(){
  return nodeDecoratorInput;
}
Program: 40707
Project: 40707
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void setNodeDecoratorInput(NodeDecorator newNodeDecoratorInput){
  nodeDecoratorInput=newNodeDecoratorInput;
}

Fixed version (ground truth):
public void setNodeDecoratorInput(NodeDecorator newNodeDecoratorInput){
  nodeDecoratorInput=newNodeDecoratorInput;
}
Program: 40708
Project: 40708
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void setGraphInput(Graph newGraphInput){
  graphInput=newGraphInput;
}

Fixed version (ground truth):
public void setGraphInput(Graph newGraphInput){
  graphInput=newGraphInput;
}
Program: 40709
Project: 40709
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public String toString(){
  StringBuffer result=new StringBuffer(super.toString());
  result.append("String_Node_Str");
  result.append(graphInput);
  result.append("String_Node_Str");
  result.append(rootsInput);
  result.append("String_Node_Str");
  result.append(nodeDecoratorInput);
  result.append("String_Node_Str");
  result.append(popUpActions);
  result.append(')');
  return result.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer result=new StringBuffer(super.toString());
  result.append("String_Node_Str");
  result.append(graphInput);
  result.append("String_Node_Str");
  result.append(rootsInput);
  result.append("String_Node_Str");
  result.append(nodeDecoratorInput);
  result.append("String_Node_Str");
  result.append(popUpActions);
  result.append(')');
  return result.toString();
}
Program: 40710
Project: 40710
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public SWTTreeViewer(){
  super();
}

Fixed version (ground truth):
public SWTTreeViewer(){
  super();
}
Program: 40711
Project: 40711
Buggy source:
public boolean isCatchBlock(){
  return original.isCatchBlock();
}

Fixed version (ground truth):
public boolean isCatchBlock(){
  return (original.isCatchBlock() && instructionIndex == original.getFirstInstructionIndex());
}
Program: 40712
Project: 40712
Buggy source:
@SuppressWarnings("String_Node_Str") public String getLabel(Object o) throws WalaException {
  T t=(T)o;
  if (t instanceof BasicBlockInContext) {
    BasicBlockInContext bb=(BasicBlockInContext)t;
    if (bb.getDelegate() instanceof ExplodedBasicBlock) {
      ExplodedBasicBlock delegate=(ExplodedBasicBlock)bb.getDelegate();
      String s=delegate.getNumber() + "String_Node_Str" + result.getResult(t)+ "String_Node_Str"+ delegate.getInstruction();
      for (Iterator<SSAPhiInstruction> phis=delegate.iteratePhis(); phis.hasNext(); ) {
        SSAPhiInstruction phi=phis.next();
        s+="String_Node_Str" + phi;
      }
      return s;
    }
  }
  return t + "String_Node_Str" + result.getResult(t);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public String getLabel(Object o) throws WalaException {
  T t=(T)o;
  if (t instanceof BasicBlockInContext) {
    BasicBlockInContext bb=(BasicBlockInContext)t;
    if (bb.getDelegate() instanceof ExplodedBasicBlock) {
      ExplodedBasicBlock delegate=(ExplodedBasicBlock)bb.getDelegate();
      String s=delegate.getNumber() + "String_Node_Str" + result.getResult(t)+ "String_Node_Str"+ delegate.getInstruction();
      for (Iterator<SSAPhiInstruction> phis=delegate.iteratePhis(); phis.hasNext(); ) {
        SSAPhiInstruction phi=phis.next();
        s+="String_Node_Str" + phi;
      }
      if (delegate.isCatchBlock()) {
        s+="String_Node_Str" + delegate.getCatchInstruction();
      }
      return s;
    }
  }
  return t + "String_Node_Str" + result.getResult(t);
}
Program: 40713
Project: 40713
Buggy source:
private OrdinalSet<InstanceKey> computeOrdinalInstanceSet(IClass type){
  Collection<IClass> klasses=null;
  if (type.isInterface()) {
    klasses=getCallGraph().getClassHierarchy().getImplementors(type.getReference());
  }
 else {
    klasses=getCallGraph().getClassHierarchy().computeSubClasses(type.getReference());
  }
  klasses=HashSetFactory.make(klasses);
  klasses.retainAll(this.klasses);
  OrdinalSet<InstanceKey> result=toOrdinalInstanceKeySet(klasses);
  return result;
}

Fixed version (ground truth):
/** 
 * Compute the set of   {@link InstanceKey}s which may represent a particular type.
 */
private OrdinalSet<InstanceKey> computeOrdinalInstanceSet(IClass type){
  Collection<IClass> klasses=null;
  if (type.isInterface()) {
    klasses=getCallGraph().getClassHierarchy().getImplementors(type.getReference());
  }
 else {
    Collection<IClass> sc=getCallGraph().getClassHierarchy().computeSubClasses(type.getReference());
    klasses=HashSetFactory.make();
    for (    IClass c : sc) {
      if (!c.isInterface()) {
        klasses.add(c);
      }
    }
  }
  klasses=HashSetFactory.make(klasses);
  klasses.retainAll(this.klasses);
  OrdinalSet<InstanceKey> result=toOrdinalInstanceKeySet(klasses);
  return result;
}
Program: 40714
Project: 40714
Buggy source:
/** 
 * @param c Collection<IClass>
 */
private OrdinalSet<InstanceKey> toOrdinalInstanceKeySet(Collection c){
  BimodalMutableIntSet s=new BimodalMutableIntSet();
  for (Iterator it=c.iterator(); it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    int index=getInstanceKeyMapping().getMappedIndex(new ConcreteTypeKey(klass));
    if (index >= 0) {
      s.add(index);
    }
  }
  return new OrdinalSet<InstanceKey>(s,getInstanceKeyMapping());
}

Fixed version (ground truth):
private OrdinalSet<InstanceKey> toOrdinalInstanceKeySet(Collection c){
  BimodalMutableIntSet s=new BimodalMutableIntSet();
  for (Iterator it=c.iterator(); it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    int index=getInstanceKeyMapping().getMappedIndex(new ConcreteTypeKey(klass));
    if (index >= 0) {
      s.add(index);
    }
  }
  return new OrdinalSet<InstanceKey>(s,getInstanceKeyMapping());
}
Program: 40716
Project: 40716
Buggy source:
@Override public PointerAnalysis getPointerAnalysis(){
  return new TypeBasedPointerAnalysis(getOptions(),allocatedClasses,getCallGraph());
}

Fixed version (ground truth):
@Override public PointerAnalysis getPointerAnalysis(){
  return TypeBasedPointerAnalysis.make(getOptions(),allocatedClasses,getCallGraph());
}
Program: 40717
Project: 40717
Buggy source:
public InstanceKey getInstanceKeyForAllocation(CGNode node,NewSiteReference allocation) throws UnimplementedError {
  Assertions.UNREACHABLE();
  return null;
}

Fixed version (ground truth):
public InstanceKey getInstanceKeyForAllocation(CGNode node,NewSiteReference allocation) throws UnimplementedError {
  return iKeyFactory.getInstanceKeyForAllocation(node,allocation);
}
Program: 40718
Project: 40718
Buggy source:
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node,NewSiteReference allocation,int dim) throws UnimplementedError {
  Assertions.UNREACHABLE();
  return null;
}

Fixed version (ground truth):
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node,NewSiteReference allocation,int dim) throws UnimplementedError {
  return iKeyFactory.getInstanceKeyForMultiNewArray(node,allocation,dim);
}
Program: 40719
Project: 40719
Buggy source:
/** 
 * @param klasses Collection<IClass>
 * @throws AssertionError  if klasses is null
 */
public TypeBasedPointerAnalysis(AnalysisOptions options,Collection<IClass> klasses,CallGraph cg) throws AssertionError {
  super(cg,makeInstanceKeys(klasses));
  this.klasses=klasses;
  heapModel=new TypeBasedHeapModel(options,klasses,cg);
}

Fixed version (ground truth):
/** 
 * @param klasses Collection<IClass>
 * @throws AssertionError  if klasses is null
 */
private TypeBasedPointerAnalysis(AnalysisOptions options,Collection<IClass> klasses,CallGraph cg) throws AssertionError {
  super(cg,makeInstanceKeys(klasses));
  this.klasses=klasses;
  heapModel=new TypeBasedHeapModel(options,klasses,cg);
}
Program: 40720
Project: 40720
Buggy source:
/** 
 * get the "normal" successors (sic) for a return site; i.e., the "normal" CFG predecessors that are not call nodes.
 * @see com.ibm.wala.dataflow.IFDS.ISupergraph#getCalledNodes(java.lang.Object)
 */
public Iterator<T> getNormalSuccessors(final T ret){
  Iterator<? extends Object> allPreds=delegate.getPredNodes(ret);
  Filter sameProc=new Filter(){
    @SuppressWarnings("String_Node_Str") public boolean accepts(    Object o){
      return getProcOf(ret).equals(getProcOf((T)o));
    }
  }
;
  Iterator<Object> sameProcPreds=new FilterIterator<Object>(allPreds,sameProc);
  Filter notCall=new Filter(){
    @SuppressWarnings("String_Node_Str") public boolean accepts(    Object o){
      return !delegate.isCall((T)o);
    }
  }
;
  return new FilterIterator<T>(sameProcPreds,notCall);
}

Fixed version (ground truth):
/** 
 * get the "normal" successors (sic) for a return site; i.e., the "normal" CFG predecessors that are not call nodes.
 * @see com.ibm.wala.dataflow.IFDS.ISupergraph#getCalledNodes(java.lang.Object)
 */
public Iterator<T> getNormalSuccessors(final T ret){
  Iterator<? extends Object> allPreds=delegate.getPredNodes(ret);
  Filter sameProc=new Filter<T>(){
    public boolean accepts(    T o){
      return getProcOf(ret).equals(getProcOf(o)) && !delegate.isExit(o);
    }
  }
;
  Iterator<Object> sameProcPreds=new FilterIterator<Object>(allPreds,sameProc);
  Filter notCall=new Filter<T>(){
    public boolean accepts(    T o){
      return !delegate.isCall(o);
    }
  }
;
  return new FilterIterator<T>(sameProcPreds,notCall);
}
Program: 40721
Project: 40721
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean accepts(Object o){
  return !delegate.isCall((T)o);
}

Fixed version (ground truth):
public boolean accepts(T o){
  return !delegate.isCall(o);
}
Program: 40722
Project: 40722
Buggy source:
public IUnaryFlowFunction getCallNoneToReturnFlowFunction(Statement src,Statement dest){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Statement s=src;
switch (s.getKind()) {
case NORMAL_RET_CALLER:
case PARAM_CALLER:
    return ReachabilityFunctions.killReachability;
case HEAP_PARAM_CALLEE:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case HEAP_RET_CALLER:
  if (dest instanceof HeapStatement) {
    HeapStatement hd=(HeapStatement)dest;
    HeapStatement hs=(HeapStatement)src;
    if (hs.getLocation().equals(hd.getLocation())) {
      return IdentityFlowFunction.identity();
    }
 else {
      return ReachabilityFunctions.killReachability;
    }
  }
 else {
    return ReachabilityFunctions.killReachability;
  }
case NORMAL:
return ReachabilityFunctions.killReachability;
default :
Assertions.UNREACHABLE(s.getKind().toString());
return null;
}
}

Fixed version (ground truth):
public IUnaryFlowFunction getCallNoneToReturnFlowFunction(Statement src,Statement dest){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Statement s=src;
switch (s.getKind()) {
case NORMAL_RET_CALLER:
case PARAM_CALLER:
case EXC_RET_CALLER:
    return ReachabilityFunctions.killReachability;
case HEAP_PARAM_CALLEE:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case HEAP_RET_CALLER:
  if (dest instanceof HeapStatement) {
    HeapStatement hd=(HeapStatement)dest;
    HeapStatement hs=(HeapStatement)src;
    if (hs.getLocation().equals(hd.getLocation())) {
      return IdentityFlowFunction.identity();
    }
 else {
      return ReachabilityFunctions.killReachability;
    }
  }
 else {
    return ReachabilityFunctions.killReachability;
  }
case NORMAL:
return ReachabilityFunctions.killReachability;
default :
Assertions.UNREACHABLE(s.getKind().toString());
return null;
}
}
Program: 40723
Project: 40723
Buggy source:
/** 
 * @return the cfg for n, or null if none found
 * @throws IllegalArgumentException if n == null
 */
@Override public ControlFlowGraph<ExplodedBasicBlock> getCFG(CGNode n) throws IllegalArgumentException {
  if (n == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IR ir=n.getIR();
  return ExplodedControlFlowGraph.make(ir);
}

Fixed version (ground truth):
/** 
 * @return the cfg for n, or null if none found
 * @throws IllegalArgumentException if n == null
 */
@Override public ControlFlowGraph<ExplodedBasicBlock> getCFG(CGNode n) throws IllegalArgumentException {
  if (n == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IR ir=n.getIR();
  if (ir == null) {
    return null;
  }
  return ExplodedControlFlowGraph.make(ir);
}
Program: 40724
Project: 40724
Buggy source:
@Override public SSAInstruction copyForSSA(int[] defs,int[] uses){
  if (uses != null && uses.length < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new SSABinaryOpInstruction(operator,defs == null || defs.length == 0 ? result : defs[0],uses == null ? val1 : uses[0],uses == null ? val2 : uses[1]);
}

Fixed version (ground truth):
@Override public SSAInstruction copyForSSA(int[] defs,int[] uses){
  if (uses != null && uses.length < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new SSABinaryOpInstruction(operator,defs == null || defs.length == 0 ? result : defs[0],uses == null ? val1 : uses[0],uses == null ? val2 : uses[1],mayBeInteger);
}
Program: 40725
Project: 40725
Buggy source:
SSABinaryOpInstruction(BinaryOpInstruction.IOperator operator,int result,int val1,int val2){
  super();
  this.result=result;
  this.val1=val1;
  this.val2=val2;
  this.operator=operator;
  Assertions._assert(val1 != -1 && val2 != -1);
}

Fixed version (ground truth):
SSABinaryOpInstruction(BinaryOpInstruction.IOperator operator,int result,int val1,int val2,boolean mayBeInteger){
  super();
  this.result=result;
  this.val1=val1;
  this.val2=val2;
  this.operator=operator;
  this.mayBeInteger=mayBeInteger;
  Assertions._assert(val1 != -1 && val2 != -1);
}
Program: 40726
Project: 40726
Buggy source:
/** 
 * @see com.ibm.wala.ssa.SSAInstruction#getDef()
 */
@Override public boolean hasDef(){
  return true;
}

Fixed version (ground truth):
@Override public boolean hasDef(){
  return true;
}
Program: 40727
Project: 40727
Buggy source:
@Override public boolean isPEI(){
  return operator == BinaryOpInstruction.Operator.DIV || operator == BinaryOpInstruction.Operator.REM;
}

Fixed version (ground truth):
@Override public boolean isPEI(){
  return mayBeInteger && operator == BinaryOpInstruction.Operator.DIV || operator == BinaryOpInstruction.Operator.REM;
}
Program: 40728
Project: 40728
Buggy source:
/** 
 * UGH! This must be the Shrike OPCODE, not the Shrike OPERATOR code!!!!!
 * @artifact 38486
 * @return instruction opcode
 */
public BinaryOpInstruction.IOperator getOperator(){
  return operator;
}

Fixed version (ground truth):
/** 
 * Ugh.  clean up shrike operator stuff.
 */
public BinaryOpInstruction.IOperator getOperator(){
  return operator;
}
Program: 40729
Project: 40729
Buggy source:
/** 
 * @see com.ibm.wala.shrikeBT.Instruction.Visitor#visitShift(ShiftInstruction)
 */
@Override public void visitShift(com.ibm.wala.shrikeBT.ShiftInstruction instruction){
  int val2=workingState.pop();
  int val1=workingState.pop();
  int result=reuseOrCreateDef();
  workingState.push(result);
  emitInstruction(new SSABinaryOpInstruction(instruction.getOperator(),result,val1,val2));
}

Fixed version (ground truth):
/** 
 * @see com.ibm.wala.shrikeBT.Instruction.Visitor#visitShift(ShiftInstruction)
 */
@Override public void visitShift(com.ibm.wala.shrikeBT.ShiftInstruction instruction){
  int val2=workingState.pop();
  int val1=workingState.pop();
  int result=reuseOrCreateDef();
  workingState.push(result);
  emitInstruction(new SSABinaryOpInstruction(instruction.getOperator(),result,val1,val2,true));
}
Program: 40730
Project: 40730
Buggy source:
/** 
 * @see com.ibm.wala.shrikeBT.Instruction.Visitor#visitBinaryOp(BinaryOpInstruction)
 */
@Override public void visitBinaryOp(com.ibm.wala.shrikeBT.BinaryOpInstruction instruction){
  int val2=workingState.pop();
  int val1=workingState.pop();
  int result=reuseOrCreateDef();
  workingState.push(result);
  emitInstruction(new SSABinaryOpInstruction(instruction.getOperator(),result,val1,val2));
}

Fixed version (ground truth):
/** 
 * @see com.ibm.wala.shrikeBT.Instruction.Visitor#visitBinaryOp(BinaryOpInstruction)
 */
@Override public void visitBinaryOp(com.ibm.wala.shrikeBT.BinaryOpInstruction instruction){
  int val2=workingState.pop();
  int val1=workingState.pop();
  int result=reuseOrCreateDef();
  workingState.push(result);
  boolean isFloat=instruction.getType().equals(TYPE_double) || instruction.getType().equals(TYPE_float);
  emitInstruction(new SSABinaryOpInstruction(instruction.getOperator(),result,val1,val2,!isFloat));
}
Program: 40731
Project: 40731
Buggy source:
public static SSABinaryOpInstruction BinaryOpInstruction(BinaryOpInstruction.IOperator operator,int result,int val1,int val2){
  return new SSABinaryOpInstruction(operator,result,val1,val2);
}

Fixed version (ground truth):
public static SSABinaryOpInstruction BinaryOpInstruction(BinaryOpInstruction.IOperator operator,int result,int val1,int val2,boolean mayBeInteger){
  return new SSABinaryOpInstruction(operator,result,val1,val2,mayBeInteger);
}
Program: 40732
Project: 40732
Buggy source:
/** 
 * @param x set of factoid numbers that previously have been established to hold at a program point
 * @param j a new factoid number which has been discovered to hold at a program point
 * @return the factoid number z which should actually be propagated, based ona merge of the new fact j into the old state represented by x
 */
int merge(IntSet x,int j);

Fixed version (ground truth):
/** 
 * @param x set of factoid numbers that previously have been established to hold at a program point
 * @param j a new factoid number which has been discovered to hold at a program point
 * @return the factoid number z which should actually be propagated, based ona merge of the new fact j into the old state represented by x. return -1 if no fact should be propagated.
 */
int merge(IntSet x,int j);
Program: 40733
Project: 40733
Buggy source:
protected TypeReference[] makeParameterTypes(MethodReference method,int i){
  TypeReference nominal=method.getParameterType(i);
  if (nominal.isPrimitiveType() || nominal.isArrayType())   return new TypeReference[]{nominal};
 else {
    IClass nc=getCha().lookupClass(nominal);
    Collection subcs=nc.isInterface() ? getCha().getImplementors(nominal) : getCha().computeSubClasses(nominal);
    Set<TypeReference> subs=HashSetFactory.make();
    for (Iterator I=subcs.iterator(); I.hasNext(); ) {
      IClass cs=(IClass)I.next();
      if (!cs.isAbstract() && !cs.isInterface())       subs.add(cs.getReference());
    }
    return subs.toArray(new TypeReference[subs.size()]);
  }
}

Fixed version (ground truth):
protected TypeReference[] makeParameterTypes(IMethod method,int i){
  TypeReference nominal=method.getParameterType(i);
  if (nominal.isPrimitiveType() || nominal.isArrayType())   return new TypeReference[]{nominal};
 else {
    IClass nc=getCha().lookupClass(nominal);
    Collection subcs=nc.isInterface() ? getCha().getImplementors(nominal) : getCha().computeSubClasses(nominal);
    Set<TypeReference> subs=HashSetFactory.make();
    for (Iterator I=subcs.iterator(); I.hasNext(); ) {
      IClass cs=(IClass)I.next();
      if (!cs.isAbstract() && !cs.isInterface())       subs.add(cs.getReference());
    }
    return subs.toArray(new TypeReference[subs.size()]);
  }
}
Program: 40735
Project: 40735
Buggy source:
/** 
 * TODO: move this elsewhere. Move it into shrike and develop new way to track peis.
 * @throws IllegalArgumentException  if s is null
 */
public static boolean isPEI(Instruction s){
  if (s == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (s.getOpcode()) {
case OP_iaload:
case OP_laload:
case OP_faload:
case OP_daload:
case OP_aaload:
case OP_baload:
case OP_caload:
case OP_saload:
case OP_iastore:
case OP_lastore:
case OP_fastore:
case OP_dastore:
case OP_aastore:
case OP_bastore:
case OP_castore:
case OP_sastore:
case OP_getfield:
case OP_putfield:
case OP_idiv:
case OP_invokevirtual:
case OP_invokespecial:
case OP_invokestatic:
case OP_invokeinterface:
case OP_new:
case OP_newarray:
case OP_anewarray:
case OP_arraylength:
case OP_athrow:
case OP_checkcast:
case OP_monitorenter:
case OP_monitorexit:
case OP_multianewarray:
    return true;
case OP_ldc_w:
  return (((ConstantInstruction)s).getType().equals(TYPE_Class));
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * TODO: move this elsewhere. Move it into shrike and develop new way to track peis.
 * @throws IllegalArgumentException  if s is null
 */
public static boolean isPEI(Instruction s){
  if (s == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (s.getOpcode()) {
case OP_iaload:
case OP_laload:
case OP_faload:
case OP_daload:
case OP_aaload:
case OP_baload:
case OP_caload:
case OP_saload:
case OP_iastore:
case OP_lastore:
case OP_fastore:
case OP_dastore:
case OP_aastore:
case OP_bastore:
case OP_castore:
case OP_sastore:
case OP_getfield:
case OP_putfield:
case OP_idiv:
case OP_invokevirtual:
case OP_invokespecial:
case OP_invokestatic:
case OP_invokeinterface:
case OP_irem:
case OP_new:
case OP_newarray:
case OP_anewarray:
case OP_arraylength:
case OP_athrow:
case OP_checkcast:
case OP_monitorenter:
case OP_monitorexit:
case OP_multianewarray:
    return true;
case OP_ldc_w:
  return (((ConstantInstruction)s).getType().equals(TYPE_Class));
default :
return false;
}
}
Program: 40736
Project: 40736
Buggy source:
boolean hasNormalEdge(T src,T dst);

Fixed version (ground truth):
/** 
 * This method must return true if and only if a normal edge from src to dst exists in the original CFG and should be kept for the pruned version of that CFG.  Note that this must _must_ return false for any normal edge that is not in the original CFG.
 */
boolean hasNormalEdge(T src,T dst);
Program: 40737
Project: 40737
Buggy source:
boolean hasExceptionalEdge(T src,T dst);

Fixed version (ground truth):
/** 
 * This method must return true if and only if an exceptional edge from src to dst exists in the original CFG and should be kept for the pruned version of that CFG.  Note that this must _must_ return false for any exceptional edge that is not in the original CFG.
 */
boolean hasExceptionalEdge(T src,T dst);
Program: 40738
Project: 40738
Buggy source:
public boolean hasNormalEdge(T src,T dst){
  return true;
}

Fixed version (ground truth):
public boolean hasNormalEdge(T src,T dst){
  return cfg.getNormalSuccessors(src).contains(dst);
}
Program: 40739
Project: 40739
Buggy source:
public static <T extends IBasicBlock>PrunedCFG<T> make(ControlFlowGraph<T> cfg){
  return PrunedCFG.make(cfg,new ExceptionEdgePruner<T>());
}

Fixed version (ground truth):
public static <T extends IBasicBlock>PrunedCFG<T> make(ControlFlowGraph<T> cfg){
  return PrunedCFG.make(cfg,new ExceptionEdgePruner<T>(cfg));
}
Program: 40740
Project: 40740
Buggy source:
public Iterator<T> getPredNodes(T N){
  return new CompoundIterator<T>(getNormalPredecessors(N),getExceptionalPredecessors(N));
}

Fixed version (ground truth):
public Iterator<T> getPredNodes(final T N){
  return new FilterIterator<T>(cfg.getPredNodes(N),new Filter<T>(){
    public boolean accepts(    T o){
      return currentCFGNodes.containsNode(o) && (filter.hasNormalEdge(o,N) || filter.hasExceptionalEdge(o,N));
    }
  }
);
}
Program: 40741
Project: 40741
Buggy source:
public Iterator<T> getSuccNodes(T N){
  return new CompoundIterator<T>(getNormalSuccessors(N),getExceptionalSuccessors(N));
}

Fixed version (ground truth):
public Iterator<T> getSuccNodes(final T N){
  return new FilterIterator<T>(cfg.getSuccNodes(N),new Filter<T>(){
    public boolean accepts(    T o){
      return currentCFGNodes.containsNode(o) && (filter.hasNormalEdge(N,o) || filter.hasExceptionalEdge(N,o));
    }
  }
);
}
Program: 40742
Project: 40742
Buggy source:
/** 
 * Wrap an SSAInstruction in a Statement
 */
public Statement ssaInstruction2Statement(SSAInstruction s){
}

Fixed version (ground truth):
public Statement ssaInstruction2Statement(SSAInstruction s,Map<SSAInstruction,Integer> instructionIndices){
}
Program: 40743
Project: 40743
Buggy source:
/** 
 * @return for each SSAInstruction, its instruction index in the irinstruction array
 */
private Map<SSAInstruction,Integer> computeInstructionIndices(IR ir){
  Map<SSAInstruction,Integer> result=HashMapFactory.make();
  if (ir != null) {
    SSAInstruction[] instructions=ir.getInstructions();
    for (int i=0; i < instructions.length; i++) {
      SSAInstruction s=instructions[i];
      if (s != null) {
        result.put(s,new Integer(i));
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @return for each SSAInstruction, its instruction index in the irinstruction array
 */
public static Map<SSAInstruction,Integer> computeInstructionIndices(IR ir){
  Map<SSAInstruction,Integer> result=HashMapFactory.make();
  if (ir != null) {
    SSAInstruction[] instructions=ir.getInstructions();
    for (int i=0; i < instructions.length; i++) {
      SSAInstruction s=instructions[i];
      if (s != null) {
        result.put(s,new Integer(i));
      }
    }
  }
  return result;
}
Program: 40745
Project: 40745
Buggy source:
/** 
 * Assuming a set of facts holds, simplify a CNF formula
 */
private static Collection<? extends IMaxTerm> simplifyCNF(ICNFFormula f,Collection<IMaxTerm> facts,ISemiDecisionProcedure dec){
  Collection<IMaxTerm> result=HashSetFactory.make();
  Collection<IMaxTerm> removedClauses=HashSetFactory.make();
  for (  IMaxTerm d : collectClauses(Collections.singleton(f))) {
    Collection<IMaxTerm> otherFacts=HashSetFactory.make(facts);
    otherFacts.addAll(collectClauses(Collections.singleton(f)));
    otherFacts.remove(d);
    otherFacts.removeAll(removedClauses);
    if (d instanceof Disjunction) {
      d=simplifyDisjunction((Disjunction)d,otherFacts,dec);
    }
    if (dec.isContradiction(d,otherFacts)) {
      return Collections.singleton(BooleanConstantFormula.FALSE);
    }
 else     if (facts.contains(d) || dec.isTautology(d,otherFacts)) {
      removedClauses.add(d);
    }
 else {
      result.add(d);
    }
  }
  if (result.isEmpty()) {
    return Collections.singleton(BooleanConstantFormula.TRUE);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Assuming a set of facts holds, simplify a CNF formula
 */
private static Collection<? extends IMaxTerm> simplifyCNF(ICNFFormula f,Collection<IMaxTerm> facts,ISemiDecisionProcedure dec){
  Collection<IMaxTerm> result=HashSetFactory.make();
  Collection<IMaxTerm> removedClauses=HashSetFactory.make();
  for (  IMaxTerm d : collectClauses(Collections.singleton(f))) {
    Collection<IMaxTerm> otherFacts=HashSetFactory.make(facts);
    otherFacts.addAll(collectClauses(Collections.singleton(f)));
    otherFacts.remove(d);
    otherFacts.removeAll(removedClauses);
    IMaxTerm checkD=d;
    if (d instanceof Disjunction) {
      checkD=simplifyDisjunction((Disjunction)d,otherFacts,dec);
    }
    if (dec.isContradiction(checkD,otherFacts)) {
      return Collections.singleton(BooleanConstantFormula.FALSE);
    }
 else     if (facts.contains(checkD) || dec.isTautology(checkD,otherFacts)) {
      removedClauses.add(d);
    }
 else {
      result.add(checkD);
    }
  }
  if (result.isEmpty()) {
    return Collections.singleton(BooleanConstantFormula.TRUE);
  }
  return result;
}
Program: 40746
Project: 40746
Buggy source:
private JavaLauncher(String programArgs,String mainClass,List<String> xtraClasspath){
  super();
  this.programArgs=programArgs;
  this.mainClass=mainClass;
  this.xtraClasspath=xtraClasspath;
}

Fixed version (ground truth):
private JavaLauncher(String programArgs,String mainClass,List<String> xtraClasspath){
  super();
  this.programArgs=programArgs;
  this.mainClass=mainClass;
  if (xtraClasspath != null) {
    this.xtraClasspath.addAll(xtraClasspath);
  }
}
Program: 40747
Project: 40747
Buggy source:
/** 
 * Launch the java process.
 * @throws WalaException
 */
public Process start() throws WalaException {
  String cp=makeClasspath();
  String heap="String_Node_Str";
  String cmd=getJavaExe() + heap + cp+ "String_Node_Str"+ makeLibPath()+ "String_Node_Str"+ getMainClass()+ "String_Node_Str"+ getProgramArgs();
  Process p=spawnProcess(cmd);
  stdOutDrain=isCaptureOutput() ? captureStdOut(p) : drainStdOut(p);
  stdInDrain=drainStdErr(p);
  return p;
}

Fixed version (ground truth):
/** 
 * Launch the java process.
 */
public Process start() throws WalaException {
  System.err.println(System.getProperty("String_Node_Str"));
  String cp=makeClasspath();
  String heap="String_Node_Str";
  String cmd=getJavaExe() + heap + cp+ "String_Node_Str"+ makeLibPath()+ "String_Node_Str"+ getMainClass()+ "String_Node_Str"+ getProgramArgs();
  Process p=spawnProcess(cmd);
  stdOutDrain=isCaptureOutput() ? captureStdOut(p) : drainStdOut(p);
  stdInDrain=drainStdErr(p);
  return p;
}