nus-yam/ex-repair huggingface dataset:
Program: 40532
Project: 40532
Buggy source:
private void addStatementsForSetOfTypes(Iterator it){
  if (!it.hasNext()) {
    SSAReturnInstruction r=new SSAReturnInstruction(nextLocal,false);
    allInstructions.add(r);
  }
  for (; it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    TypeReference T=klass.getReference();
    if (klass.isAbstract() || typesAllocated.contains(T)) {
      continue;
    }
    typesAllocated.add(T);
    int i=getLocalForType(T);
    NewSiteReference ref=NewSiteReference.make(getNewSiteForType(T),T);
    SSANewInstruction a=null;
    if (T.isArrayType()) {
      int[] sizes=new int[T.getDimensionality()];
      initValueNumberForConstantOne();
      Arrays.fill(sizes,valueNumberForConstantOne);
      a=new SSANewInstruction(i,ref,sizes);
    }
 else {
      a=new SSANewInstruction(i,ref);
    }
    allocations.add(a);
    allInstructions.add(a);
    SSAReturnInstruction r=new SSAReturnInstruction(i,false);
    allInstructions.add(r);
    MethodReference init=MethodReference.findOrCreate(T,MethodReference.initAtom,MethodReference.defaultInitDesc);
    CallSiteReference site=CallSiteReference.make(getCallSiteForType(T),init,IInvokeInstruction.Dispatch.SPECIAL);
    int[] params=new int[1];
    params[0]=i;
    SSAInvokeInstruction s=new SSAInvokeInstruction(params,getExceptionsForType(T),site);
    calls.add(s);
    allInstructions.add(s);
  }
}

Fixed version (ground truth):
private void addStatementsForSetOfTypes(Iterator it){
  if (!it.hasNext()) {
    SSAReturnInstruction r=new SSAReturnInstruction(nextLocal,false);
    allInstructions.add(r);
  }
  for (; it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    TypeReference T=klass.getReference();
    if (klass.isAbstract() || klass.isInterface() || typesAllocated.contains(T)) {
      continue;
    }
    typesAllocated.add(T);
    int i=getLocalForType(T);
    NewSiteReference ref=NewSiteReference.make(getNewSiteForType(T),T);
    SSANewInstruction a=null;
    if (T.isArrayType()) {
      int[] sizes=new int[T.getDimensionality()];
      initValueNumberForConstantOne();
      Arrays.fill(sizes,valueNumberForConstantOne);
      a=new SSANewInstruction(i,ref,sizes);
    }
 else {
      a=new SSANewInstruction(i,ref);
    }
    allocations.add(a);
    allInstructions.add(a);
    SSAReturnInstruction r=new SSAReturnInstruction(i,false);
    allInstructions.add(r);
    MethodReference init=MethodReference.findOrCreate(T,MethodReference.initAtom,MethodReference.defaultInitDesc);
    CallSiteReference site=CallSiteReference.make(getCallSiteForType(T),init,IInvokeInstruction.Dispatch.SPECIAL);
    int[] params=new int[1];
    params[0]=i;
    SSAInvokeInstruction s=new SSAInvokeInstruction(params,getExceptionsForType(T),site);
    calls.add(s);
    allInstructions.add(s);
  }
}
Program: 40533
Project: 40533
Buggy source:
/** 
 * Private constructor ... only for internal use.
 * @throws IllegalArgumentException if type is null
 */
public PointType(IClass type){
  if (type == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.type=type;
  if (Assertions.verifyAssertions) {
    Assertions._assert(type.getReference().isReferenceType());
  }
}

Fixed version (ground truth):
/** 
 * Private constructor ... only for internal use.
 * @throws IllegalArgumentException if type is null
 */
public PointType(IClass type){
  if (type == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.type=type;
  if (Assertions.verifyAssertions) {
    Assertions._assert(type.getReference().isReferenceType());
    Assertions._assert(!type.isInterface());
  }
}
Program: 40534
Project: 40534
Buggy source:
@Override public TypeAbstraction meet(TypeAbstraction rhs){
  if (rhs == TOP) {
    return this;
  }
 else {
    if (rhs instanceof PointType) {
      PointType other=(PointType)rhs;
      if (type.equals(other.type)) {
        return this;
      }
 else       if (type.isArrayClass() || other.type.isArrayClass()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
 else {
        return new ConeType(type.getClassHierarchy().getLeastCommonSuperclass(this.type,other.type));
      }
    }
 else     if (rhs instanceof ConeType) {
      ConeType other=(ConeType)rhs;
      TypeReference T=other.getType().getReference();
      if (type.isArrayClass() || T.isArrayType()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
      IClass typeKlass=type;
      if (type.getClassHierarchy().isSubclassOf(typeKlass,other.getType())) {
        return other;
      }
 else       if (other.isInterface()) {
        if (type.getClassHierarchy().implementsInterface(typeKlass,other.getType())) {
          return other;
        }
      }
      return other.meet(new ConeType(other.getType()));
    }
 else {
      Assertions.UNREACHABLE("String_Node_Str" + rhs.getClass());
      return null;
    }
  }
}

Fixed version (ground truth):
@Override public TypeAbstraction meet(TypeAbstraction rhs){
  if (rhs == TOP) {
    return this;
  }
 else {
    if (rhs instanceof PointType) {
      PointType other=(PointType)rhs;
      if (type.equals(other.type)) {
        return this;
      }
 else       if (type.isArrayClass() || other.type.isArrayClass()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
 else {
        return new ConeType(type.getClassHierarchy().getLeastCommonSuperclass(this.type,other.type));
      }
    }
 else     if (rhs instanceof ConeType) {
      ConeType other=(ConeType)rhs;
      TypeReference T=other.getType().getReference();
      if (type.isArrayClass() || T.isArrayType()) {
        return new ConeType(type.getClassHierarchy().getRootClass());
      }
      IClass typeKlass=type;
      if (type.getClassHierarchy().isSubclassOf(typeKlass,other.getType())) {
        return other;
      }
 else       if (other.isInterface()) {
        if (type.getClassHierarchy().implementsInterface(typeKlass,other.getType())) {
          return other;
        }
      }
      return other.meet(new ConeType(this.getType()));
    }
 else {
      Assertions.UNREACHABLE("String_Node_Str" + rhs.getClass());
      return null;
    }
  }
}
Program: 40536
Project: 40536
Buggy source:
protected CGNode makeFakeRootNode(){
  return findOrCreateNode(new JSFakeRoot(cha,options,getAnalysisCache()),Everywhere.EVERYWHERE);
}

Fixed version (ground truth):
protected CGNode makeFakeRootNode() throws CancelException {
  return findOrCreateNode(new JSFakeRoot(cha,options,getAnalysisCache()),Everywhere.EVERYWHERE);
}
Program: 40538
Project: 40538
Buggy source:
protected CGNode makeFakeRootNode(){
  return findOrCreateNode(new AstFakeRoot(FakeRootMethod.rootMethod,cha,options,getAnalysisCache()),Everywhere.EVERYWHERE);
}

Fixed version (ground truth):
protected CGNode makeFakeRootNode() throws CancelException {
  return findOrCreateNode(new AstFakeRoot(FakeRootMethod.rootMethod,cha,options,getAnalysisCache()),Everywhere.EVERYWHERE);
}
Program: 40539
Project: 40539
Buggy source:
protected CGNode makeFakeRootNode(){
  return findOrCreateNode(new CrossLanguageFakeRoot(cha,options,getAnalysisCache()),Everywhere.EVERYWHERE);
}

Fixed version (ground truth):
protected CGNode makeFakeRootNode() throws CancelException {
  return findOrCreateNode(new CrossLanguageFakeRoot(cha,options,getAnalysisCache()),Everywhere.EVERYWHERE);
}
Program: 40540
Project: 40540
Buggy source:
@SuppressWarnings("String_Node_Str") public AbstractRootMethod getLanguageRoot(Atom language){
  if (!languageRoots.containsKey(language)) {
    AbstractRootMethod languageRoot=roots.get(language,this);
    CGNode languageRootNode=findOrCreateNode(languageRoot,Everywhere.EVERYWHERE);
    languageRootNodes.add(languageRootNode);
    CallSiteReference site=CallSiteReference.make(1,languageRoot.getReference(),IInvokeInstruction.Dispatch.STATIC);
    CGNode fakeRootNode=getFakeRootNode();
    CrossLanguageFakeRoot fakeRootMethod=(CrossLanguageFakeRoot)fakeRootNode.getMethod();
    site=fakeRootMethod.addInvocationInternal(new int[0],site).getCallSite();
    fakeRootNode.addTarget(site,languageRootNode);
    languageRoots.put(language,languageRoot);
  }
  return (AbstractRootMethod)languageRoots.get(language);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public AbstractRootMethod getLanguageRoot(Atom language){
  if (!languageRoots.containsKey(language)) {
    AbstractRootMethod languageRoot=roots.get(language,this);
    CGNode languageRootNode=null;
    try {
      languageRootNode=findOrCreateNode(languageRoot,Everywhere.EVERYWHERE);
    }
 catch (    CancelException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
    languageRootNodes.add(languageRootNode);
    CallSiteReference site=CallSiteReference.make(1,languageRoot.getReference(),IInvokeInstruction.Dispatch.STATIC);
    CGNode fakeRootNode=getFakeRootNode();
    CrossLanguageFakeRoot fakeRootMethod=(CrossLanguageFakeRoot)fakeRootNode.getMethod();
    site=fakeRootMethod.addInvocationInternal(new int[0],site).getCallSite();
    fakeRootNode.addTarget(site,languageRootNode);
    languageRoots.put(language,languageRoot);
  }
  return (AbstractRootMethod)languageRoots.get(language);
}
Program: 40541
Project: 40541
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);
      }
    }
  }
  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;
}

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()) {
      TypeReference elementType=klass.getReference().getArrayElementType();
      if (elementType.isPrimitiveType()) {
        c.add(klass);
      }
 else {
        c.add(klass.getClassHierarchy().lookupClass(TypeReference.JavaLangObject.getArrayTypeForElementType()));
      }
    }
 else     if (this.klasses.contains(klass)) {
      c.add(klass);
    }
  }
  OrdinalSet<InstanceKey> result=toOrdinalInstanceKeySet(c);
  return result;
}
Program: 40542
Project: 40542
Buggy source:
public static boolean isConcreteStrutsPlugIn(IClass klass){
  TypeReference plugInType=TypeReference.findOrCreate(ClassLoaderReference.Application,plugInName);
  IClass plugInClass=klass.getClassHierarchy().lookupClass(plugInType);
  if (klass.isAbstract()) {
    return false;
  }
  if (klass.getReference().equals(plugInType)) {
    return false;
  }
  if (klass.getClassHierarchy().isAssignableFrom(plugInClass,klass)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isConcreteStrutsPlugIn(IClass klass){
  TypeReference plugInType=TypeReference.findOrCreate(ClassLoaderReference.Application,plugInName);
  IClass plugInClass=klass.getClassHierarchy().lookupClass(plugInType);
  if (plugInClass == null) {
    return false;
  }
  if (klass.isAbstract()) {
    return false;
  }
  if (klass.getReference().equals(plugInType)) {
    return false;
  }
  if (klass.getClassHierarchy().isAssignableFrom(plugInClass,klass)) {
    return true;
  }
  return false;
}
Program: 40544
Project: 40544
Buggy source:
protected void addCtorInvokeInstruction(final TypeReference T,int alloc){
  MethodReference init=MethodReference.findOrCreate(T,MethodReference.initAtom,MethodReference.defaultInitDesc);
  CallSiteReference site=CallSiteReference.make(getCallSiteForType(T),init,IInvokeInstruction.Dispatch.SPECIAL);
  int[] params=new int[1];
  params[0]=alloc;
  int exc=getExceptionsForType(T);
  SSAInvokeInstruction s=new SSAInvokeInstruction(params,exc,site);
  calls.add(s);
  allInstructions.add(s);
}

Fixed version (ground truth):
/** 
 * Add an instruction to invoke the default constructor on the object of value number alloc of type t.
 */
protected void addCtorInvokeInstruction(final TypeReference t,int alloc){
  MethodReference init=MethodReference.findOrCreate(t,MethodReference.initAtom,MethodReference.defaultInitDesc);
  CallSiteReference site=CallSiteReference.make(getCallSiteForType(t),init,IInvokeInstruction.Dispatch.SPECIAL);
  int[] params=new int[1];
  params[0]=alloc;
  int exc=getExceptionsForType(t);
  SSAInvokeInstruction s=new SSAInvokeInstruction(params,exc,site);
  calls.add(s);
  allInstructions.add(s);
}
Program: 40545
Project: 40545
Buggy source:
/** 
 * @param T
 * @return value number of the newly allocated object
 */
protected int addStatementsForConcreteSimpleType(final TypeReference T){
}

Fixed version (ground truth):
/** 
 * @param t type of object to allocate
 * @return value number of the newly allocated object
 */
protected int addStatementsForConcreteSimpleType(final TypeReference t){
}
Program: 40546
Project: 40546
Buggy source:
/** 
 * Set up a method summary which allocates and returns an instance of concrete type T.
 * @param T
 */
private void addStatementsForConcreteType(final TypeReference T){
  int alloc=addStatementsForConcreteSimpleType(T);
  if (alloc == -1) {
    return;
  }
  if (T.isArrayType()) {
    MethodReference init=MethodReference.findOrCreate(T,MethodReference.initAtom,MethodReference.defaultInitDesc);
    CallSiteReference site=CallSiteReference.make(getCallSiteForType(T),init,IInvokeInstruction.Dispatch.SPECIAL);
    int[] params=new int[1];
    params[0]=alloc;
    int exc=getExceptionsForType(T);
    SSAInvokeInstruction s=new SSAInvokeInstruction(params,exc,site);
    calls.add(s);
    allInstructions.add(s);
  }
}

Fixed version (ground truth):
/** 
 * Set up a method summary which allocates and returns an instance of concrete type T.
 * @param T
 */
private void addStatementsForConcreteType(final TypeReference T){
  int alloc=addStatementsForConcreteSimpleType(T);
  if (alloc == -1) {
    return;
  }
  if (T.isArrayType()) {
    MethodReference init=MethodReference.findOrCreate(T,MethodReference.initAtom,MethodReference.defaultInitDesc);
    CallSiteReference site=CallSiteReference.make(getCallSiteForType(T),init,IInvokeInstruction.Dispatch.SPECIAL);
    int[] params=new int[1];
    params[0]=alloc;
    int exc=getExceptionsForType(T);
    SSAInvokeInstruction s=new SSAInvokeInstruction(params,exc,site);
    calls.add(s);
    allInstructions.add(s);
  }
 else {
  }
}
Program: 40548
Project: 40548
Buggy source:
public boolean understands(CGNode node){
  if (node == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!(node.getContext() instanceof ReceiverInstanceContext)) {
    return false;
  }
  return node.getMethod().getReference().equals(METHOD_INVOKE) || node.getMethod().getReference().equals(CTOR_NEW_INSTANCE);
}

Fixed version (ground truth):
public boolean understands(CGNode node){
  if (node == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!(node.getContext() instanceof ReceiverInstanceContext)) {
    return false;
  }
  ReceiverInstanceContext r=(ReceiverInstanceContext)node.getContext();
  if (!(r.getReceiver() instanceof ConstantKey)) {
    return false;
  }
  return node.getMethod().getReference().equals(METHOD_INVOKE) || node.getMethod().getReference().equals(CTOR_NEW_INSTANCE);
}
Program: 40549
Project: 40549
Buggy source:
/** 
 * Add any methods that look like they might be DispatchAction targets, based on the method signature. TODO: instead, parse the struts xml directly.
 * @param klass an Action
 */
private void addSpeculativeDispatchMethods(IClass klass,IClassHierarchy cha){
  IClass C=klass;
  while (C != null) {
    for (Iterator<IMethod> it=C.getDeclaredMethods().iterator(); it.hasNext(); ) {
      IMethod M=(IMethod)it.next();
      Descriptor D=M.getDescriptor();
      if (D.equals(executeDesc) || D.equals(httpExecuteDesc)) {
        MethodReference m=MethodReference.findOrCreate(klass.getReference(),M.getName(),M.getDescriptor());
        entrypoints.put(m,new StrutsActionEntrypoint(C,M,cha));
      }
    }
    try {
      C=C.getSuperclass();
    }
 catch (    ClassHierarchyException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}

Fixed version (ground truth):
/** 
 * Add any methods that look like they might be DispatchAction targets, based on the method signature. TODO: instead, parse the struts xml directly.
 * @param klass an Action
 */
private void addSpeculativeDispatchMethods(IClass klass,IClassHierarchy cha){
  IClass c=klass;
  while (c != null) {
    for (Iterator<IMethod> it=c.getDeclaredMethods().iterator(); it.hasNext(); ) {
      IMethod M=(IMethod)it.next();
      Descriptor D=M.getDescriptor();
      if (D.equals(executeDesc) || D.equals(httpExecuteDesc)) {
        MethodReference m=MethodReference.findOrCreate(klass.getReference(),M.getName(),M.getDescriptor());
        entrypoints.put(m,new StrutsActionEntrypoint(klass,M,cha));
      }
    }
    try {
      c=c.getSuperclass();
    }
 catch (    ClassHierarchyException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}
Program: 40551
Project: 40551
Buggy source:
/** 
 * This object may understand a dispatch to Constructor.newInstance().
 */
public boolean mayUnderstand(CGNode caller,CallSiteReference site,IMethod targetMethod,InstanceKey instance){
  if (targetMethod.getReference().equals(ReflectiveInvocationInterpreter.METHOD_INVOKE) || isConstructorConstant(instance) && targetMethod.getReference().equals(ReflectiveInvocationInterpreter.CTOR_NEW_INSTANCE)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * This object may understand a dispatch to Constructor.newInstance().
 */
public boolean mayUnderstand(CGNode caller,CallSiteReference site,IMethod targetMethod,InstanceKey instance){
  if (instance instanceof ConstantKey) {
    if (targetMethod.getReference().equals(ReflectiveInvocationInterpreter.METHOD_INVOKE) || isConstructorConstant(instance) && targetMethod.getReference().equals(ReflectiveInvocationInterpreter.CTOR_NEW_INSTANCE)) {
      return true;
    }
  }
  return false;
}
Program: 40552
Project: 40552
Buggy source:
/** 
 * Walk through the instructions and compute basic block boundaries.
 */
private void makeBasicBlocks(){
  SSAInstruction[] instructions=(SSAInstruction[])getInstructions();
  final boolean[] r=new boolean[instructions.length];
  r[0]=true;
  BranchVisitor branchVisitor=makeBranchVisitor(r);
  PEIVisitor peiVisitor=makePEIVisitor(r);
  for (int i=0; i < instructions.length; i++) {
    if (instructions[i] != null) {
      branchVisitor.setIndex(i);
      instructions[i].visit(branchVisitor);
      peiVisitor.setIndex(i);
      instructions[i].visit(peiVisitor);
    }
  }
  BasicBlock b=null;
  for (int i=0; i < r.length; i++) {
    if (r[i]) {
      b=new BasicBlock(i);
      addNode(b);
      if (DEBUG) {
        Trace.println("String_Node_Str" + b);
      }
    }
    i2block[i]=b;
  }
  BasicBlock exit=new BasicBlock(-1);
  if (DEBUG) {
    Trace.println("String_Node_Str" + exit);
  }
  addNode(exit);
}

Fixed version (ground truth):
/** 
 * Walk through the instructions and compute basic block boundaries.
 */
private void makeBasicBlocks(){
  SSAInstruction[] instructions=(SSAInstruction[])getInstructions();
  final boolean[] r=new boolean[instructions.length];
  r[0]=true;
  BranchVisitor branchVisitor=makeBranchVisitor(r);
  PEIVisitor peiVisitor=makePEIVisitor(r);
  for (int i=0; i < instructions.length; i++) {
    if (instructions[i] != null) {
      branchVisitor.setIndex(i);
      instructions[i].visit(branchVisitor);
      peiVisitor.setIndex(i);
      instructions[i].visit(peiVisitor);
    }
  }
  BasicBlock b=null;
  for (int i=0; i < r.length; i++) {
    if (r[i]) {
      b=new BasicBlock(i);
      addNode(b);
      int j=i;
      while (instructions[j] instanceof SSAPhiInstruction) {
        b.addPhi((SSAPhiInstruction)instructions[j]);
        j++;
      }
      if (DEBUG) {
        Trace.println("String_Node_Str" + b);
      }
    }
    i2block[i]=b;
  }
  BasicBlock exit=new BasicBlock(-1);
  if (DEBUG) {
    Trace.println("String_Node_Str" + exit);
  }
  addNode(exit);
  clearPhis(instructions);
}
Program: 40553
Project: 40553
Buggy source:
@Override public void visitGoto(SSAGotoInstruction instruction){
  Assertions.UNREACHABLE("String_Node_Str");
  breakBasicBlock();
}

Fixed version (ground truth):
@Override public void visitGoto(SSAGotoInstruction instruction){
  Assertions.UNREACHABLE("String_Node_Str");
  breakBasicBlock(index);
}
Program: 40554
Project: 40554
Buggy source:
/** 
 * TODO: we do not yet support induced CFGS with exception handlers.
 * @param instructions
 * @throws IllegalArgumentException  if instructions is null
 */
public InducedCFG(SSAInstruction[] instructions,IMethod method,Context context){
  super(method);
  if (instructions == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.context=context;
  this.instructions=instructions;
  if (DEBUG) {
    Trace.println("String_Node_Str" + method);
  }
  i2block=new BasicBlock[instructions.length];
  if (instructions.length == 0) {
    makeEmptyBlocks();
  }
 else {
    makeBasicBlocks();
  }
  init();
  computeEdges();
  if (DEBUG) {
    try {
      GraphIntegrity.check(this);
    }
 catch (    UnsoundGraphException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}

Fixed version (ground truth):
/** 
 * TODO: we do not yet support induced CFGS with exception handlers. NOTE: SIDE EFFECT!!! ... nulls out phi instructions in the instruction array!
 * @throws IllegalArgumentException if instructions is null
 */
public InducedCFG(SSAInstruction[] instructions,IMethod method,Context context){
  super(method);
  if (instructions == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.context=context;
  this.instructions=instructions;
  if (DEBUG) {
    Trace.println("String_Node_Str" + method);
  }
  i2block=new BasicBlock[instructions.length];
  if (instructions.length == 0) {
    makeEmptyBlocks();
  }
 else {
    makeBasicBlocks();
  }
  init();
  computeEdges();
  if (DEBUG) {
    try {
      GraphIntegrity.check(this);
    }
 catch (    UnsoundGraphException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}
Program: 40555
Project: 40555
Buggy source:
@Override public void visitReturn(SSAReturnInstruction instruction){
  breakBasicBlock();
}

Fixed version (ground truth):
@Override public void visitReturn(SSAReturnInstruction instruction){
  breakBasicBlock(index);
}
Program: 40556
Project: 40556
Buggy source:
@Override public void visitConditionalBranch(SSAConditionalBranchInstruction instruction){
  Assertions.UNREACHABLE("String_Node_Str");
  breakBasicBlock();
}

Fixed version (ground truth):
@Override public void visitConditionalBranch(SSAConditionalBranchInstruction instruction){
  Assertions.UNREACHABLE("String_Node_Str");
  breakBasicBlock(index);
}
Program: 40557
Project: 40557
Buggy source:
public InducedCFG makeControlFlowGraph(){
  return new InducedCFG(getStatements(),this,Everywhere.EVERYWHERE);
}

Fixed version (ground truth):
/** 
 * Create an   {@link InducedCFG} from an instruction array.NOTE: SIDE EFFECT!!! ... nulls out phi instructions in the instruction array!
 */
public InducedCFG makeControlFlowGraph(SSAInstruction[] instructions){
  return new InducedCFG(instructions,this,Everywhere.EVERYWHERE);
}
Program: 40558
Project: 40558
Buggy source:
@Override public IR makeIR(SSAOptions options){
  SSAInstruction instrs[]=getStatements(options);
  Map<Integer,ConstantValue> constants=null;
  if (valueNumberForConstantOne > -1) {
    constants=HashMapFactory.make(1);
    constants.put(new Integer(valueNumberForConstantOne),new ConstantValue(new Integer(1)));
  }
  return new SyntheticIR(this,Everywhere.EVERYWHERE,makeControlFlowGraph(),instrs,options,constants);
}

Fixed version (ground truth):
@Override public IR makeIR(SSAOptions options){
  SSAInstruction instrs[]=getStatements(options);
  Map<Integer,ConstantValue> constants=null;
  if (valueNumberForConstantOne > -1) {
    constants=HashMapFactory.make(1);
    constants.put(new Integer(valueNumberForConstantOne),new ConstantValue(new Integer(1)));
  }
  InducedCFG cfg=makeControlFlowGraph(instrs);
  return new SyntheticIR(this,Everywhere.EVERYWHERE,cfg,instrs,options,constants);
}
Program: 40559
Project: 40559
Buggy source:
@Override public IR makeIR(SSAOptions options){
  SSAInstruction instrs[]=getStatements(options);
  return new SyntheticIR(this,Everywhere.EVERYWHERE,makeControlFlowGraph(),instrs,options,summary.getConstants());
}

Fixed version (ground truth):
@Override public IR makeIR(SSAOptions options){
  SSAInstruction instrs[]=getStatements(options);
  return new SyntheticIR(this,Everywhere.EVERYWHERE,makeControlFlowGraph(instrs),instrs,options,summary.getConstants());
}
Program: 40560
Project: 40560
Buggy source:
/** 
 * Creates the union of two ordinal sets.
 * @param A ordinal set a
 * @param B ordinal set b
 * @return union of a and b
 * @throws IllegalArgumentException iff A or B is null
 */
public static <T>OrdinalSet<T> unify(OrdinalSet<T> A,OrdinalSet<T> B){
  if (A == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (B == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (Assertions.verifyAssertions) {
    if (A.size() != 0 && B.size() != 0) {
      Assertions._assert(A.mapping.equals(B.mapping));
    }
  }
  if (A.S != null && B.S == null) {
    return new OrdinalSet<T>(A.S,A.mapping);
  }
 else   if (A.S == null && B.S != null) {
    return new OrdinalSet<T>(B.S,B.mapping);
  }
  IntSet union=A.S.union(B.S);
  return new OrdinalSet<T>(union,A.mapping);
}

Fixed version (ground truth):
/** 
 * Creates the union of two ordinal sets.
 * @param A ordinal set a
 * @param B ordinal set b
 * @return union of a and b
 * @throws IllegalArgumentException iff A or B is null
 */
public static <T>OrdinalSet<T> unify(OrdinalSet<T> A,OrdinalSet<T> B){
  if (A == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (B == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (Assertions.verifyAssertions) {
    if (A.size() != 0 && B.size() != 0) {
      Assertions._assert(A.mapping.equals(B.mapping));
    }
  }
  if (A.S == null) {
    return (B.S == null) ? OrdinalSet.<T>empty() : new OrdinalSet<T>(B.S,B.mapping);
  }
 else   if (B.S == null) {
    return (A.S == null) ? OrdinalSet.<T>empty() : new OrdinalSet<T>(A.S,A.mapping);
  }
  IntSet union=A.S.union(B.S);
  return new OrdinalSet<T>(union,A.mapping);
}
Program: 40561
Project: 40561
Buggy source:
/** 
 * @return a set of ConcreteTypeKeys that represent the exceptions the PEI may throw.
 */
public InstanceKey getInstanceKeyForPEI(CGNode node,ProgramCounter peiLoc,TypeReference type){
  return new ConcreteTypeKey(cha.lookupClass(type));
}

Fixed version (ground truth):
/** 
 * @return a set of ConcreteTypeKeys that represent the exceptions the PEI may throw.
 */
public InstanceKey getInstanceKeyForPEI(CGNode node,ProgramCounter peiLoc,TypeReference type){
  IClass klass=cha.lookupClass(type);
  if (klass == null) {
    return null;
  }
  return new ConcreteTypeKey(cha.lookupClass(type));
}
Program: 40563
Project: 40563
Buggy source:
/** 
 * Usage: GVSlice -appJar [jar file name] -mainClass [main class] -srcCaller [method name] -srcCallee [method name] -dd [data dependence options] -cd [control dependence options] -dir [forward|backward] <ul> <li> "jar file name" should be something like "c:/temp/testdata/java_cup.jar" <li> "main class" should beshould be something like "c:/temp/testdata/java_cup.jar" <li> "method name" should be the name of a method. This takes a slice from the statement that calls "srcCallee" from "srcCaller" <li> "data dependence options" can be one of "-full", "-no_base_ptrs", "-no_base_no_heap", "-no_heap", "-no_base_no_heap_no_cast", or "-none".
 * @throws CancelException
 * @throws IllegalArgumentException
 * @see com.ibm.wala.ipa.slicer.Slicer.DataDependenceOptions <li> "control dependence options" can be "-full" or "-none" <li> the -dir argument tells whether to compute a forwards or backwards slice. </ul>
 */
public static void main(String[] args) throws WalaException, IllegalArgumentException, CancelException {
  run(args);
}

Fixed version (ground truth):
/** 
 * Usage: GVSlice -appJar [jar file name] -mainClass [main class] -srcCaller [method name] -srcCallee [method name] -dd [data dependence options] -cd [control dependence options] -dir [forward|backward] <ul> <li> "jar file name" should be something like "c:/temp/testdata/java_cup.jar" <li> "main class" should beshould be something like "c:/temp/testdata/java_cup.jar" <li> "method name" should be the name of a method. This takes a slice from the statement that calls "srcCallee" from "srcCaller" <li> "data dependence options" can be one of "-full", "-no_base_ptrs", "-no_base_no_heap", "-no_heap", "-no_base_no_heap_no_cast", or "-none".
 * @throws CancelException
 * @throws IllegalArgumentException
 * @throws IOException 
 * @see com.ibm.wala.ipa.slicer.Slicer.DataDependenceOptions <li> "control dependence options" can be "-full" or "-none" <li> the -dir argument tells whether to compute a forwards or backwards slice. </ul>
 */
public static void main(String[] args) throws WalaException, IllegalArgumentException, CancelException, IOException {
  run(args);
}
Program: 40566
Project: 40566
Buggy source:
protected void addInstruction(final TypeReference T,SSAInstruction instr,boolean isAllocation){
  if (isAllocation) {
    if (types.contains(T))     return;
  }
  types.add(T);
  allInstructions.add(instr);
  if (isAllocation)   allocations.add(instr);
}

Fixed version (ground truth):
protected void addInstruction(final TypeReference T,SSAInstruction instr,boolean isAllocation){
  if (isAllocation) {
    if (typesAllocated.contains(T)) {
      return;
    }
 else {
      typesAllocated.add(T);
    }
  }
  allInstructions.add(instr);
  if (isAllocation) {
    allocations.add(instr);
  }
}
Program: 40567
Project: 40567
Buggy source:
/** 
 * @param type
 * @return a TypeAbstraction object representing this type. We just useConeTypes by default, since we don't propagate information allowing us to distinguish between points and cones yet.
 */
protected TypeAbstraction typeRef2TypeAbstraction(IClassHierarchy cha,TypeReference type){
  IClass klass=cha.lookupClass(type);
  if (klass != null) {
    return new ConeType(klass);
  }
  Assertions.UNREACHABLE(type.toString());
  return null;
}

Fixed version (ground truth):
/** 
 * @param type
 * @return a TypeAbstraction object representing this type. We just use ConeTypes by default, since we don't propagateinformation allowing us to distinguish between points and cones yet.
 */
protected TypeAbstraction typeRef2TypeAbstraction(IClassHierarchy cha,TypeReference type){
  IClass klass=cha.lookupClass(type);
  if (klass != null) {
    return new ConeType(klass);
  }
  Assertions.UNREACHABLE(type.toString());
  return null;
}
Program: 40568
Project: 40568
Buggy source:
protected int addStatementsForConcreteSimpleType(final TypeReference T){
  if (types.contains(T))   return -1;
  types.add(T);
  if (DEBUG) {
    Trace.println("String_Node_Str" + T);
  }
  NewSiteReference ref=NewSiteReference.make(getNewSiteForType(T),T);
  int alloc=getLocalForType(T);
  SSANewInstruction a=new SSANewInstruction(alloc,ref);
  if (DEBUG) {
    Trace.println("String_Node_Str" + a);
  }
  addInstruction(T,a,true);
  SSAReturnInstruction r=new SSAReturnInstruction(alloc,false);
  addInstruction(T,r,false);
  return alloc;
}

Fixed version (ground truth):
/** 
 * @param T
 * @return value number of the newly allocated object
 */
protected int addStatementsForConcreteSimpleType(final TypeReference T){
}
Program: 40570
Project: 40570
Buggy source:
private void addStatementsForSetOfTypes(Iterator it){
  if (!it.hasNext()) {
    SSAReturnInstruction r=new SSAReturnInstruction(nextLocal,false);
    allInstructions.add(r);
  }
  for (; it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    TypeReference T=klass.getReference();
    if (klass.isAbstract() || types.contains(T)) {
      continue;
    }
    types.add(T);
    int i=getLocalForType(T);
    NewSiteReference ref=NewSiteReference.make(getNewSiteForType(T),T);
    SSANewInstruction a=null;
    if (T.isArrayType()) {
      int[] sizes=new int[T.getDimensionality()];
      initValueNumberForConstantOne();
      Arrays.fill(sizes,valueNumberForConstantOne);
      a=new SSANewInstruction(i,ref,sizes);
    }
 else {
      a=new SSANewInstruction(i,ref);
    }
    allocations.add(a);
    allInstructions.add(a);
    SSAReturnInstruction r=new SSAReturnInstruction(i,false);
    allInstructions.add(r);
    MethodReference init=MethodReference.findOrCreate(T,MethodReference.initAtom,MethodReference.defaultInitDesc);
    CallSiteReference site=CallSiteReference.make(getCallSiteForType(T),init,IInvokeInstruction.Dispatch.SPECIAL);
    int[] params=new int[1];
    params[0]=i;
    SSAInvokeInstruction s=new SSAInvokeInstruction(params,getExceptionsForType(T),site);
    calls.add(s);
    allInstructions.add(s);
  }
}

Fixed version (ground truth):
private void addStatementsForSetOfTypes(Iterator it){
  if (!it.hasNext()) {
    SSAReturnInstruction r=new SSAReturnInstruction(nextLocal,false);
    allInstructions.add(r);
  }
  for (; it.hasNext(); ) {
    IClass klass=(IClass)it.next();
    TypeReference T=klass.getReference();
    if (klass.isAbstract() || typesAllocated.contains(T)) {
      continue;
    }
    typesAllocated.add(T);
    int i=getLocalForType(T);
    NewSiteReference ref=NewSiteReference.make(getNewSiteForType(T),T);
    SSANewInstruction a=null;
    if (T.isArrayType()) {
      int[] sizes=new int[T.getDimensionality()];
      initValueNumberForConstantOne();
      Arrays.fill(sizes,valueNumberForConstantOne);
      a=new SSANewInstruction(i,ref,sizes);
    }
 else {
      a=new SSANewInstruction(i,ref);
    }
    allocations.add(a);
    allInstructions.add(a);
    SSAReturnInstruction r=new SSAReturnInstruction(i,false);
    allInstructions.add(r);
    MethodReference init=MethodReference.findOrCreate(T,MethodReference.initAtom,MethodReference.defaultInitDesc);
    CallSiteReference site=CallSiteReference.make(getCallSiteForType(T),init,IInvokeInstruction.Dispatch.SPECIAL);
    int[] params=new int[1];
    params[0]=i;
    SSAInvokeInstruction s=new SSAInvokeInstruction(params,getExceptionsForType(T),site);
    calls.add(s);
    allInstructions.add(s);
  }
}
Program: 40571
Project: 40571
Buggy source:
/** 
 * Solve the set of dataflow graph. <p> PRECONDITION: graph is set up
 * @return true iff the evaluation of some equation caused a change in thevalue of some variable.
 */
@SuppressWarnings("String_Node_Str") public boolean solve(IProgressMonitor monitor) throws CancelException {
  boolean globalChange=false;
  if (firstSolve) {
    initForFirstSolve();
  }
  while (!workList.isEmpty()) {
    MonitorUtil.worked(monitor,1);
    orderStatements();
    AbstractStatement s=workList.takeStatement();
    if (DEBUG) {
      Trace.println("String_Node_Str" + s);
    }
    byte code=s.evaluate();
    if (verbose) {
      nEvaluated++;
      if (nEvaluated % getVerboseInterval() == 0) {
        performVerboseAction();
      }
      if (nEvaluated % getPeriodicMaintainInterval() == 0) {
        periodicMaintenance();
      }
    }
    if (DEBUG) {
      Trace.println("String_Node_Str" + s + "String_Node_Str"+ isChanged(code));
    }
    if (isChanged(code)) {
      globalChange=true;
      updateWorkList(s);
    }
    if (isFixed(code)) {
      removeStatement(s);
    }
  }
  return globalChange;
}

Fixed version (ground truth):
/** 
 * Solve the set of dataflow graph. <p> PRECONDITION: graph is set up
 * @return true iff the evaluation of some equation caused a change in thevalue of some variable.
 */
@SuppressWarnings("String_Node_Str") public boolean solve(IProgressMonitor monitor) throws CancelException {
  boolean globalChange=false;
  if (firstSolve) {
    initForFirstSolve();
  }
  while (!workList.isEmpty()) {
    MonitorUtil.throwExceptionIfCanceled(monitor);
    orderStatements();
    AbstractStatement s=workList.takeStatement();
    if (DEBUG) {
      Trace.println("String_Node_Str" + s);
    }
    byte code=s.evaluate();
    if (verbose) {
      nEvaluated++;
      if (nEvaluated % getVerboseInterval() == 0) {
        performVerboseAction();
      }
      if (nEvaluated % getPeriodicMaintainInterval() == 0) {
        periodicMaintenance();
      }
    }
    if (DEBUG) {
      Trace.println("String_Node_Str" + s + "String_Node_Str"+ isChanged(code));
    }
    if (isChanged(code)) {
      globalChange=true;
      updateWorkList(s);
    }
    if (isFixed(code)) {
      removeStatement(s);
    }
  }
  return globalChange;
}
Program: 40572
Project: 40572
Buggy source:
public void testReflect1() throws WalaException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA,"String_Node_Str");
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.REFLECT1_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  Warnings.clear();
  CallGraphTest.doCallGraphs(options,new AnalysisCache(),cha,scope,useShortProfile(),false);
  for (Iterator<Warning> it=Warnings.iterator(); it.hasNext(); ) {
    Warning w=(Warning)it.next();
    if (w.toString().indexOf("String_Node_Str") > 0) {
      continue;
    }
    if (w.toString().indexOf("String_Node_Str") >= 0) {
      assertTrue(w.toString(),false);
    }
  }
}

Fixed version (ground truth):
/** 
 * test that when analyzing Reflect1.main(), there is no warning about "Integer".
 */
public void testReflect1() throws WalaException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA,"String_Node_Str");
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.REFLECT1_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  Warnings.clear();
  CallGraphTest.doCallGraphs(options,new AnalysisCache(),cha,scope,useShortProfile(),false);
  for (Iterator<Warning> it=Warnings.iterator(); it.hasNext(); ) {
    Warning w=(Warning)it.next();
    if (w.toString().indexOf("String_Node_Str") > 0) {
      continue;
    }
    if (w.toString().indexOf("String_Node_Str") >= 0) {
      assertTrue(w.toString(),false);
    }
  }
}
Program: 40573
Project: 40573
Buggy source:
@Override public void visitPut(SSAPutInstruction instruction){
  IField f=pa.getClassHierarchy().resolveField(instruction.getDeclaredField());
  if (f != null) {
    if (instruction.isStatic()) {
      result.add(h.getPointerKeyForStaticField(f));
    }
 else {
      PointerKey ref=h.getPointerKeyForLocal(n,instruction.getRef());
      for (      InstanceKey i : pa.getPointsToSet(ref)) {
        result.add(h.getPointerKeyForInstanceField(i,f));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void visitPut(SSAPutInstruction instruction){
  IField f=pa.getClassHierarchy().resolveField(instruction.getDeclaredField());
  if (f != null) {
    if (instruction.isStatic()) {
      result.add(h.getPointerKeyForStaticField(f));
    }
 else {
      PointerKey ref=h.getPointerKeyForLocal(n,instruction.getRef());
      if (ref != null) {
        for (        InstanceKey i : pa.getPointsToSet(ref)) {
          result.add(h.getPointerKeyForInstanceField(i,f));
        }
      }
    }
  }
}
Program: 40574
Project: 40574
Buggy source:
/** 
 * If the   {@link CallSiteReference} invokes Class.forName(s) and s is a string constant, return a{@link JavaTypeContext} representing the type named by s, if we can resolve it in the {@link IClassHierarchy}.
 * @see com.ibm.wala.ipa.callgraph.ContextSelector#getCalleeTarget(com.ibm.wala.ipa.callgraph.CGNode,com.ibm.wala.classLoader.CallSiteReference,com.ibm.wala.classLoader.IMethod,com.ibm.wala.ipa.callgraph.propagation.InstanceKey)
 */
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,InstanceKey receiver){
  if (callee.equals(forNameMethod)) {
    IR ir=caller.getIR();
    SymbolTable symbolTable=ir.getSymbolTable();
    SSAAbstractInvokeInstruction[] invokeInstructions=caller.getIR().getCalls(site);
    if (invokeInstructions.length != 1) {
      return null;
    }
    int use=invokeInstructions[0].getUse(0);
    if (symbolTable.isStringConstant(use)) {
      String className=StringStuff.deployment2CanonicalTypeString(symbolTable.getStringValue(use));
      TypeReference t=TypeReference.findOrCreate(caller.getMethod().getDeclaringClass().getClassLoader().getReference(),className);
      IClass klass=caller.getClassHierarchy().lookupClass(t);
      if (klass != null) {
        return new JavaTypeContext(new PointType(klass));
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * If the   {@link CallSiteReference} invokes Class.forName(s) and s is a string constant, return a{@link JavaTypeContext} representing the type named by s, if we can resolve it in the {@link IClassHierarchy}.
 * @see com.ibm.wala.ipa.callgraph.ContextSelector#getCalleeTarget(com.ibm.wala.ipa.callgraph.CGNode,com.ibm.wala.classLoader.CallSiteReference,com.ibm.wala.classLoader.IMethod,com.ibm.wala.ipa.callgraph.propagation.InstanceKey)
 */
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,InstanceKey receiver){
  if (callee.getReference().equals(ForNameContextInterpreter.FOR_NAME_REF)) {
    IR ir=caller.getIR();
    SymbolTable symbolTable=ir.getSymbolTable();
    SSAAbstractInvokeInstruction[] invokeInstructions=caller.getIR().getCalls(site);
    if (invokeInstructions.length != 1) {
      return null;
    }
    int use=invokeInstructions[0].getUse(0);
    if (symbolTable.isStringConstant(use)) {
      String className=StringStuff.deployment2CanonicalTypeString(symbolTable.getStringValue(use));
      TypeReference t=TypeReference.findOrCreate(caller.getMethod().getDeclaringClass().getClassLoader().getReference(),className);
      IClass klass=caller.getClassHierarchy().lookupClass(t);
      if (klass != null) {
        return new JavaTypeContext(new PointType(klass));
      }
    }
  }
  return null;
}
Program: 40575
Project: 40575
Buggy source:
public ForNameContextSelector(final IClassHierarchy cha){
}

Fixed version (ground truth):
public ForNameContextSelector(){
}
Program: 40576
Project: 40576
Buggy source:
/** 
 * This object may understand a dispatch to Class.forName(s) when s is a string constant.
 */
public boolean mayUnderstand(CGNode caller,CallSiteReference site,IMethod targetMethod,InstanceKey instance){
  if (targetMethod.equals(forNameMethod)) {
    IR ir=caller.getIR();
    SymbolTable symbolTable=ir.getSymbolTable();
    SSAAbstractInvokeInstruction[] invokeInstructions=caller.getIR().getCalls(site);
    if (invokeInstructions.length != 1) {
      return false;
    }
    int use=invokeInstructions[0].getUse(0);
    if (symbolTable.isStringConstant(use)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * This object may understand a dispatch to Class.forName(s) when s is a string constant.
 */
public boolean mayUnderstand(CGNode caller,CallSiteReference site,IMethod targetMethod,InstanceKey instance){
  if (targetMethod.getReference().equals(ForNameContextInterpreter.FOR_NAME_REF)) {
    IR ir=caller.getIR();
    SymbolTable symbolTable=ir.getSymbolTable();
    SSAAbstractInvokeInstruction[] invokeInstructions=caller.getIR().getCalls(site);
    if (invokeInstructions.length != 1) {
      return false;
    }
    int use=invokeInstructions[0].getUse(0);
    if (symbolTable.isStringConstant(use)) {
      return true;
    }
  }
  return false;
}
Program: 40577
Project: 40577
Buggy source:
/** 
 * First check "forName" logic, then factory logic.
 */
private ReflectionContextSelector(IClassHierarchy cha,MethodTargetSelector methodTargetSelector){
  super(new ForNameContextSelector(cha),new FactoryContextSelector(cha,methodTargetSelector));
}

Fixed version (ground truth):
/** 
 * First check "forName" logic, then factory logic.
 */
private ReflectionContextSelector(IClassHierarchy cha,MethodTargetSelector methodTargetSelector){
  super(new ForNameContextSelector(),new FactoryContextSelector(cha,methodTargetSelector));
}
Program: 40578
Project: 40578
Buggy source:
@Override public void visitLoadClass(SSALoadClassInstruction instruction){
  PointerKey def=getPointerKeyForLocal(instruction.getDef());
  InstanceKey iKey=getInstanceKeyForClassObject(instruction.getLoadedClass());
  if (!contentsAreInvariant(symbolTable,du,instruction.getDef())) {
    system.newConstraint(def,iKey);
  }
 else {
    system.findOrCreateIndexForInstanceKey(iKey);
    system.recordImplicitPointsToSet(def);
  }
}

Fixed version (ground truth):
@Override public void visitLoadClass(SSALoadClassInstruction instruction){
  PointerKey def=getPointerKeyForLocal(instruction.getDef());
  InstanceKey iKey=getInstanceKeyForClassObject(instruction.getLoadedClass());
  IClass klass=getClassHierarchy().lookupClass(instruction.getLoadedClass());
  if (klass != null) {
    processClassInitializer(klass);
  }
  if (!contentsAreInvariant(symbolTable,du,instruction.getDef())) {
    system.newConstraint(def,iKey);
  }
 else {
    system.findOrCreateIndexForInstanceKey(iKey);
    system.recordImplicitPointsToSet(def);
  }
}
Program: 40579
Project: 40579
Buggy source:
/** 
 * Does m represent a static factory method we know about from the standard libraries, that we usually wish to model with one level of call-string context?
 */
public static boolean isWellKnownStaticFactory(MethodReference m){
  if (m.getDeclaringClass().equals(TypeReference.JavaLangSystem)) {
    if (m.getName().toString().equals("String_Node_Str")) {
      return true;
    }
  }
  if (m.equals(synthArraycopy)) {
    return true;
  }
  if (m.equals(ArraysAsList)) {
    return true;
  }
  if (m.equals(ArraysCopyOfRange)) {
    return true;
  }
  if (m.equals(ArraysCopyOf)) {
    return true;
  }
  if (m.equals(ArraysCopyOf2)) {
    return true;
  }
  if (m.equals(StringValueOf)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Does m represent a static factory method we know about from the standard libraries, that we usually wish to model with one level of call-string context?
 */
public static boolean isWellKnownStaticFactory(MethodReference m){
  if (m.getDeclaringClass().equals(TypeReference.JavaLangSystem)) {
    if (m.getName().toString().equals("String_Node_Str")) {
      return true;
    }
  }
  if (m.equals(synthArraycopy)) {
    return true;
  }
  if (m.equals(ArraysAsList)) {
    return true;
  }
  if (m.equals(ArraysCopyOfRange)) {
    return true;
  }
  if (m.equals(ArraysCopyOf)) {
    return true;
  }
  if (m.equals(ArraysCopyOf2)) {
    return true;
  }
  if (m.equals(StringValueOf)) {
    return true;
  }
  if (m.equals(HashtableNewEntry)) {
    return true;
  }
  return false;
}