nus-yam/ex-repair huggingface dataset:
Program: 40100
Project: 40100
Buggy source:
public void terminate(){
  getM_pOwner().getSteering().SeekOff();
  getM_pOwner().getSteering().ArriveOff();
  getM_pOwner().SetMaxSpeed(script.GetDouble("String_Node_Str"));
}

Fixed version (ground truth):
public void terminate(){
  getM_pOwner().getSteering().SeekOff();
  getM_pOwner().getSteering().ArriveOff();
  getM_pOwner().setMaxSpeed(RavenScript.getDouble("String_Node_Str"));
}
Program: 40101
Project: 40101
Buggy source:
public void SeekOff(){
  if (On(seek))   flags^=seek;
}

Fixed version (ground truth):
public void SeekOff(){
  if (On(BehaviorType.seek))   flags^=BehaviorType.seek.getValue();
}
Program: 40102
Project: 40102
Buggy source:
public void WanderOff(){
  if (On(wander))   flags^=wander;
}

Fixed version (ground truth):
public void WanderOff(){
  if (On(BehaviorType.wander))   flags^=BehaviorType.wander.getValue();
}
Program: 40103
Project: 40103
Buggy source:
public void ArriveOn(){
  flags|=arrive;
}

Fixed version (ground truth):
public void ArriveOn(){
  flags|=BehaviorType.arrive.getValue();
}
Program: 40104
Project: 40104
Buggy source:
public void WallAvoidanceOff(){
  if (On(BehaviorType.wallAvoidance))   flags^=wallAvoidance;
}

Fixed version (ground truth):
public void WallAvoidanceOff(){
  if (On(BehaviorType.wallAvoidance))   flags^=BehaviorType.wallAvoidance.getValue();
}
Program: 40105
Project: 40105
Buggy source:
private Vector2D CalculatePrioritized(){
}

Fixed version (ground truth):
private Vector2D CalculatePrioritized(){
  Vector2D force;
  if (On(BehaviorType.wallAvoidance)) {
    force=WallAvoidance(world.getMap().getWalls()).mul(weightWallAvoidance);
    if (!AccumulateForce(steeringForce,force))     return steeringForce;
  }
  if (On(BehaviorType.separation)) {
    force=Separation(world.getBots()).mul(weightSeparation);
    if (!AccumulateForce(steeringForce,force))     return steeringForce;
  }
  if (On(BehaviorType.seek)) {
    force=Seek(target).mul(weightSeek);
    if (!AccumulateForce(steeringForce,force))     return steeringForce;
  }
  if (On(BehaviorType.arrive)) {
    force=Arrive(target,deceleration).mul(weightArrive);
    if (!AccumulateForce(steeringForce,force))     return steeringForce;
  }
  if (On(BehaviorType.wander)) {
    force=Wander().mul(weightWander);
    if (!AccumulateForce(steeringForce,force))     return steeringForce;
  }
  return steeringForce;
}
Program: 40106
Project: 40106
Buggy source:
final Vector<Vector2D> GetFeelers(){
  return feelers;
}

Fixed version (ground truth):
public final Vector<Vector2D> GetFeelers(){
  return feelers;
}
Program: 40107
Project: 40107
Buggy source:
public void WanderOn(){
  flags|=wander;
}

Fixed version (ground truth):
public void WanderOn(){
  flags|=BehaviorType.wander.getValue();
}
Program: 40108
Project: 40108
Buggy source:
public void SeparationOff(){
  if (On(separation))   flags^=separation;
}

Fixed version (ground truth):
public void SeparationOff(){
  if (On(BehaviorType.separation))   flags^=BehaviorType.separation.getValue();
}
Program: 40109
Project: 40109
Buggy source:
public void SeekOn(){
  flags|=seek;
}

Fixed version (ground truth):
public void SeekOn(){
  flags|=BehaviorType.seek.getValue();
}
Program: 40110
Project: 40110
Buggy source:
public void SeparationOn(){
  flags|=separation;
}

Fixed version (ground truth):
public void SeparationOn(){
  flags|=BehaviorType.separation.getValue();
}
Program: 40111
Project: 40111
Buggy source:
private boolean On(BehaviorType bt){
  return (flags & bt) == bt;
}

Fixed version (ground truth):
private boolean On(BehaviorType bt){
  return (flags & bt.getValue()) == bt.getValue();
}
Program: 40112
Project: 40112
Buggy source:
public void ArriveOff(){
  if (On(arrive))   flags^=arrive;
}

Fixed version (ground truth):
public void ArriveOff(){
  if (On(BehaviorType.arrive))   flags^=BehaviorType.arrive.getValue();
}
Program: 40113
Project: 40113
Buggy source:
public GetWeaponGoal_Evaluator(Double inp,Wep weptype){
}

Fixed version (ground truth):
public GetWeaponGoal_Evaluator(Double inp,RavenObject weptype) throws Exception {
switch (weptype) {
case BLASTER:
    this.weptype=RavenObject.BLASTER;
  break;
case SHOTGUN:
this.weptype=RavenObject.SHOTGUN;
break;
case ROCKET_LAUNCHER:
this.weptype=RavenObject.ROCKET_LAUNCHER;
break;
case RAIL_GUN:
this.weptype=RavenObject.RAIL_GUN;
break;
default :
throw new Exception();
}
this.m_iBias=inp;
}
Program: 40114
Project: 40114
Buggy source:
public GoalThink(RavenBot ravenBot){
  Random randomGenerator=new Random();
  HealthBias=randomGenerator.nextDouble();
  ShotgunBias=randomGenerator.nextDouble();
  RocketLauncherBias=randomGenerator.nextDouble();
  RailgunBias=randomGenerator.nextDouble();
  ExploreBias=randomGenerator.nextDouble();
  AttackBias=randomGenerator.nextDouble();
  m_Evaluators.add(new GetHealthGoal_Evaluator(HealthBias));
  m_Evaluators.add(new ExploreGoal_Evaluator(ExploreBias));
  m_Evaluators.add(new AttackTargetGoal_Evaluator(AttackBias));
  m_Evaluators.add(new GetWeaponGoal_Evaluator(ShotgunBias,GetWeaponGoal_Evaluator.Wep.SHOTGUN));
  m_Evaluators.add(new GetWeaponGoal_Evaluator(RailgunBias,GetWeaponGoal_Evaluator.Wep.RAILGUN));
  m_Evaluators.add(new GetWeaponGoal_Evaluator(RocketLauncherBias,GetWeaponGoal_Evaluator.Wep.ROCKETLAUNCHER));
}

Fixed version (ground truth):
public GoalThink(RavenBot ravenBot){
  Random randomGenerator=new Random();
  HealthBias=randomGenerator.nextDouble();
  ShotgunBias=randomGenerator.nextDouble();
  RocketLauncherBias=randomGenerator.nextDouble();
  RailgunBias=randomGenerator.nextDouble();
  ExploreBias=randomGenerator.nextDouble();
  AttackBias=randomGenerator.nextDouble();
  m_Evaluators.add(new GetHealthGoal_Evaluator(HealthBias));
  m_Evaluators.add(new ExploreGoal_Evaluator(ExploreBias));
  m_Evaluators.add(new AttackTargetGoal_Evaluator(AttackBias));
  try {
    m_Evaluators.add(new GetWeaponGoal_Evaluator(ShotgunBias,RavenObject.SHOTGUN));
    m_Evaluators.add(new GetWeaponGoal_Evaluator(RailgunBias,RavenObject.RAIL_GUN));
    m_Evaluators.add(new GetWeaponGoal_Evaluator(RocketLauncherBias,RavenObject.ROCKET_LAUNCHER));
  }
 catch (  Exception ex) {
    System.out.println(ex.getMessage());
  }
}
Program: 40116
Project: 40116
Buggy source:
@Override public void onEnable(){
  setupPermissions();
  File backupDir=new File("String_Node_Str".concat(FILE_SEPARATOR).concat("String_Node_Str"));
  if (!backupDir.exists())   backupDir.mkdirs();
  backupDir=new File("String_Node_Str");
  if (!backupDir.exists())   backupDir.mkdirs();
  backupDir=new File("String_Node_Str".concat(FILE_SEPARATOR).concat("String_Node_Str"));
  if (!backupDir.exists())   backupDir.mkdirs();
  PropertiesSystem pSystem=new PropertiesSystem(this);
  Server server=getServer();
  PluginManager pm=server.getPluginManager();
  run=new PrepareBackupTask(server,pSystem);
  pm.registerEvent(Type.PLAYER_COMMAND_PREPROCESS,new CommandListener(run,pSystem,this),Priority.Normal,this);
  if (pSystem.getBooleanProperty(BOOL_BACKUP_ONLY_PLAYER)) {
    LoginListener ll=new LoginListener(this,pSystem);
    pm.registerEvent(Type.PLAYER_LOGIN,ll,Priority.Normal,this);
    pm.registerEvent(Type.PLAYER_QUIT,ll,Priority.Normal,this);
  }
  int intervall=pSystem.getIntProperty(INT_BACKUP_INTERVALL);
  server.getScheduler().scheduleSyncRepeatingTask(this,run,intervall,intervall);
  System.out.println(this.getDescription().getFullName() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEnable(){
  setupPermissions();
  File backupDir=new File("String_Node_Str".concat(FILE_SEPARATOR).concat("String_Node_Str"));
  if (!backupDir.exists())   backupDir.mkdirs();
  backupDir=new File("String_Node_Str");
  if (!backupDir.exists())   backupDir.mkdirs();
  backupDir=new File("String_Node_Str".concat(FILE_SEPARATOR).concat("String_Node_Str"));
  if (!backupDir.exists())   backupDir.mkdirs();
  PropertiesSystem pSystem=new PropertiesSystem(this);
  Server server=getServer();
  PluginManager pm=server.getPluginManager();
  run=new PrepareBackupTask(server,pSystem);
  pm.registerEvent(Type.PLAYER_COMMAND_PREPROCESS,new CommandListener(run,pSystem,this),Priority.Normal,this);
  if (pSystem.getBooleanProperty(BOOL_BACKUP_ONLY_PLAYER)) {
    LoginListener ll=new LoginListener(this,pSystem);
    pm.registerEvent(Type.PLAYER_LOGIN,ll,Priority.Normal,this);
    pm.registerEvent(Type.PLAYER_QUIT,ll,Priority.Normal,this);
  }
  int intervall=pSystem.getIntProperty(INT_BACKUP_INTERVALL);
  if (intervall != -1)   server.getScheduler().scheduleSyncRepeatingTask(this,run,intervall,intervall);
 else   System.out.println("String_Node_Str");
  System.out.println(this.getDescription().getFullName() + "String_Node_Str");
}
Program: 40117
Project: 40117
Buggy source:
/** 
 * Check whethere there are more backups as allowed to store. When this case is true, it deletes oldest ones
 */
private void deleteOldBackups(){
  try {
    File backupDir=new File(pSystem.getStringProperty(STRING_BACKUP_FOLDER));
    File[] tempArray=backupDir.listFiles();
    final int maxBackups=pSystem.getIntProperty(INT_MAX_BACKUPS);
    if (tempArray.length > maxBackups) {
      System.out.println("String_Node_Str");
      ArrayList<File> backups=new ArrayList<File>(tempArray.length);
      backups.addAll(Arrays.asList(tempArray));
      int maxModifiedIndex;
      long maxModified;
      for (int i=0; i < maxBackups; ++i) {
        maxModifiedIndex=0;
        maxModified=backups.get(0).lastModified();
        for (int j=1; j < backups.size(); ++j) {
          File currentFile=backups.get(j);
          if (currentFile.lastModified() > maxModified) {
            maxModified=currentFile.lastModified();
            maxModifiedIndex=j;
          }
        }
        backups.remove(maxModifiedIndex);
      }
      System.out.println("String_Node_Str");
      System.out.println(Arrays.toString(backups.toArray()));
      for (      File backupToDelete : backups)       backupToDelete.delete();
    }
  }
 catch (  Exception e) {
    e.printStackTrace(System.out);
  }
}

Fixed version (ground truth):
/** 
 * Check whethere there are more backups as allowed to store. When this case is true, it deletes oldest ones
 */
private void deleteOldBackups(){
  try {
    File backupDir=new File(pSystem.getStringProperty(STRING_BACKUP_FOLDER));
    File[] tempArray=backupDir.listFiles();
    File[] array=new File[tempArray.length - 1];
    for (int i=0, j=0; i < tempArray.length; ++i) {
      File file=tempArray[i];
      if (file.isDirectory() && file.getName().equals("String_Node_Str"))       continue;
      array[j++]=tempArray[i];
    }
    tempArray=array;
    final int maxBackups=pSystem.getIntProperty(INT_MAX_BACKUPS);
    if (tempArray.length > maxBackups) {
      System.out.println("String_Node_Str");
      ArrayList<File> backups=new ArrayList<File>(tempArray.length);
      backups.addAll(Arrays.asList(tempArray));
      int maxModifiedIndex;
      long maxModified;
      for (int i=0; i < maxBackups; ++i) {
        maxModifiedIndex=0;
        maxModified=backups.get(0).lastModified();
        for (int j=1; j < backups.size(); ++j) {
          File currentFile=backups.get(j);
          if (currentFile.lastModified() > maxModified) {
            maxModified=currentFile.lastModified();
            maxModifiedIndex=j;
          }
        }
        backups.remove(maxModifiedIndex);
      }
      System.out.println("String_Node_Str");
      System.out.println(Arrays.toString(backups.toArray()));
      for (      File backupToDelete : backups)       backupToDelete.delete();
    }
  }
 catch (  Exception e) {
    e.printStackTrace(System.out);
  }
}
Program: 40118
Project: 40118
Buggy source:
@Override public void performVerboseAction(){
  super.performVerboseAction();
  if (DEBUG_MEMORY) {
    DEBUG_MEM_COUNTER++;
    if (DEBUG_MEM_COUNTER % DEBUG_MEM_INTERVAL == 0) {
      DEBUG_MEM_COUNTER=0;
      ReferenceCleanser.clearSoftCaches();
      System.err.println(flowGraph.spaceReport());
      System.err.println("String_Node_Str");
      HeapTracer.traceHeap(Collections.singleton(this),true);
      System.err.println("String_Node_Str");
    }
  }
  if (getFixedPointSystem() instanceof VerboseAction) {
    ((VerboseAction)getFixedPointSystem()).performVerboseAction();
  }
  AbstractStatement s=workList.takeStatement();
  System.err.println(printRHSInstances(s));
  workList.insertStatement(s);
  System.err.println("String_Node_Str" + cg.getNumberOfNodes());
}

Fixed version (ground truth):
@Override public void performVerboseAction(){
  super.performVerboseAction();
  if (DEBUG_MEMORY) {
    DEBUG_MEM_COUNTER++;
    if (DEBUG_MEM_COUNTER % DEBUG_MEM_INTERVAL == 0) {
      DEBUG_MEM_COUNTER=0;
      ReferenceCleanser.clearSoftCaches();
      System.err.println(flowGraph.spaceReport());
      System.err.println("String_Node_Str");
      HeapTracer.traceHeap(Collections.singleton(this),true);
      System.err.println("String_Node_Str");
    }
  }
  if (getFixedPointSystem() instanceof VerboseAction) {
    ((VerboseAction)getFixedPointSystem()).performVerboseAction();
  }
  if (!workList.isEmpty()) {
    AbstractStatement s=workList.takeStatement();
    System.err.println(printRHSInstances(s));
    workList.insertStatement(s);
    System.err.println("String_Node_Str" + cg.getNumberOfNodes());
  }
}
Program: 40119
Project: 40119
Buggy source:
public CAstNode translateDoLoop(CAstNode loopTest,CAstNode loopBody,CAstNode continueNode,CAstNode breakNode,WalkContext<?,?> wc){
  if (replicateForDoLoops) {
    loopBody=Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode);
    CAstRewriter.Rewrite x=(new CAstCloner(Ast,false)).copy(loopBody,wc.cfg(),wc.pos(),wc.getNodeTypeMap(),null);
    CAstNode otherBody=x.newRoot();
    wc.cfg().addAll(x.newCfg());
    wc.pos().addAll(x.newPos());
    wc.getNodeTypeMap().addAll(x.newTypes());
    return Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,Ast.makeNode(CAstNode.LOOP,loopTest,otherBody),breakNode);
  }
 else {
    CAstNode header=Ast.makeNode(CAstNode.EMPTY);
    CAstNode loopGoto=Ast.makeNode(CAstNode.IFGOTO,loopTest);
    wc.cfg().map(header,header);
    wc.cfg().map(loopGoto,loopGoto);
    wc.cfg().add(loopGoto,header,Boolean.TRUE);
    return Ast.makeNode(CAstNode.BLOCK_STMT,header,Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode),loopGoto,breakNode);
  }
}

Fixed version (ground truth):
public CAstNode translateDoLoop(CAstNode loopTest,CAstNode loopBody,CAstNode continueNode,CAstNode breakNode,WalkContext<?,?> wc){
  if (replicateForDoLoops) {
    loopBody=Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode);
    CAstRewriter.Rewrite x=(new CAstCloner(Ast,false)).copy(loopBody,wc.cfg(),wc.pos(),wc.getNodeTypeMap(),null);
    CAstNode otherBody=x.newRoot();
    wc.cfg().addAll(x.newCfg());
    wc.pos().addAll(x.newPos());
    wc.getNodeTypeMap().addAll(x.newTypes());
    return Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,Ast.makeNode(CAstNode.LOOP,loopTest,otherBody),breakNode);
  }
 else {
    CAstNode header=Ast.makeNode(CAstNode.LABEL_STMT,Ast.makeConstant("String_Node_Str"),Ast.makeNode(CAstNode.EMPTY));
    CAstNode loopGoto=Ast.makeNode(CAstNode.IFGOTO,loopTest);
    wc.cfg().map(header,header);
    wc.cfg().map(loopGoto,loopGoto);
    wc.cfg().add(loopGoto,header,Boolean.TRUE);
    return Ast.makeNode(CAstNode.BLOCK_STMT,header,Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode),loopGoto,breakNode);
  }
}
Program: 40122
Project: 40122
Buggy source:
@Override public SSAAbstractInvokeInstruction addDirectCall(int function,int[] params,CallSiteReference site){
  CallSiteReference newSite=new JSCallSiteReference(statements.size());
  JavaScriptInvoke s=new JavaScriptInvoke(function,nextLocal++,params,nextLocal++,newSite);
  statements.add(s);
  return s;
}

Fixed version (ground truth):
@Override public SSAAbstractInvokeInstruction addDirectCall(int function,int[] params,CallSiteReference site){
  CallSiteReference newSite=new JSCallSiteReference(statements.size());
  JavaScriptInvoke s=new JavaScriptInvoke(statements.size(),function,nextLocal++,params,nextLocal++,newSite);
  statements.add(s);
  return s;
}
Program: 40123
Project: 40123
Buggy source:
private int passActualPropertyValsAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    final int constVN=curValNum++;
    S.addConstant(constVN,new ConstantValue(i - 1));
    int propertyReadResult=curValNum++;
    S.addStatement(insts.PropertyRead(S.getNextProgramCounter(),propertyReadResult,4,constVN));
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}

Fixed version (ground truth):
private int passActualPropertyValsAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    final int constVN=curValNum++;
    S.addConstant(constVN,new ConstantValue(i - 1));
    int propertyReadResult=curValNum++;
    S.addStatement(insts.PropertyRead(S.getNumberOfStatements(),propertyReadResult,4,constVN));
    S.getNextProgramCounter();
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}
Program: 40124
Project: 40124
Buggy source:
private IR makeIRForArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int numParamsToPass=10;
  int[] paramsToPassToInvoked=new int[numParamsToPass + 1];
  paramsToPassToInvoked[0]=3;
  int curValNum=passActualPropertyValsAsParams(insts,nargs,S,paramsToPassToInvoked);
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int resultVal=curValNum++;
  int excVal=curValNum++;
  S.addStatement(insts.Invoke(S.getNextProgramCounter(),2,resultVal,paramsToPassToInvoked,excVal,cs));
  S.addStatement(insts.ReturnInstruction(S.getNextProgramCounter(),resultVal,false));
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}

Fixed version (ground truth):
private IR makeIRForArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int numParamsToPass=10;
  int[] paramsToPassToInvoked=new int[numParamsToPass + 1];
  paramsToPassToInvoked[0]=3;
  int curValNum=passActualPropertyValsAsParams(insts,nargs,S,paramsToPassToInvoked);
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int resultVal=curValNum++;
  int excVal=curValNum++;
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),2,resultVal,paramsToPassToInvoked,excVal,cs));
  S.getNextProgramCounter();
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),resultVal,false));
  S.getNextProgramCounter();
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}
Program: 40125
Project: 40125
Buggy source:
private IR makeIRForNoArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int resultVal=nargs + 2;
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int[] params=new int[1];
  params[0]=3;
  S.addStatement(insts.Invoke(S.getNextProgramCounter(),2,resultVal,params,resultVal + 1,cs));
  S.addStatement(insts.ReturnInstruction(S.getNextProgramCounter(),resultVal,false));
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}

Fixed version (ground truth):
private IR makeIRForNoArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int resultVal=nargs + 2;
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int[] params=new int[1];
  params[0]=3;
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),2,resultVal,params,resultVal + 1,cs));
  S.getNextProgramCounter();
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),resultVal,false));
  S.getNextProgramCounter();
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}
Program: 40126
Project: 40126
Buggy source:
@SuppressWarnings("String_Node_Str") private int passArbitraryPropertyValAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  int eachElementGetResult=curValNum++;
  S.addStatement(insts.EachElementGetInstruction(S.getNextProgramCounter(),eachElementGetResult,4));
  int propertyReadResult=curValNum++;
  S.addStatement(insts.PropertyRead(S.getNextProgramCounter(),propertyReadResult,4,eachElementGetResult));
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private int passArbitraryPropertyValAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  int eachElementGetResult=curValNum++;
  S.addStatement(insts.EachElementGetInstruction(S.getNumberOfStatements(),eachElementGetResult,4));
  S.getNextProgramCounter();
  int propertyReadResult=curValNum++;
  S.addStatement(insts.PropertyRead(S.getNumberOfStatements(),propertyReadResult,4,eachElementGetResult));
  S.getNextProgramCounter();
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}
Program: 40128
Project: 40128
Buggy source:
private IMethod makeUnaryNumberCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.Number));
}

Fixed version (ground truth):
private IMethod makeUnaryNumberCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.Number));
}
Program: 40129
Project: 40129
Buggy source:
private IMethod makeUnaryStringCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.String));
}

Fixed version (ground truth):
private IMethod makeUnaryStringCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.String));
}
Program: 40132
Project: 40132
Buggy source:
@Override public int getLastCol(){
  return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
}

Fixed version (ground truth):
@Override public int getLastCol(){
  return -1;
}
Program: 40133
Project: 40133
Buggy source:
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
    }
    @Override public int getLastCol(){
      return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public InputStream getInputStream() throws IOException {
      return new FileInputStream(sourceFile);
    }
  }
;
}

Fixed version (ground truth):
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return -1;
    }
    @Override public int getLastCol(){
      return -1;
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public Reader getReader() throws IOException {
      return new FileReader(sourceFile);
    }
  }
;
}
Program: 40134
Project: 40134
Buggy source:
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString();
  return Pair.make(lineNum,body);
}

Fixed version (ground truth):
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString().replace(content.getSource().getNewLine(),"String_Node_Str");
  return Pair.make(lineNum,body);
}
Program: 40135
Project: 40135
Buggy source:
@Override public int getFirstCol(){
  return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
}

Fixed version (ground truth):
@Override public int getFirstCol(){
  return -1;
}
Program: 40136
Project: 40136
Buggy source:
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(pf));
  }
}

Fixed version (ground truth):
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    String prop=pf.endsWith("String_Node_Str") ? pf.substring(0,pf.length() - 6) : pf;
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(prop));
  }
}
Program: 40141
Project: 40141
Buggy source:
@Override public int getLastCol(){
  return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
}

Fixed version (ground truth):
@Override public int getLastCol(){
  return -1;
}
Program: 40142
Project: 40142
Buggy source:
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
    }
    @Override public int getLastCol(){
      return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public InputStream getInputStream() throws IOException {
      return new FileInputStream(sourceFile);
    }
  }
;
}

Fixed version (ground truth):
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return -1;
    }
    @Override public int getLastCol(){
      return -1;
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public Reader getReader() throws IOException {
      return new FileReader(sourceFile);
    }
  }
;
}
Program: 40143
Project: 40143
Buggy source:
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString();
  return Pair.make(lineNum,body);
}

Fixed version (ground truth):
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString().replace(content.getSource().getNewLine(),"String_Node_Str");
  return Pair.make(lineNum,body);
}
Program: 40144
Project: 40144
Buggy source:
@Override public int getFirstCol(){
  return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
}

Fixed version (ground truth):
@Override public int getFirstCol(){
  return -1;
}
Program: 40145
Project: 40145
Buggy source:
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(pf));
  }
}

Fixed version (ground truth):
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    String prop=pf.endsWith("String_Node_Str") ? pf.substring(0,pf.length() - 6) : pf;
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(prop));
  }
}
Program: 40146
Project: 40146
Buggy source:
public final Set<TypeReference> getUnresolvedClasses(){
  return unresolved;
}

Fixed version (ground truth):
@Override public final Set<TypeReference> getUnresolvedClasses(){
  return unresolved;
}
Program: 40147
Project: 40147
Buggy source:
/** 
 * Find a class in this class hierarchy.
 * @return the {@link IClass} for a if found; null if can't find the class.
 * @throws IllegalArgumentException if A is null
 */
@Override public IClass lookupClass(TypeReference a){
  if (a == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ClassLoaderReference loader=a.getClassLoader();
  ClassLoaderReference parent=loader.getParent();
  if (parent != null) {
    TypeReference p=TypeReference.findOrCreate(parent,a.getName());
    IClass c=lookupClass(p);
    if (c != null) {
      return c;
    }
  }
  if (a.isArrayType()) {
    TypeReference elt=a.getInnermostElementType();
    if (elt.isPrimitiveType()) {
      return getRootClass().getClassLoader().lookupClass(a.getName());
    }
 else {
      IClass c=lookupClass(elt);
      if (c == null) {
        unresolved.add(elt);
        return null;
      }
 else {
        return c.getClassLoader().lookupClass(a.getName());
      }
    }
  }
 else {
    Node n=map.get(a);
    if (n != null) {
      return n.klass;
    }
 else {
      unresolved.add(a);
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Find a class in this class hierarchy.
 * @return the {@link IClass} for a if found; null if can't find the class.
 * @throws IllegalArgumentException if A is null
 */
@Override public IClass lookupClass(TypeReference a){
  if (a == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final IClass cls=lookupClassRecursive(a);
  if (cls == null) {
    unresolved.add(a);
  }
  return cls;
}
Program: 40149
Project: 40149
Buggy source:
/** 
 * set up the methodMap mapping
 */
protected void computeMethodMapIfNeeded() throws InvalidClassFileException {
  if (methodMap == null) {
synchronized (this) {
      if (methodMap == null) {
        IMethod[] methods=computeDeclaredMethods();
        if (methods.length > 5) {
          methodMap=HashMapFactory.make(methods.length);
        }
 else {
          methodMap=new SmallMap<Selector,IMethod>();
        }
        for (int i=0; i < methods.length; i++) {
          IMethod m=methods[i];
          methodMap.put(m.getReference().getSelector(),m);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * set up the methodMap mapping
 */
protected void computeMethodMapIfNeeded() throws InvalidClassFileException {
  if (methodMap == null) {
synchronized (this) {
      if (methodMap == null) {
        IMethod[] methods=computeDeclaredMethods();
        final Map<Selector,IMethod> tmpMethodMap;
        if (methods.length > 5) {
          tmpMethodMap=HashMapFactory.make(methods.length);
        }
 else {
          tmpMethodMap=new SmallMap<Selector,IMethod>();
        }
        for (int i=0; i < methods.length; i++) {
          IMethod m=methods[i];
          tmpMethodMap.put(m.getReference().getSelector(),m);
        }
        methodMap=tmpMethodMap;
      }
    }
  }
}
Program: 40150
Project: 40150
Buggy source:
public void unary1(){
}

Fixed version (ground truth):
@Override public void unary1(){
}
Program: 40151
Project: 40151
Buggy source:
public void unary2(){
  unary1();
}

Fixed version (ground truth):
@Override public void unary2(){
  unary1();
}
Program: 40152
Project: 40152
Buggy source:
public void binary(Whatever arg){
  this.unary1();
  arg.unary2();
}

Fixed version (ground truth):
@Override public void binary(Whatever arg){
  this.unary1();
  arg.unary2();
}
Program: 40153
Project: 40153
Buggy source:
public static void main(String[] args){
  Whatever x=new This();
  Whatever y=new That();
  Whatever z=choice() ? x : y;
  if (z instanceof This)   x.binary(z);
 else   y.binary(z);
}

Fixed version (ground truth):
public static void main(String[] args){
  Whatever x=new This();
  Whatever y=new That();
  Whatever z=choice() ? x : y;
  if (z instanceof This)   x.binary(z);
 else   y.binary(z);
  localCast();
}
Program: 40154
Project: 40154
Buggy source:
private void checkCallAssertions(CallGraph cg,int desiredNumberOfTargets,int desiredNumberOfCalls){
}

Fixed version (ground truth):
private void checkCallAssertions(CallGraph cg,int desiredNumberOfTargets,int desiredNumberOfCalls,int numLocalCastCallees){
}
Program: 40155
Project: 40155
Buggy source:
@Test public void testNoPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(false),2,2);
}

Fixed version (ground truth):
@Test public void testNoPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(false),2,2,2);
}
Program: 40156
Project: 40156
Buggy source:
@Test public void testPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(true),1,2);
}

Fixed version (ground truth):
@Test public void testPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(true),1,2,1);
}
Program: 40157
Project: 40157
Buggy source:
public void defineFunction(CAstEntity n,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] catchTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  ((JavaClass)owner).addMethod(n,owner,cfg,symtab,hasCatchBlock,catchTypes,hasMonitorOp,lexicalInfo,debugInfo);
}

Fixed version (ground truth):
public void defineFunction(CAstEntity n,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  ((JavaClass)owner).addMethod(n,owner,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}
Program: 40158
Project: 40158
Buggy source:
public ConcreteJavaMethod(CAstEntity methodEntity,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] catchTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(methodEntity,owner,cfg,symtab,hasCatchBlock,catchTypes,hasMonitorOp,lexicalInfo,debugInfo);
}

Fixed version (ground truth):
public ConcreteJavaMethod(CAstEntity methodEntity,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(methodEntity,owner,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}
Program: 40159
Project: 40159
Buggy source:
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}

Fixed version (ground truth):
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}
Program: 40160
Project: 40160
Buggy source:
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (N == codeBodyEntity) {
    specializedCode=myloader.makeCodeBodyCode(cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo,method.getDeclaringClass());
  }
 else {
    super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
  }
}

Fixed version (ground truth):
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (N == codeBodyEntity) {
    specializedCode=myloader.makeCodeBodyCode(cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo,method.getDeclaringClass());
  }
 else {
    super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
  }
}
Program: 40162
Project: 40162
Buggy source:
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  String fnName="String_Node_Str" + composeEntityName(definingContext,N);
  names.add(fnName);
  super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}

Fixed version (ground truth):
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  String fnName="String_Node_Str" + composeEntityName(definingContext,N);
  names.add(fnName);
  super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}
Program: 40164
Project: 40164
Buggy source:
public JavaScriptMethodObject makeCodeBodyCode(AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo,IClass C){
  return new JavaScriptMethodObject(C,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}

Fixed version (ground truth):
public JavaScriptMethodObject makeCodeBodyCode(AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo,IClass C){
  return new JavaScriptMethodObject(C,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}
Program: 40165
Project: 40165
Buggy source:
public IMethod defineCodeBodyCode(String clsName,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}

Fixed version (ground truth):
public IMethod defineCodeBodyCode(String clsName,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}
Program: 40166
Project: 40166
Buggy source:
JavaScriptMethodObject(IClass cls,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(cls,functionQualifiers,cfg,symtab,AstMethodReference.fnReference(cls.getReference()),hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo,null);
  symtab.getNullConstant();
}

Fixed version (ground truth):
JavaScriptMethodObject(IClass cls,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(cls,functionQualifiers,cfg,symtab,AstMethodReference.fnReference(cls.getReference()),hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo,null);
  symtab.getNullConstant();
}
Program: 40167
Project: 40167
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);
  ((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,Map<IBasicBlock,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);
  ((JavaScriptLoader)loader).defineCodeBodyCode("String_Node_Str" + fnName,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}
Program: 40168
Project: 40168
Buggy source:
private void setupCatchTypes(SSACFG cfg,TypeReference[][] catchTypes){
  for (int i=0; i < catchTypes.length; i++) {
    if (catchTypes[i] != null) {
      ExceptionHandlerBasicBlock bb=(ExceptionHandlerBasicBlock)cfg.getNode(i);
      for (int j=0; j < catchTypes[i].length; j++) {
        bb.addCaughtExceptionType(catchTypes[i][j]);
      }
    }
  }
}

Fixed version (ground truth):
private void setupCatchTypes(SSACFG cfg,Map<IBasicBlock,TypeReference[]> map){
  for (  Map.Entry<IBasicBlock,TypeReference[]> e : map.entrySet()) {
    if (e.getKey().getNumber() != -1) {
      ExceptionHandlerBasicBlock bb=(ExceptionHandlerBasicBlock)cfg.getNode(e.getKey().getNumber());
      for (int j=0; j < e.getValue().length; j++) {
        bb.addCaughtExceptionType(e.getValue()[j]);
      }
    }
  }
}
Program: 40170
Project: 40170
Buggy source:
/** 
 * fully define a function. invoked after all the code of the function has been processed
 */
protected abstract void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo);

Fixed version (ground truth):
/** 
 * fully define a function. invoked after all the code of the function has been processed
 */
protected abstract void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> catchTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo);
Program: 40171
Project: 40171
Buggy source:
public TypeReference[][] getCatchTypes(){
  return null;
}

Fixed version (ground truth):
public Map<IBasicBlock,TypeReference[]> getCatchTypes(){
  return null;
}