nus-yam/ex-repair huggingface dataset:
Program: 38405
Project: 38405
Buggy source:
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (DEBUG)   System.err.println(("String_Node_Str" + N));
  String fnName=composeEntityName(definingContext,N);
  if (DEBUG)   System.err.println(cfg);
  symtab.getConstant("String_Node_Str");
  symtab.getConstant("String_Node_Str");
  for (int i=0; i < 15; i++) {
    symtab.getConstant(i);
  }
  ((JavaScriptLoader)loader).defineCodeBodyCode("String_Node_Str" + fnName,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}

Fixed version (ground truth):
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (DEBUG)   System.err.println(("String_Node_Str" + N));
  String fnName=composeEntityName(definingContext,N);
  if (DEBUG)   System.err.println(cfg);
  symtab.getConstant("String_Node_Str");
  symtab.getConstant("String_Node_Str");
  for (int i=0; i < 20; i++) {
    symtab.getConstant(i);
  }
  ((JavaScriptLoader)loader).defineCodeBodyCode("String_Node_Str" + fnName,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}
Program: 38406
Project: 38406
Buggy source:
protected void doFieldWrite(WalkContext context,int receiver,CAstNode elt,CAstNode parent,int rval){
  this.visit(elt,context,this);
  if (elt.getKind() == CAstNode.CONSTANT && elt.getValue() instanceof String) {
    context.cfg().addInstruction(((JSInstructionFactory)insts).PutInstruction(receiver,rval,(String)elt.getValue()));
  }
 else {
    context.cfg().addInstruction(((JSInstructionFactory)insts).PropertyWrite(receiver,getValue(elt),rval));
  }
}

Fixed version (ground truth):
protected void doFieldWrite(WalkContext context,int receiver,CAstNode elt,CAstNode parent,int rval){
}
Program: 38408
Project: 38408
Buggy source:
public void setPc(int pc){
  Integer lineNum=pcToLine.get(pc);
  if (lineNum != null) {
    irLines.ensureIndexIsVisible(lineNum);
    irLines.setSelectedIndex(lineNum);
  }
}

Fixed version (ground truth):
public void setPc(int pc){
  Integer lineNum=pcToLine.get(pc);
  if (lineNum != null) {
    irLines.ensureIndexIsVisible(lineNum);
    irLines.setSelectedIndex(lineNum);
  }
 else {
    removeSelection();
  }
}
Program: 38409
Project: 38409
Buggy source:
public void setIRAndPc(IR ir,int pc){
  setIR(ir);
  if (pc != NA) {
    setPc(pc);
  }
 else {
    int curSelectedIndex=irLines.getSelectedIndex();
    irLines.removeSelectionInterval(curSelectedIndex,curSelectedIndex);
  }
}

Fixed version (ground truth):
public void setIRAndPc(IR ir,int pc){
  setIR(ir);
  if (pc != NA) {
    setPc(pc);
  }
 else {
    removeSelection();
  }
}
Program: 38410
Project: 38410
Buggy source:
public void setSource(URL url,int sourceLine){
  sourceCodeLocation.setText("String_Node_Str" + url);
  loadSource(url);
  if (sourceLine != IrViewer.NA) {
    sourceCodeLines.ensureIndexIsVisible(sourceLine - 1);
    sourceCodeLines.setSelectedIndex(sourceLine - 1);
    sourceCodeLines.validate();
  }
}

Fixed version (ground truth):
public void setSource(URL url,int sourceLine){
  boolean succsess=loadSource(url);
  if (succsess) {
    sourceCodeLocation.setText("String_Node_Str" + url);
    if (sourceLine != IrViewer.NA) {
      sourceCodeLines.ensureIndexIsVisible(sourceLine - 1);
      sourceCodeLines.setSelectedIndex(sourceLine - 1);
      sourceCodeLines.validate();
    }
  }
 else {
    sourceCodeLocation.setText("String_Node_Str" + url);
  }
}
Program: 38411
Project: 38411
Buggy source:
public void removeSource(){
  sourceURL=null;
  sourceCodeLocation=new JTextField("String_Node_Str");
  sourceCodeLinesList.clear();
  sourceCodeLines.validate();
}

Fixed version (ground truth):
public void removeSource(){
  sourceURL=null;
  sourceCodeLocation.setText("String_Node_Str");
  sourceCodeLinesList.clear();
  sourceCodeLines.validate();
}
Program: 38412
Project: 38412
Buggy source:
@Test public void testTestCD5() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=findOrCreateAnalysisScope();
  IClassHierarchy cha=findOrCreateCHA(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE_TESTCD5);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,new AnalysisCache(),cha,scope);
  CallGraph cg=builder.makeCallGraph(options,null);
  CGNode main=findMainMethod(cg);
  Statement s=new MethodEntryStatement(main);
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeForwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.NONE,ControlDependenceOptions.FULL);
  dumpSlice(slice);
  Assert.assertTrue(slice.size() > 1);
}

Fixed version (ground truth):
@Test public void testTestCD5() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=findOrCreateAnalysisScope();
  IClassHierarchy cha=findOrCreateCHA(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE_TESTCD5);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,new AnalysisCache(),cha,scope);
  CallGraph cg=builder.makeCallGraph(options,null);
  CGNode main=findMainMethod(cg);
  Statement s=new MethodEntryStatement(main);
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeForwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.NONE,ControlDependenceOptions.NO_EXCEPTIONAL_EDGES);
  dumpSlice(slice);
  Assert.assertTrue(slice.size() > 1);
}
Program: 38413
Project: 38413
Buggy source:
@Override public void visitCheckCast(SSACheckCastInstruction instruction){
  TypeAbstraction typeAbs=null;
  for (  TypeReference type : instruction.getDeclaredResultTypes()) {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      typeAbs=BOTTOM;
    }
 else {
      if (typeAbs == null) {
        typeAbs=new ConeType(klass);
      }
 else {
        typeAbs=typeAbs.meet(new ConeType(klass));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void visitCheckCast(SSACheckCastInstruction instruction){
  TypeAbstraction typeAbs=null;
  for (  TypeReference type : instruction.getDeclaredResultTypes()) {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      typeAbs=BOTTOM;
    }
 else {
      if (typeAbs == null) {
        typeAbs=new ConeType(klass);
      }
 else {
        typeAbs=typeAbs.meet(new ConeType(klass));
      }
    }
  }
  result=new DeclaredTypeOperator(typeAbs);
}
Program: 38414
Project: 38414
Buggy source:
public static int countNormals(Collection<Statement> slice){
  int count=0;
  for (  Statement s : slice) {
    if (s.getKind().equals(Statement.Kind.NORMAL)) {
      NormalStatement ns=(NormalStatement)s;
      count++;
    }
  }
  return count;
}

Fixed version (ground truth):
public static int countNormals(Collection<Statement> slice){
  int count=0;
  for (  Statement s : slice) {
    if (s.getKind().equals(Statement.Kind.NORMAL)) {
      count++;
    }
  }
  return count;
}
Program: 38415
Project: 38415
Buggy source:
public void handleSimpleTag(HTML.Tag t,MutableAttributeSet a,int pos){
  System.out.println("String_Node_Str" + t);
  if (script) {
    try {
      writeEmbeddedScript("String_Node_Str" + t);
      Enumeration names=a.getAttributeNames();
      while (names.hasMoreElements()) {
        Object name=names.nextElement();
        Object val=a.getAttribute(name);
        writeEmbeddedScript("String_Node_Str" + name + "String_Node_Str"+ val+ "String_Node_Str");
      }
      writeEmbeddedScript("String_Node_Str" + t + "String_Node_Str");
    }
 catch (    IOException e) {
    }
  }
 else {
    String nm=createElement(t,a);
    endElement(nm);
  }
}

Fixed version (ground truth):
public void handleSimpleTag(HTML.Tag t,MutableAttributeSet a,int pos){
  System.out.println("String_Node_Str" + t);
  if (script) {
  }
 else {
    String nm=createElement(t,a,pos);
    endElement(nm);
  }
}
Program: 38417
Project: 38417
Buggy source:
public void handleEndTag(HTML.Tag t,int pos){
  if (t.toString().toUpperCase().equals("String_Node_Str")) {
    System.out.println("String_Node_Str");
    try {
      writeEmbeddedScript("String_Node_Str");
    }
 catch (    IOException e) {
    }
    script=false;
  }
  endElement(stack.pop());
}

Fixed version (ground truth):
public void handleEndTag(HTML.Tag t,int pos){
  if (t.toString().toUpperCase().equals("String_Node_Str")) {
    System.out.println("String_Node_Str");
    if (script)     try {
      int scriptEnd=pos;
      InputStreamReader script=new InputStreamReader(input.openStream());
      char[] buf=new char[scriptEnd];
      script.read(buf);
      String s=String.valueOf(buf,scriptStart,scriptEnd - scriptStart);
      writeEmbeddedScript(s.substring(s.indexOf('>') + 1));
    }
 catch (    IOException e) {
    }
    script=false;
  }
  endElement(stack.pop());
}
Program: 38418
Project: 38418
Buggy source:
private void writeEmbeddedScript(String text) throws IOException {
  embeddedScriptFile.write(text);
  embeddedScriptFile.write("String_Node_Str");
}

Fixed version (ground truth):
private void writeEmbeddedScript(String text) throws IOException {
  embeddedScriptFile.write(text);
}
Program: 38419
Project: 38419
Buggy source:
public void handleStartTag(HTML.Tag t,MutableAttributeSet a,int pos){
  String varName=createElement(t,a);
  stack.push(varName);
}

Fixed version (ground truth):
public void handleStartTag(HTML.Tag t,MutableAttributeSet a,int pos){
  String varName=createElement(t,a,pos);
  stack.push(varName);
}
Program: 38420
Project: 38420
Buggy source:
public HTMLEditorKit.ParserCallback createCallback(URL input,FileWriter domTreeFile,FileWriter embeddedScriptFile,FileWriter entrypointFile){
  return new HTMLCallback(input,domTreeFile,embeddedScriptFile,entrypointFile);
}

Fixed version (ground truth):
public HTMLCallback createCallback(URL input,FileWriter domTreeFile,FileWriter embeddedScriptFile,FileWriter entrypointFile){
  return new HTMLCallback(input,domTreeFile,embeddedScriptFile,entrypointFile);
}
Program: 38421
Project: 38421
Buggy source:
public void generate(URL input,File outFile) throws IOException {
  InputStreamReader fr=getStream(input);
  FileWriter out=new FileWriter(outFile);
  FileWriter out1=new FileWriter(temp1);
  FileWriter out2=new FileWriter(temp2);
  FileWriter out3=new FileWriter(temp3);
  ParserDelegator pd=new ParserDelegator();
  HTMLEditorKit.ParserCallback cb=callbackFactory.createCallback(input,out1,out2,out3);
  pd.parse(fr,cb,ignoreCharset);
  out1.close();
  out2.close();
  out3.close();
  out.write("String_Node_Str" + input + "String_Node_Str");
  writeRegion(out,"String_Node_Str",temp2);
  writeRegion(out,"String_Node_Str",temp1);
  out.write("String_Node_Str");
  writeRegion(out,"String_Node_Str",temp3);
  out.write("String_Node_Str");
  generateTrailer(out,cb);
  out.close();
}

Fixed version (ground truth):
public void generate(URL input,File outFile) throws IOException {
  InputStreamReader fr=getStream(input);
  FileWriter out=new FileWriter(outFile);
  FileWriter out1=new FileWriter(temp1);
  FileWriter out2=new FileWriter(temp2);
  FileWriter out3=new FileWriter(temp3);
  ParserDelegator pd=new ParserDelegator();
  HTMLCallback cb=callbackFactory.createCallback(input,out1,out2,out3);
  pd.parse(fr,cb,ignoreCharset);
  out1.flush();
  out1.close();
  out2.flush();
  out2.close();
  out3.flush();
  out3.close();
  out.write("String_Node_Str" + input + "String_Node_Str");
  writeRegion(out,"String_Node_Str",temp2);
  writeRegion(out,"String_Node_Str",temp1);
  out.write("String_Node_Str");
  writeRegion(out,"String_Node_Str",temp3);
  out.write("String_Node_Str");
  generateTrailer(out,cb);
  out.close();
}
Program: 38423
Project: 38423
Buggy source:
private void getScript(char[] data){
  if (script) {
    try {
      writeEmbeddedScript(data);
    }
 catch (    IOException e) {
      System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void getScript(char[] data){
  if (script) {
    try {
      writeEmbeddedScript(data,data.length);
    }
 catch (    IOException e) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 38425
Project: 38425
Buggy source:
public boolean isExit(Statement n){
switch (n.getKind()) {
case PARAM_CALLEE:
case HEAP_PARAM_CALLEE:
case PHI:
case PI:
case NORMAL_RET_CALLER:
case PARAM_CALLER:
case HEAP_RET_CALLER:
case NORMAL:
case EXC_RET_CALLER:
case METHOD_ENTRY:
case CATCH:
    return false;
case HEAP_RET_CALLEE:
case EXC_RET_CALLEE:
case NORMAL_RET_CALLEE:
case METHOD_EXIT:
  return true;
default :
Assertions.UNREACHABLE(n.toString());
return false;
}
}

Fixed version (ground truth):
public boolean isExit(Statement n){
switch (n.getKind()) {
case PARAM_CALLEE:
case HEAP_PARAM_CALLEE:
case HEAP_PARAM_CALLER:
case PHI:
case PI:
case NORMAL_RET_CALLER:
case PARAM_CALLER:
case HEAP_RET_CALLER:
case NORMAL:
case EXC_RET_CALLER:
case METHOD_ENTRY:
case CATCH:
    return false;
case HEAP_RET_CALLEE:
case EXC_RET_CALLEE:
case NORMAL_RET_CALLEE:
case METHOD_EXIT:
  return true;
default :
Assertions.UNREACHABLE(n.toString());
return false;
}
}
Program: 38426
Project: 38426
Buggy source:
public static CGNode findMainMethod(CallGraph cg){
  Descriptor d=Descriptor.findOrCreateUTF8("String_Node_Str");
  Atom name=Atom.findOrCreateUnicodeAtom("String_Node_Str");
  for (Iterator<? extends CGNode> it=cg.getSuccNodes(cg.getFakeRootNode()); it.hasNext(); ) {
    CGNode n=it.next();
    if (n.getMethod().getName().equals(name) && n.getMethod().getDescriptor().equals(d)) {
      return n;
    }
  }
  Assertions.UNREACHABLE("String_Node_Str");
  return null;
}

Fixed version (ground truth):
public static CGNode findMainMethod(CallGraph cg){
  Descriptor d=Descriptor.findOrCreateUTF8("String_Node_Str");
  Atom name=Atom.findOrCreateUnicodeAtom("String_Node_Str");
  return findMethod(cg,d,name);
}
Program: 38427
Project: 38427
Buggy source:
/** 
 * Create nodes corresponding to <ul> <li> phi instructions <li> getCaughtExceptions </ul>
 */
private void createSpecialStatements(IR ir){
  for (Iterator<SSAInstruction> it=ir.iterateAllInstructions(); it.hasNext(); ) {
    SSAInstruction s=it.next();
    if (s instanceof SSAPhiInstruction) {
      delegate.addNode(new PhiStatement(node,(SSAPhiInstruction)s));
    }
 else     if (s instanceof SSAGetCaughtExceptionInstruction) {
      delegate.addNode(new GetCaughtExceptionStatement(node,(SSAGetCaughtExceptionInstruction)s));
    }
 else     if (s instanceof SSAPiInstruction) {
      delegate.addNode(new PiStatement(node,(SSAPiInstruction)s));
    }
  }
}

Fixed version (ground truth):
/** 
 * Create nodes corresponding to <ul> <li>phi instructions <li>getCaughtExceptions </ul>
 */
private void createSpecialStatements(IR ir){
  for (Iterator<SSAInstruction> it=ir.iterateAllInstructions(); it.hasNext(); ) {
    SSAInstruction s=it.next();
    if (s instanceof SSAPhiInstruction) {
      delegate.addNode(new PhiStatement(node,(SSAPhiInstruction)s));
    }
 else     if (s instanceof SSAGetCaughtExceptionInstruction) {
      delegate.addNode(new GetCaughtExceptionStatement(node,(SSAGetCaughtExceptionInstruction)s));
    }
 else     if (s instanceof SSAPiInstruction) {
      delegate.addNode(new PiStatement(node,(SSAPiInstruction)s));
    }
  }
}
Program: 38428
Project: 38428
Buggy source:
/** 
 * Create nodes in the graph corresponding to "normal" (bytecode) instructions
 */
private void createNormalStatements(IR ir,Map<CGNode,OrdinalSet<PointerKey>> ref){
  SSAInstruction[] instructions=ir.getInstructions();
  for (int i=0; i < instructions.length; i++) {
    SSAInstruction s=instructions[i];
    if (s instanceof SSAGetCaughtExceptionInstruction) {
      continue;
    }
    if (s != null) {
      delegate.addNode(new NormalStatement(node,i));
    }
    if (s instanceof SSAAbstractInvokeInstruction) {
      addParamPassingStatements(i,ref,ir);
    }
  }
}

Fixed version (ground truth):
/** 
 * Create nodes in the graph corresponding to "normal" (bytecode) instructions
 */
private void createNormalStatements(IR ir,Map<CGNode,OrdinalSet<PointerKey>> ref){
  SSAInstruction[] instructions=ir.getInstructions();
  for (int i=0; i < instructions.length; i++) {
    SSAInstruction s=instructions[i];
    if (s instanceof SSAGetCaughtExceptionInstruction) {
      continue;
    }
    if (s != null) {
      final NormalStatement statement=new NormalStatement(node,i);
      delegate.addNode(statement);
      if (s instanceof SSAAbstractInvokeInstruction) {
        callSite2Statement.put(((SSAAbstractInvokeInstruction)s).getCallSite(),statement);
        addParamPassingStatements(i,ref,ir);
      }
    }
  }
}
Program: 38429
Project: 38429
Buggy source:
public Iterator<? extends Statement> getCallSites(Statement r,PDG callee){
switch (r.getKind()) {
case EXC_RET_CALLER:
{
      ExceptionalReturnCaller n=(ExceptionalReturnCaller)r;
      SSAAbstractInvokeInstruction call=n.getInstruction();
      PDG pdg=getProcOf(r);
      return pdg.getCallerParamStatements(call).iterator();
    }
case NORMAL_RET_CALLER:
{
    NormalReturnCaller n=(NormalReturnCaller)r;
    SSAAbstractInvokeInstruction call=n.getInstruction();
    PDG pdg=getProcOf(r);
    return pdg.getCallerParamStatements(call).iterator();
  }
case HEAP_RET_CALLER:
{
  HeapStatement.HeapReturnCaller n=(HeapStatement.HeapReturnCaller)r;
  SSAAbstractInvokeInstruction call=n.getCall();
  PDG pdg=getProcOf(r);
  return pdg.getCallerParamStatements(call).iterator();
}
default :
Assertions.UNREACHABLE(r.getKind().toString());
return null;
}
}

Fixed version (ground truth):
public Iterator<? extends Statement> getCallSites(Statement r,PDG callee){
switch (r.getKind()) {
case EXC_RET_CALLER:
{
      ExceptionalReturnCaller n=(ExceptionalReturnCaller)r;
      SSAAbstractInvokeInstruction call=n.getInstruction();
      PDG pdg=getProcOf(r);
      return pdg.getCallStatements(call).iterator();
    }
case NORMAL_RET_CALLER:
{
    NormalReturnCaller n=(NormalReturnCaller)r;
    SSAAbstractInvokeInstruction call=n.getInstruction();
    PDG pdg=getProcOf(r);
    return pdg.getCallStatements(call).iterator();
  }
case HEAP_RET_CALLER:
{
  HeapStatement.HeapReturnCaller n=(HeapStatement.HeapReturnCaller)r;
  SSAAbstractInvokeInstruction call=n.getCall();
  PDG pdg=getProcOf(r);
  return pdg.getCallStatements(call).iterator();
}
default :
Assertions.UNREACHABLE(r.getKind().toString());
return null;
}
}
Program: 38430
Project: 38430
Buggy source:
/** 
 * create a demand points-to analysis runner using a   {@link DemandPointerFlowGraph} as the underlying flow graph.
 * @see #make(CallGraph,HeapModel,MemoryAccessMap,IClassHierarchy,AnalysisOptions,StateMachineFactory,IFlowGraph)
 */
public static DemandRefinementPointsTo makeWithDefaultFlowGraph(CallGraph cg,HeapModel model,MemoryAccessMap mam,IClassHierarchy cha,AnalysisOptions options,StateMachineFactory<IFlowLabel> stateMachineFactory){
  return make(cg,new ThisFilteringHeapModel(model,cha),mam,cha,options,stateMachineFactory,new DemandPointerFlowGraph(cg,model,mam,cha));
}

Fixed version (ground truth):
/** 
 * create a demand points-to analysis runner
 * @param cg the underlying call graph for the analysis
 * @param model the heap model to be used for the analysis
 * @param mam indicates what code reads or writes each field
 * @param cha
 * @param options
 * @param stateMachineFactory factory for state machines to track additional properties like calling context
 */
public static DemandRefinementPointsTo makeWithDefaultFlowGraph(CallGraph cg,HeapModel model,MemoryAccessMap mam,IClassHierarchy cha,AnalysisOptions options,StateMachineFactory<IFlowLabel> stateMachineFactory){
  final ThisFilteringHeapModel thisFilteringHeapModel=new ThisFilteringHeapModel(model,cha);
  return new DemandRefinementPointsTo(cg,thisFilteringHeapModel,mam,cha,options,stateMachineFactory,new DemandPointerFlowGraph(cg,thisFilteringHeapModel,mam,cha));
}
Program: 38431
Project: 38431
Buggy source:
@Test public void testFlowsToLocals() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  doFlowsToSizeTest(TestInfo.FLOWSTO_TEST_LOCALS,1);
}

Fixed version (ground truth):
@Test public void testFlowsToLocals() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  doFlowsToSizeTest(TestInfo.FLOWSTO_TEST_LOCALS,4);
}
Program: 38432
Project: 38432
Buggy source:
/** 
 * get all the pointer keys that some instance key can flow to
 */
public Pair<PointsToResult,Collection<PointerKey>> getFlowsTo(InstanceKey ik){
}

Fixed version (ground truth):
/** 
 * get all the pointer keys that some instance key can flow to
 * @return a pair consisting of (1) a {@link PointsToResult} indicating whether a flows-to set was computed, and (2) the lastcomputed flows-to set for the instance key (possibly <code>null</code> if no flows-to set could be computed in the budget)
 */
public Pair<PointsToResult,Collection<PointerKey>> getFlowsTo(InstanceKey ik){
}
Program: 38433
Project: 38433
Buggy source:
/** 
 * returns the instance key corresponding to the single allocation site of type FlowsToType
 */
private static InstanceKey getFlowsToInstanceKey(CGNode mainMethod,HeapModel heapModel){
}

Fixed version (ground truth):
/** 
 * returns the instance key corresponding to the single allocation site of type FlowsToType
 */
private InstanceKey getFlowsToInstanceKey(CGNode mainMethod,HeapModel heapModel){
}
Program: 38434
Project: 38434
Buggy source:
private Collection<PointerKey> getFlowsToSetToTest(String mainClass) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  final DemandRefinementPointsTo dmp=makeDemandPointerAnalysis(mainClass);
  CGNode mainMethod=AbstractPtrTest.findMainMethod(dmp.getBaseCallGraph());
  InstanceKey keyToQuery=AbstractPtrTest.getFlowsToInstanceKey(mainMethod,dmp.getHeapModel());
  Collection<PointerKey> flowsTo=dmp.getFlowsTo(keyToQuery).snd;
  return flowsTo;
}

Fixed version (ground truth):
private Collection<PointerKey> getFlowsToSetToTest(String mainClass) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  final DemandRefinementPointsTo dmp=makeDemandPointerAnalysis(mainClass);
  CGNode mainMethod=AbstractPtrTest.findMainMethod(dmp.getBaseCallGraph());
  InstanceKey keyToQuery=getFlowsToInstanceKey(mainMethod,dmp.getHeapModel());
  Collection<PointerKey> flowsTo=dmp.getFlowsTo(keyToQuery).snd;
  return flowsTo;
}
Program: 38435
Project: 38435
Buggy source:
@Override protected void compute(){
  InstanceKey ik=queriedIkAndState.getInstanceKey();
  g.addSubgraphForNode(((InstanceKeyWithNode)ik).getNode());
  for (  Object pred : Iterator2Iterable.make(g.getPredNodes(ik,NewLabel.v()))) {
    PointerKey predPk=(PointerKey)pred;
    PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,queriedIkAndState.getState());
    theFlowsToSet.add(predPkAndState);
    findOrCreate(pkToP2Set,predPkAndState).add(queriedIkAndStateNum);
    addToPToWorklist(predPkAndState);
  }
  worklistLoop();
}

Fixed version (ground truth):
@Override protected void compute(){
  InstanceKey ik=queriedIkAndState.getInstanceKey();
  g.addSubgraphForNode(((InstanceKeyWithNode)ik).getNode());
  for (  Object pred : Iterator2Iterable.make(g.getPredNodes(ik,NewLabel.v()))) {
    PointerKey predPk=(PointerKey)pred;
    PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,queriedIkAndState.getState());
    theFlowsToSet.add(predPkAndState);
    findOrCreate(pkToTrackedSet,predPkAndState).add(queriedIkAndStateNum);
    addToTrackedPToWorklist(predPkAndState);
  }
  worklistLoop();
}
Program: 38436
Project: 38436
Buggy source:
/** 
 * here, we want to add the graph unconditionally if pkAndState can point to the queried instance key
 */
@Override protected boolean calleeSubGraphMissingAndShouldNotBeAdded(boolean addGraphs,CGNode callee,PointerKeyAndState pkAndState){
  if (find(pkToP2Set,pkAndState).contains(queriedIkAndStateNum)) {
    return false;
  }
 else {
    return super.calleeSubGraphMissingAndShouldNotBeAdded(addGraphs,callee,pkAndState);
  }
}

Fixed version (ground truth):
/** 
 * when doing backward interprocedural propagation, is it true that we should not add a graph representation for a callee _and_ that the subgraph for the callee is missing?
 * @param addGraphs whether graphs should always be added
 * @param callee
 * @param pkAndState
 * @return
 */
protected boolean calleeSubGraphMissingAndShouldNotBeAdded(boolean addGraphs,CGNode callee,PointerKeyAndState pkAndState){
  return !addGraphs && !g.hasSubgraphForNode(callee);
}
Program: 38437
Project: 38437
Buggy source:
@Override protected void handleBackCopy(PointerKeyAndState curPkAndState,PointerKey predPk,IFlowLabel label){
  final MutableIntSet curPkP2Set=find(pkToP2Set,curPkAndState);
  if (curPkP2Set.contains(queriedIkAndStateNum)) {
    PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,stateMachine.transition(curPkAndState.getState(),label));
    if (addAllToP2Set(pkToP2Set,predPkAndState,curPkP2Set,label)) {
      theFlowsToSet.add(predPkAndState);
      addToPToWorklist(predPkAndState);
    }
  }
 else {
    super.handleBackCopy(curPkAndState,predPk,label);
  }
}

Fixed version (ground truth):
protected void handleBackCopy(PointerKeyAndState curPkAndState,PointerKey predPk,IFlowLabel label){
  for (  PointerKeyAndState predPkAndState : matchingPToQueried(curPkAndState,predPk,label)) {
    if (addAllToP2Set(pkToP2Set,predPkAndState,find(pkToP2Set,curPkAndState),label)) {
      addToPToWorklist(predPkAndState);
    }
  }
}
Program: 38438
Project: 38438
Buggy source:
public JDTJava15IRTests(){
  super("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public JDTJava15IRTests(){
  super("String_Node_Str");
}
Program: 38439
Project: 38439
Buggy source:
public JDTJavaIRTests(){
  super("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public JDTJavaIRTests(){
  super("String_Node_Str");
}
Program: 38440
Project: 38440
Buggy source:
public PolyglotJavaIRTests(){
  super("String_Node_Str");
}

Fixed version (ground truth):
public PolyglotJavaIRTests(){
  super(null);
}
Program: 38441
Project: 38441
Buggy source:
protected String singleJavaPkgInputForTest(String pkgName){
  return pkgName + File.separator + getName().substring(4)+ "String_Node_Str";
}

Fixed version (ground truth):
protected String singleJavaPkgInputForTest(String pkgName){
  return pkgName + File.separator + getTestName().substring(4)+ "String_Node_Str";
}
Program: 38442
Project: 38442
Buggy source:
protected String singleInputForTest(){
  return getName().substring(4);
}

Fixed version (ground truth):
protected String singleInputForTest(){
  return getTestName().substring(4);
}
Program: 38443
Project: 38443
Buggy source:
protected String singleJavaInputForTest(){
  return getName().substring(4) + "String_Node_Str";
}

Fixed version (ground truth):
protected String singleJavaInputForTest(){
  return getTestName().substring(4) + "String_Node_Str";
}
Program: 38444
Project: 38444
Buggy source:
public IRTests(String name,String projectName){
  this.name=name;
  this.projectName=projectName;
}

Fixed version (ground truth):
protected IRTests(String projectName){
  this.projectName=projectName;
}
Program: 38445
Project: 38445
Buggy source:
protected String[] simplePkgTestEntryPoint(String pkgName){
  return new String[]{"String_Node_Str" + pkgName + "String_Node_Str"+ getName().substring(4)};
}

Fixed version (ground truth):
protected String[] simplePkgTestEntryPoint(String pkgName){
  return new String[]{"String_Node_Str" + pkgName + "String_Node_Str"+ getTestName().substring(4)};
}
Program: 38446
Project: 38446
Buggy source:
protected String[] simpleTestEntryPoint(){
  return new String[]{"String_Node_Str" + getName().substring(4)};
}

Fixed version (ground truth):
protected String[] simpleTestEntryPoint(){
  return new String[]{"String_Node_Str" + getTestName().substring(4)};
}
Program: 38447
Project: 38447
Buggy source:
public JLexTest(String name){
  super(name,null);
}

Fixed version (ground truth):
public JLexTest(){
  super(null);
}
Program: 38448
Project: 38448
Buggy source:
public JavaIRTests(String name){
  this(name,null);
}

Fixed version (ground truth):
public JavaIRTests(){
  this(null);
}
Program: 38449
Project: 38449
Buggy source:
public NameAwareTestClassRunner(Class<?> klass) throws InitializationError {
  super(klass);
}

Fixed version (ground truth):
public NameAwareTestClassRunner(Class<?> klass){
  super(klass);
}
Program: 38450
Project: 38450
Buggy source:
public SyncDuplicatorTest(String name){
  super(name,null);
}

Fixed version (ground truth):
public SyncDuplicatorTest(){
  super(null);
}
Program: 38451
Project: 38451
Buggy source:
/** 
 * Does the file name represent a .java file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException  if fileName is null
 */
public static boolean isSourceFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int suffixIndex=fileName.indexOf("String_Node_Str");
  if (suffixIndex > -1 && fileName.indexOf(CLASSPATH) == -1) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Does the file name represent a .java file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException if fileName is null
 */
public static boolean isSourceFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return fileName.endsWith("String_Node_Str");
}
Program: 38452
Project: 38452
Buggy source:
/** 
 * Does the file name represent a .class file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException  if fileName is null
 */
public static boolean isClassFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int suffixIndex=fileName.indexOf(CLASS_SUFFIX);
  if (suffixIndex > -1 && fileName.indexOf(CLASSPATH) == -1) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Does the file name represent a .class file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException if fileName is null
 */
public static boolean isClassFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return fileName.endsWith(CLASS_SUFFIX);
}
Program: 38453
Project: 38453
Buggy source:
/** 
 * Strip the ".class" or ".java" suffix from a file name TODO: generalize for all suffixes
 * @param fileName the file name
 * @throws IllegalArgumentException  if fileName is null
 */
public static String stripSuffix(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int suffixIndex=fileName.indexOf(CLASS_SUFFIX);
  suffixIndex=(suffixIndex > -1) ? suffixIndex : fileName.indexOf("String_Node_Str");
  if (suffixIndex > -1) {
    return fileName.substring(0,suffixIndex);
  }
 else {
    return fileName;
  }
}

Fixed version (ground truth):
/** 
 * Strip the ".class" or ".java" suffix from a file name TODO: generalize for all suffixes
 * @param fileName the file name
 * @throws IllegalArgumentException if fileName is null
 */
public static String stripSuffix(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int suffixIndex=fileName.indexOf(CLASS_SUFFIX);
  suffixIndex=(suffixIndex > -1) ? suffixIndex : fileName.indexOf("String_Node_Str");
  if (suffixIndex > -1) {
    return fileName.substring(0,suffixIndex);
  }
 else {
    return fileName;
  }
}
Program: 38454
Project: 38454
Buggy source:
/** 
 * Does the file name represent a .jar file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException  if fileName is null
 */
public static boolean isJarFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int suffixIndex=fileName.indexOf(JAR_SUFFIX);
  if (suffixIndex > -1) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Does the file name represent a .jar file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException if fileName is null
 */
public static boolean isJarFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return fileName.endsWith(JAR_SUFFIX);
}
Program: 38455
Project: 38455
Buggy source:
/** 
 * Does the file name represent a .war file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException  if fileName is null
 */
public static boolean isWarFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int suffixIndex=fileName.indexOf(WAR_SUFFIX);
  if (suffixIndex > -1) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Does the file name represent a .war file?
 * @param fileName name of a file
 * @return boolean
 * @throws IllegalArgumentException if fileName is null
 */
public static boolean isWarFile(String fileName){
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return fileName.endsWith(WAR_SUFFIX);
}
Program: 38456
Project: 38456
Buggy source:
private DeclaredTypeOperator getPointerTypeOperator(TypeReference type){
  if (type.isPrimitiveType()) {
    return new DeclaredTypeOperator(PrimitiveType.getPrimitive(type));
  }
 else {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      return new DeclaredTypeOperator(BOTTOM);
    }
 else {
      return new DeclaredTypeOperator(new ConeType(klass));
    }
  }
}

Fixed version (ground truth):
private DeclaredTypeOperator getPointerTypeOperator(TypeReference type){
  if (type.isPrimitiveType()) {
    return new DeclaredTypeOperator(language.getPrimitive(type));
  }
 else {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      return new DeclaredTypeOperator(BOTTOM);
    }
 else {
      return new DeclaredTypeOperator(new ConeType(klass));
    }
  }
}
Program: 38457
Project: 38457
Buggy source:
@Override public void visitInvoke(SSAInvokeInstruction instruction){
  TypeReference type=instruction.getDeclaredResultType();
  if (type.isReferenceType()) {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      result=new DeclaredTypeOperator(BOTTOM);
    }
 else {
      result=new DeclaredTypeOperator(new ConeType(klass));
    }
  }
 else   if (doPrimitives && type.isPrimitiveType()) {
    result=new DeclaredTypeOperator(PrimitiveType.getPrimitive(type));
  }
 else {
    result=null;
  }
}

Fixed version (ground truth):
@Override public void visitInvoke(SSAInvokeInstruction instruction){
  TypeReference type=instruction.getDeclaredResultType();
  if (type.isReferenceType()) {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      result=new DeclaredTypeOperator(BOTTOM);
    }
 else {
      result=new DeclaredTypeOperator(new ConeType(klass));
    }
  }
 else   if (doPrimitives && type.isPrimitiveType()) {
    result=new DeclaredTypeOperator(language.getPrimitive(type));
  }
 else {
    result=null;
  }
}
Program: 38459
Project: 38459
Buggy source:
@Override public void visitGet(SSAGetInstruction instruction){
  TypeReference type=instruction.getDeclaredFieldType();
  if (doPrimitives && type.isPrimitiveType()) {
    result=new DeclaredTypeOperator(PrimitiveType.getPrimitive(type));
  }
 else {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      result=new DeclaredTypeOperator(BOTTOM);
    }
 else {
      result=new DeclaredTypeOperator(new ConeType(klass));
    }
  }
}

Fixed version (ground truth):
@Override public void visitGet(SSAGetInstruction instruction){
  TypeReference type=instruction.getDeclaredFieldType();
  if (doPrimitives && type.isPrimitiveType()) {
    result=new DeclaredTypeOperator(language.getPrimitive(type));
  }
 else {
    IClass klass=cha.lookupClass(type);
    if (klass == null) {
      result=new DeclaredTypeOperator(BOTTOM);
    }
 else {
      result=new DeclaredTypeOperator(new ConeType(klass));
    }
  }
}
Program: 38460
Project: 38460
Buggy source:
/** 
 * traverse the bundle description for an Eclipse project and populate the analysis scope accordingly
 */
private void resolvePluginClassPath(IProject p,boolean includeSource) throws CoreException, IOException {
  BundleDescription bd=findModel(p).getBundleDescription();
  for (int i=0; i < 3 && bd == null; i++) {
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e) {
    }
    bd=findModel(p).getBundleDescription();
  }
  if (bd == null) {
    throw new IllegalStateException("String_Node_Str" + p);
  }
  resolveBundleDescriptionClassPath(bd,Loader.APPLICATION,includeSource);
}

Fixed version (ground truth):
/** 
 * traverse the bundle description for an Eclipse project and populate the analysis scope accordingly
 */
private void resolvePluginClassPath(IProject p,boolean includeSource) throws CoreException, IOException {
  IPluginModelBase model=findModel(p);
  if (!model.isInSync() || model.isDisposed()) {
    model.load();
  }
  BundleDescription bd=model.getBundleDescription();
  for (int i=0; i < 3 && bd == null; i++) {
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e) {
    }
    bd=findModel(p).getBundleDescription();
  }
  if (bd == null) {
    throw new IllegalStateException("String_Node_Str" + p);
  }
  resolveBundleDescriptionClassPath(bd,Loader.APPLICATION,includeSource);
}
Program: 38462
Project: 38462
Buggy source:
public Collection<IMethod> getAllMethods() throws ClassHierarchyException {
  Collection<IMethod> result=new LinkedList<IMethod>();
  Iterator<IMethod> declaredMethods=getDeclaredMethods().iterator();
  while (declaredMethods.hasNext()) {
    result.add(declaredMethods.next());
  }
  IClass s=getSuperclass();
  while (s != null) {
    Iterator<IMethod> superDeclaredMethods=s.getDeclaredMethods().iterator();
    while (superDeclaredMethods.hasNext()) {
      result.add(superDeclaredMethods.next());
    }
    s=s.getSuperclass();
  }
  return result;
}

Fixed version (ground truth):
public Collection<IMethod> getAllMethods() throws ClassHierarchyException {
  Collection<IMethod> result=new LinkedList<IMethod>();
  Iterator<IMethod> declaredMethods=getDeclaredMethods().iterator();
  while (declaredMethods.hasNext()) {
    result.add(declaredMethods.next());
  }
  if (isInterface()) {
    for (    IClass i : getDirectInterfaces()) {
      result.addAll(i.getAllMethods());
    }
  }
  IClass s=getSuperclass();
  while (s != null) {
    Iterator<IMethod> superDeclaredMethods=s.getDeclaredMethods().iterator();
    while (superDeclaredMethods.hasNext()) {
      result.add(superDeclaredMethods.next());
    }
    s=s.getSuperclass();
  }
  return result;
}
Program: 38463
Project: 38463
Buggy source:
public void performVerboseAction(){
  System.err.println("String_Node_Str" + nEvaluated);
  System.err.println("String_Node_Str" + nCreated);
  System.err.println("String_Node_Str" + workList.size());
  if (MORE_VERBOSE) {
    AbstractStatement s=workList.takeStatement();
    System.err.println("String_Node_Str" + lineBreak(s.toString(),132));
    if (s instanceof VerboseAction) {
      ((VerboseAction)s).performVerboseAction();
    }
    workList.insertStatement(s);
  }
}

Fixed version (ground truth):
public void performVerboseAction(){
  System.err.println("String_Node_Str" + nEvaluated);
  System.err.println("String_Node_Str" + nCreated);
  System.err.println("String_Node_Str" + workList.size());
  if (MORE_VERBOSE) {
    if (!workList.isEmpty()) {
      AbstractStatement s=workList.takeStatement();
      System.err.println("String_Node_Str" + lineBreak(s.toString(),132));
      if (s instanceof VerboseAction) {
        ((VerboseAction)s).performVerboseAction();
      }
      workList.insertStatement(s);
    }
  }
}
Program: 38464
Project: 38464
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.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;
}

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 the value 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: 38465
Project: 38465
Buggy source:
public static void main(String[] args) throws Exception, IllegalArgumentException {
  if (args.length < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String in=args[0];
  String out=args[1];
  String[] match=new String[args.length - 2];
  System.arraycopy(args,2,match,0,match.length);
  JarFile inJar=new JarFile(in);
  JarOutputStream outJar=new JarOutputStream(new FileOutputStream(out));
  JarFile[] matches=new JarFile[match.length];
  for (int i=0; i < match.length; i++) {
    matches[i]=new JarFile(match[i]);
  }
  for (Enumeration<JarEntry> e=inJar.entries(); e.hasMoreElements(); ) {
    JarEntry entry=e.nextElement();
    if (matchEntry(matches,entry)) {
      outJar.putNextEntry(entry);
      byte[] data=new byte[(int)entry.getSize()];
      InputStream stream=inJar.getInputStream(entry);
      readFully(stream,data);
      outJar.write(data);
      outJar.flush();
    }
  }
  outJar.close();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception, IllegalArgumentException {
  if (args.length < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String in=args[0];
  String out=args[1];
  if (in == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (out == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String[] match=new String[args.length - 2];
  System.arraycopy(args,2,match,0,match.length);
  JarFile inJar=new JarFile(in);
  JarOutputStream outJar=new JarOutputStream(new FileOutputStream(out));
  JarFile[] matches=new JarFile[match.length];
  for (int i=0; i < match.length; i++) {
    matches[i]=new JarFile(match[i]);
  }
  for (Enumeration<JarEntry> e=inJar.entries(); e.hasMoreElements(); ) {
    JarEntry entry=e.nextElement();
    if (matchEntry(matches,entry)) {
      outJar.putNextEntry(entry);
      byte[] data=new byte[(int)entry.getSize()];
      InputStream stream=inJar.getInputStream(entry);
      readFully(stream,data);
      outJar.write(data);
      outJar.flush();
    }
  }
  outJar.close();
}
Program: 38466
Project: 38466
Buggy source:
@Override final public int hashCode(){
  return getType().hashCode() + 14411 * getValue().hashCode();
}

Fixed version (ground truth):
@Override final public int hashCode(){
  int v=getValue() == null ? 0 : getValue().hashCode();
  return getType().hashCode() + 14411 * v;
}
Program: 38467
Project: 38467
Buggy source:
/** 
 * @return the constant value pushed: an Integer, a Long, a Float, a Double, aString, or null
 */
public abstract Object getValue();

Fixed version (ground truth):
/** 
 * @return the constant value pushed: an Integer, a Long, a Float, a Double, a String, or null
 */
public abstract Object getValue();
Program: 38468
Project: 38468
Buggy source:
@Override final public boolean equals(Object o){
  if (o instanceof ConstantInstruction) {
    ConstantInstruction i=(ConstantInstruction)o;
    return i.getType().equals(getType()) && i.getValue().equals(getValue());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override final public boolean equals(Object o){
  if (o instanceof ConstantInstruction) {
    ConstantInstruction i=(ConstantInstruction)o;
    if (!i.getType().equals(getType())) {
      return false;
    }
    if (i.getValue() == null) {
      if (getValue() == null) {
        return true;
      }
 else {
        return false;
      }
    }
 else {
      if (getValue() == null) {
        return false;
      }
 else {
        return i.getValue().equals(getValue());
      }
    }
  }
 else {
    return false;
  }
}
Program: 38469
Project: 38469
Buggy source:
protected InstanceofInstruction(String type){
  super(OP_instanceof);
  this.type=type;
}

Fixed version (ground truth):
protected InstanceofInstruction(String type){
  super(OP_instanceof);
  this.type=type;
  if (type == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 38470
Project: 38470
Buggy source:
/** 
 * Build an editor for specific method data. After patching the code you can retrieve the new code, handlers and instructions-to-bytecode-offsets map.
 */
public MethodEditor(Instruction[] instructions,ExceptionHandler[][] handlers,int[] instructionsToBytecodes){
  methodInfo=null;
  this.instructionsToBytecodes=instructionsToBytecodes;
  this.instructions=instructions;
  this.handlers=handlers;
}

Fixed version (ground truth):
/** 
 * Build an editor for specific method data. After patching the code you can retrieve the new code, handlers and instructions-to-bytecode-offsets map.
 */
public MethodEditor(Instruction[] instructions,ExceptionHandler[][] handlers,int[] instructionsToBytecodes){
  if (instructions == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  methodInfo=null;
  this.instructionsToBytecodes=instructionsToBytecodes;
  this.instructions=instructions;
  this.handlers=handlers;
}
Program: 38471
Project: 38471
Buggy source:
/** 
 * Compute the promoted type that the JVM uses to manipulate values of type "t" on its working stack.
 * @throws IllegalArgumentException  if t is null
 */
public static String getStackType(String t){
  if (t == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (t.charAt(0)) {
case 'Z':
case 'C':
case 'B':
case 'S':
    return "String_Node_Str";
default :
  return t;
}
}

Fixed version (ground truth):
/** 
 * Compute the promoted type that the JVM uses to manipulate values of type "t" on its working stack.
 * @throws IllegalArgumentException  if t is null
 */
public static String getStackType(String t){
  if (t == null || t.length() < 1) {
    throw new IllegalArgumentException("String_Node_Str" + t);
  }
switch (t.charAt(0)) {
case 'Z':
case 'C':
case 'B':
case 'S':
    return "String_Node_Str";
default :
  return t;
}
}