nus-yam/ex-repair huggingface dataset:
Program: 26528
Project: 26528
Buggy source:
public void setRotationAngles(float par1,float par2,float par3,float par4,float par5,float par6,Entity entity){
  if (entity instanceof EntityRobot) {
    EntityRobot robot=(EntityRobot)entity;
    head.rotateAngleY=par4 / (180F / (float)Math.PI);
    shoulderleft.rotateAngleY=head.rotateAngleY;
    shoulderright.rotateAngleY=head.rotateAngleY;
    longarm.rotateAngleY=head.rotateAngleY;
    melee.rotateAngleY=head.rotateAngleY;
    shortarm.rotateAngleY=head.rotateAngleY;
    float z=(float)(head.rotationPointZ + 10.0F * Math.sin(head.rotateAngleY));
    float x=(float)(head.rotationPointX - 10.0F * Math.cos(head.rotateAngleY));
    gun.rotationPointX=x;
    gun.rotationPointZ=z;
    gun.rotateAngleZ=head.rotateAngleZ;
    gun.rotateAngleX=0;
    gun.rotateAngleY=head.rotateAngleY;
    par2*=1.2;
    leg1.rotateAngleX=MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
    rotateLeg(par1,par2,leg1,legpart1,legpart2,foot1);
    leg2.rotateAngleX=MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
    rotateLeg(par1,par2,leg2,legpart3,legpart4,foot2);
  }
}

Fixed version (ground truth):
public void setRotationAngles(float par1,float par2,float par3,float par4,float par5,float par6,Entity entity){
  if (entity instanceof EntityRobot) {
    EntityRobot robot=(EntityRobot)entity;
    head.rotateAngleY=par4 / (180F / (float)Math.PI);
    shoulderleft.rotateAngleY=head.rotateAngleY;
    shoulderright.rotateAngleY=head.rotateAngleY;
    longarm.rotateAngleY=head.rotateAngleY;
    melee.rotateAngleY=head.rotateAngleY;
    shortarm.rotateAngleY=head.rotateAngleY;
    float z=(float)(head.rotationPointZ + 10.0F * Math.sin(head.rotateAngleY));
    float x=(float)(head.rotationPointX - 10.0F * Math.cos(head.rotateAngleY));
    gun.rotationPointX=x;
    gun.rotationPointZ=z;
    gun.rotateAngleX=0;
    gun.rotateAngleY=head.rotateAngleY;
    gun.rotateAngleZ=robot.getWeaponSpin();
    par2*=1.2;
    leg1.rotateAngleX=MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
    rotateLeg(par1,par2,leg1,legpart1,legpart2,foot1);
    leg2.rotateAngleX=MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
    rotateLeg(par1,par2,leg2,legpart3,legpart4,foot2);
  }
}
Program: 26529
Project: 26529
Buggy source:
public void onEntityUpdate(){
  super.onEntityUpdate();
  if (!worldObj.isRemote) {
    if (!this.isDead) {
      TileEntityRobot controller=getController();
      if (controller == null) {
        this.setDead();
      }
    }
  }
}

Fixed version (ground truth):
public void onEntityUpdate(){
  super.onEntityUpdate();
  if (!worldObj.isRemote) {
    if (!this.isDead) {
      TileEntityRobot controller=getController();
      if (controller == null) {
        this.setDead();
      }
    }
  }
 else {
    this.weaponSpin+=.1f;
  }
}
Program: 26530
Project: 26530
Buggy source:
@ForgeSubscribe public void onRenderGameOverlay(RenderGameOverlayEvent evt){
  for (  IDrawable drawable : drawableList) {
    drawable.draw(evt.partialTicks,evt.mouseX,evt.mouseY);
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onRenderGameOverlay(RenderGameOverlayEvent evt){
  if (evt.type == ElementType.HELMET && evt instanceof RenderGameOverlayEvent.Post) {
    for (    IDrawable drawable : drawableList) {
      drawable.draw(evt.partialTicks,evt.mouseX,evt.mouseY);
    }
  }
}
Program: 26531
Project: 26531
Buggy source:
public HashMap getAllIds(){
  try {
    lock.lock();
    try {
      HashMap all=new HashMap();
      int i=1;
      for (      Short id : drawables.keySet()) {
        all.put(i++,id);
      }
      return all;
    }
  finally {
      lock.unlock();
    }
  }
 catch (  Exception ex) {
  }
  return null;
}

Fixed version (ground truth):
public Short[] getAllIds(){
  try {
    lock.lock();
    try {
      return drawables.keySet().toArray(new Short[drawables.size()]);
    }
  finally {
      lock.unlock();
    }
  }
 catch (  Exception ex) {
  }
  return null;
}
Program: 26532
Project: 26532
Buggy source:
@Override public Object toLua(Object o){
  if (o instanceof Double || o instanceof Integer) {
    return o;
  }
  return null;
}

Fixed version (ground truth):
@Override public Object toLua(Object o){
  if (o instanceof Double || o instanceof Integer || o instanceof Short) {
    return o;
  }
  return null;
}
Program: 26533
Project: 26533
Buggy source:
@ForgeSubscribe public void onRenderGameOverlay(RenderGameOverlayEvent evt){
  for (  IDrawable drawable : drawableList) {
    drawable.draw(evt.partialTicks,evt.mouseX,evt.mouseY);
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onRenderGameOverlay(RenderGameOverlayEvent evt){
  if (evt.type == ElementType.HELMET && evt instanceof RenderGameOverlayEvent.Post) {
    for (    IDrawable drawable : drawableList) {
      drawable.draw(evt.partialTicks,evt.mouseX,evt.mouseY);
    }
  }
}
Program: 26534
Project: 26534
Buggy source:
public HashMap getAllIds(){
  try {
    lock.lock();
    try {
      HashMap all=new HashMap();
      int i=1;
      for (      Short id : drawables.keySet()) {
        all.put(i++,id);
      }
      return all;
    }
  finally {
      lock.unlock();
    }
  }
 catch (  Exception ex) {
  }
  return null;
}

Fixed version (ground truth):
public Short[] getAllIds(){
  try {
    lock.lock();
    try {
      return drawables.keySet().toArray(new Short[drawables.size()]);
    }
  finally {
      lock.unlock();
    }
  }
 catch (  Exception ex) {
  }
  return null;
}
Program: 26535
Project: 26535
Buggy source:
@Override public Object toLua(Object o){
  if (o instanceof Double || o instanceof Integer) {
    return o;
  }
  return null;
}

Fixed version (ground truth):
@Override public Object toLua(Object o){
  if (o instanceof Double || o instanceof Integer || o instanceof Short) {
    return o;
  }
  return null;
}
Program: 26537
Project: 26537
Buggy source:
private Object executeScript(TileEntity tile,Object[] args){
  String script=this.getScript();
  if (script != null) {
    try {
      this.engine.put("String_Node_Str",tile);
      this.engine.put("String_Node_Str",tile.xCoord);
      this.engine.put("String_Node_Str",tile.yCoord);
      this.engine.put("String_Node_Str",tile.zCoord);
      this.engine.put("String_Node_Str",args);
      this.engine.put("String_Node_Str",tile.worldObj);
      this.engine.put("String_Node_Str",this);
      return this.engine.eval(script);
    }
 catch (    ScriptException e) {
      e.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
private Object executeScript(TileEntity tile,Object[] args){
  String script=this.getScript();
  if (script != null) {
    script=new String(Base64.decode(script));
    try {
      this.engine.put("String_Node_Str",tile);
      this.engine.put("String_Node_Str",tile.xCoord);
      this.engine.put("String_Node_Str",tile.yCoord);
      this.engine.put("String_Node_Str",tile.zCoord);
      this.engine.put("String_Node_Str",args);
      this.engine.put("String_Node_Str",tile.worldObj);
      this.engine.put("String_Node_Str",this);
      return this.engine.eval(script);
    }
 catch (    ScriptException e) {
      e.printStackTrace();
    }
  }
  return null;
}
Program: 26538
Project: 26538
Buggy source:
@Override public void execute(TileEntity tile,DefinitionMethod luaMethod,Object[] values){
  Class c=tile.getClass();
  String script=luaMethod.getPostScript();
  if (script != null) {
    try {
      this.engine.put("String_Node_Str",tile);
      this.engine.put("String_Node_Str",tile.xCoord);
      this.engine.put("String_Node_Str",tile.yCoord);
      this.engine.put("String_Node_Str",tile.zCoord);
      this.engine.put("String_Node_Str",luaMethod);
      this.engine.put("String_Node_Str",values);
      this.engine.put("String_Node_Str",tile.worldObj);
      this.engine.put("String_Node_Str",this);
      this.engine.eval(script);
    }
 catch (    ScriptException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void execute(TileEntity tile,DefinitionMethod luaMethod,Object[] values){
  Class c=tile.getClass();
  String script=luaMethod.getPostScript();
  if (script != null) {
    script=new String(Base64.decode(script));
    try {
      this.engine.put("String_Node_Str",tile);
      this.engine.put("String_Node_Str",tile.xCoord);
      this.engine.put("String_Node_Str",tile.yCoord);
      this.engine.put("String_Node_Str",tile.zCoord);
      this.engine.put("String_Node_Str",luaMethod);
      this.engine.put("String_Node_Str",values);
      this.engine.put("String_Node_Str",tile.worldObj);
      this.engine.put("String_Node_Str",this);
      this.engine.eval(script);
    }
 catch (    ScriptException e) {
      e.printStackTrace();
    }
  }
}
Program: 26539
Project: 26539
Buggy source:
@Override public void onGroupSelected(Group group){
  CellListFragment listFragment=(CellListFragment)getSupportFragmentManager().findFragmentById(R.id.cellListFragment);
  if (listFragment == null) {
    Intent i=new Intent(getApplicationContext(),CellListActivity.class);
    i.putExtra(INTENT_SWITCH_GROUP,group);
    startActivity(i);
  }
 else {
    listFragment.setGroup(group);
  }
}

Fixed version (ground truth):
@Override public void onGroupSelected(Group group){
  CellListFragment listFragment=(CellListFragment)getSupportFragmentManager().findFragmentById(R.id.cellListFragment);
  if (listFragment == null || !listFragment.isInLayout()) {
    Intent i=new Intent(getApplicationContext(),CellListActivity.class);
    i.putExtra(INTENT_SWITCH_GROUP,group);
    startActivity(i);
  }
 else {
    listFragment.setGroup(group);
  }
}
Program: 26540
Project: 26540
Buggy source:
@Override public boolean onQueryTextChange(String query){
  adapter.setQueryCells(helper.getQueryCells(group,query),query);
  return true;
}

Fixed version (ground truth):
@Override public boolean onQueryTextChange(String query){
  if (adapter != null)   adapter.setQueryCells(helper.getQueryCells(group,query),query);
  return true;
}
Program: 26541
Project: 26541
Buggy source:
@Override public void onGroupSelected(Group group){
  CellListFragment listFragment=(CellListFragment)getSupportFragmentManager().findFragmentById(R.id.cellListFragment);
  if (listFragment == null) {
    Intent i=new Intent(getApplicationContext(),CellListActivity.class);
    i.putExtra(INTENT_SWITCH_GROUP,group);
    startActivity(i);
  }
 else {
    listFragment.setGroup(group);
  }
}

Fixed version (ground truth):
@Override public void onGroupSelected(Group group){
  CellListFragment listFragment=(CellListFragment)getSupportFragmentManager().findFragmentById(R.id.cellListFragment);
  if (listFragment == null || !listFragment.isInLayout()) {
    Intent i=new Intent(getApplicationContext(),CellListActivity.class);
    i.putExtra(INTENT_SWITCH_GROUP,group);
    startActivity(i);
  }
 else {
    listFragment.setGroup(group);
  }
}
Program: 26542
Project: 26542
Buggy source:
@Override public boolean onQueryTextChange(String query){
  adapter.setQueryCells(helper.getQueryCells(group,query),query);
  return true;
}

Fixed version (ground truth):
@Override public boolean onQueryTextChange(String query){
  if (adapter != null)   adapter.setQueryCells(helper.getQueryCells(group,query),query);
  return true;
}
Program: 26543
Project: 26543
Buggy source:
@Override public void onListItemClick(ListView l,View v,int position,long id){
  super.onListItemClick(l,v,position,id);
  CellData cell=cells.get(position);
  CellCollection.getInstance().setCurrentCell(cell);
  Intent i=new Intent(getActivity().getApplicationContext(),SageActivity.class);
  startActivity(i);
}

Fixed version (ground truth):
@Override public void onListItemClick(ListView l,View v,int position,long id){
  super.onListItemClick(l,v,position,id);
  CellData cell=cells.get(position);
  CellCollection.getInstance().setCurrentCell(cell);
  Intent i=new Intent(getActivity().getApplicationContext(),SageActivity.class);
  i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  startActivity(i);
}
Program: 26545
Project: 26545
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  CellData newCell=new CellData();
  if (title.getText().toString().equals("String_Node_Str")) {
    Date date=new Date();
    DateFormat dateFormat=new SimpleDateFormat("String_Node_Str",Locale.US);
    newCell.title=dateFormat.format(date);
  }
 else {
    newCell.title=title.getText().toString();
  }
  if (group.getText().toString().equals("String_Node_Str")) {
    newCell.group="String_Node_Str";
  }
 else {
    newCell.group=group.getText().toString();
  }
  if (input.getText().toString().equals("String_Node_Str")) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
 else {
    newCell.input=input.getText().toString();
  }
  newCell.rank=(int)Math.random() * 30;
  CellCollection.getInstance().addCell(newCell);
  CellCollection.getInstance().setCurrentCell(newCell);
  Intent i=new Intent(getActivity().getApplicationContext(),SageActivity.class);
  i.putExtra("String_Node_Str",true);
  startActivity(i);
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  CellData newCell=new CellData();
  if (title.getText().toString().equals("String_Node_Str")) {
    Date date=new Date();
    DateFormat dateFormat=new SimpleDateFormat("String_Node_Str",Locale.US);
    newCell.title=dateFormat.format(date);
  }
 else {
    newCell.title=title.getText().toString();
  }
  if (group.getText().toString().equals("String_Node_Str")) {
    newCell.group="String_Node_Str";
  }
 else {
    newCell.group=group.getText().toString();
  }
  if (input.getText().toString().equals("String_Node_Str")) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
 else {
    newCell.input=input.getText().toString();
  }
  newCell.rank=(int)Math.random() * 30;
  CellCollection.getInstance().addCell(newCell);
  CellCollection.getInstance().setCurrentCell(newCell);
  Intent i=new Intent(getActivity().getApplicationContext(),SageActivity.class);
  i.putExtra("String_Node_Str",true);
  i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  startActivity(i);
}
Program: 26547
Project: 26547
Buggy source:
/** 
 * Event handler for the list of active containers on restart. Sets the info key   {@link StatusKeys#INFO_CONTAINERS_AM_RESTART}to the size of the list passed down (and does not set it if none were)
 * @param liveContainers the containers allocated
 * @return true if a rebuild took place (even if size 0)
 * @throws HoyaRuntimeException on problems
 */
private boolean rebuildModelFromRestart(List<Container> liveContainers){
  if (liveContainers == null) {
    return false;
  }
  for (  Container container : liveContainers) {
    addRestartedContainer(container);
  }
  clusterDescription.setInfo(StatusKeys.INFO_CONTAINERS_AM_RESTART,Integer.toString(liveContainers.size()));
  return true;
}

Fixed version (ground truth):
/** 
 * Event handler for the list of active containers on restart. Sets the info key   {@link StatusKeys#INFO_CONTAINERS_AM_RESTART}to the size of the list passed down (and does not set it if none were)
 * @param liveContainers the containers allocated
 * @return true if a rebuild took place (even if size 0)
 * @throws HoyaRuntimeException on problems
 */
private boolean rebuildModelFromRestart(List<Container> liveContainers) throws BadClusterStateException {
  if (liveContainers == null) {
    return false;
  }
  for (  Container container : liveContainers) {
    addRestartedContainer(container);
  }
  clusterDescription.setInfo(StatusKeys.INFO_CONTAINERS_AM_RESTART,Integer.toString(liveContainers.size()));
  return true;
}
Program: 26548
Project: 26548
Buggy source:
/** 
 * Add a restarted container by walking it through the create/submit/start lifecycle, so building up the internal structures
 * @param container container that was running before the AM restarted
 * @throws HoyaRuntimeException on problems
 */
private void addRestartedContainer(Container container){
  String containerHostInfo=container.getNodeId().getHost() + "String_Node_Str" + container.getNodeId().getPort();
  ContainerId cid=container.getId();
  int roleId=ContainerPriority.extractRole(container);
  RoleStatus role=lookupRoleStatus(roleId);
  role.incActual();
  String roleName=role.getName();
  log.info("String_Node_Str",cid,roleName,containerHostInfo);
  RoleInstance instance=new RoleInstance(container);
  instance.command=roleName;
  instance.role=roleName;
  instance.roleId=roleId;
  instance.environment=new String[0];
  instance.container=container;
  instance.createTime=now();
  instance.state=ClusterDescription.STATE_LIVE;
  activeContainers.put(cid,instance);
  roleHistory.onContainerAssigned(container);
  containerStartSubmitted(container,instance);
  innerOnNodeManagerContainerStarted(cid);
}

Fixed version (ground truth):
/** 
 * Add a restarted container by walking it through the create/submit/start lifecycle, so building up the internal structures
 * @param container container that was running before the AM restarted
 * @throws HoyaRuntimeException on problems
 */
private void addRestartedContainer(Container container) throws BadClusterStateException {
  String containerHostInfo=container.getNodeId().getHost() + "String_Node_Str" + container.getNodeId().getPort();
  ContainerId cid=container.getId();
  int roleId=ContainerPriority.extractRole(container);
  RoleStatus role=lookupRoleStatus(roleId);
  role.incActual();
  String roleName=role.getName();
  log.info("String_Node_Str",cid,roleName,containerHostInfo);
  RoleInstance instance=new RoleInstance(container);
  instance.command=roleName;
  instance.role=roleName;
  instance.roleId=roleId;
  instance.environment=new String[0];
  instance.container=container;
  instance.createTime=now();
  instance.state=ClusterDescription.STATE_LIVE;
  activeContainers.put(cid,instance);
  roleHistory.onContainerAssigned(container);
  containerStartSubmitted(container,instance);
  innerOnNodeManagerContainerStarted(cid);
}
Program: 26549
Project: 26549
Buggy source:
/** 
 * add a launched container to the node map for status responses
 * @param container id
 * @param node node details
 */
private void addLaunchedContainer(Container container,RoleInstance node){
  node.container=container;
  if (node.role == null) {
    log.warn("String_Node_Str",node);
    node.role=ROLE_UNKNOWN;
  }
  getLiveNodes().put(node.getContainerId(),node);
  roleHistory.onContainerStarted(container);
}

Fixed version (ground truth):
/** 
 * add a launched container to the node map for status responses
 * @param container id
 * @param node node details
 */
private void addLaunchedContainer(Container container,RoleInstance node){
  node.container=container;
  if (node.role == null) {
    throw new HoyaRuntimeException("String_Node_Str",node);
  }
  getLiveNodes().put(node.getContainerId(),node);
  roleHistory.onContainerStarted(container);
}
Program: 26550
Project: 26550
Buggy source:
/** 
 * build up the special master node, which lives in the live node set but has a lifecycle bonded to the AM
 * @param containerId the AM master
 */
public void buildAppMasterNode(ContainerId containerId){
  Container container=new ContainerPBImpl();
  container.setId(containerId);
  RoleInstance am=new RoleInstance(container);
  am.role=HoyaKeys.ROLE_HOYA_AM;
  am.buildUUID();
  appMasterNode=am;
  getLiveNodes().put(containerId,am);
}

Fixed version (ground truth):
/** 
 * build up the special master node, which lives in the live node set but has a lifecycle bonded to the AM
 * @param containerId the AM master
 */
public void buildAppMasterNode(ContainerId containerId){
  Container container=new ContainerPBImpl();
  container.setId(containerId);
  RoleInstance am=new RoleInstance(container);
  am.role=HoyaKeys.ROLE_HOYA_AM;
  appMasterNode=am;
  getLiveNodes().put(containerId,am);
}
Program: 26552
Project: 26552
Buggy source:
public RoleInstance(Container container){
  this.container=container;
}

Fixed version (ground truth):
public RoleInstance(Container container){
  this.container=container;
  buildUUID();
}
Program: 26553
Project: 26553
Buggy source:
public void buildUUID(){
  if (container == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (container.getId() == null) {
    throw new NullPointerException("String_Node_Str");
  }
  uuid=container.getId().toString();
}

Fixed version (ground truth):
private void buildUUID(){
  if (container == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (container.getId() == null) {
    throw new NullPointerException("String_Node_Str");
  }
  uuid=container.getId().toString();
}
Program: 26554
Project: 26554
Buggy source:
/** 
 * Apply a set of command line options to a cluster role map
 * @param clusterRoleMap cluster role map to merge onto
 * @param commandOptions command opts
 */
public static void applyCommandLineOptsToRoleMap(Map<String,Map<String,String>> clusterRoleMap,Map<String,Map<String,String>> commandOptions){
  for (  String key : commandOptions.keySet()) {
    Map<String,String> optionMap=commandOptions.get(key);
    Map<String,String> existingMap=clusterRoleMap.get(key);
    if (existingMap == null) {
      existingMap=new HashMap<String,String>();
    }
    log.debug("String_Node_Str",stringifyMap(optionMap));
    mergeMap(existingMap,optionMap);
    clusterRoleMap.put(key,existingMap);
  }
}

Fixed version (ground truth):
/** 
 * Apply a set of command line options to a cluster role map
 * @param clusterRoleMap cluster role map to merge onto
 * @param commandOptions command opts
 */
public static void applyCommandLineOptsToRoleMap(Map<String,Map<String,String>> clusterRoleMap,Map<String,Map<String,String>> commandOptions){
  for (  Map.Entry<String,Map<String,String>> entry : commandOptions.entrySet()) {
    String key=entry.getKey();
    Map<String,String> optionMap=entry.getValue();
    Map<String,String> existingMap=clusterRoleMap.get(key);
    if (existingMap == null) {
      existingMap=new HashMap<String,String>();
    }
    log.debug("String_Node_Str",stringifyMap(optionMap));
    mergeMap(existingMap,optionMap);
    clusterRoleMap.put(key,existingMap);
  }
}
Program: 26555
Project: 26555
Buggy source:
/** 
 * Declare that the AM is complete
 * @param exitCode exit code for the aM
 * @param reason reason for termination
 */
public void signalAMComplete(int exitCode,String reason){
  amCompletionReason=reason;
  AMExecutionStateLock.lock();
  try {
    amCompletionFlag.set(true);
    amExitCode=exitCode;
    isAMCompleted.signal();
  }
  finally {
    AMExecutionStateLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Declare that the AM is complete
 * @param exitCode exit code for the aM
 * @param reason reason for termination
 */
public synchronized void signalAMComplete(int exitCode,String reason){
  amCompletionReason=reason;
  AMExecutionStateLock.lock();
  try {
    amCompletionFlag.set(true);
    amExitCode=exitCode;
    isAMCompleted.signal();
  }
  finally {
    AMExecutionStateLock.unlock();
  }
}
Program: 26558
Project: 26558
Buggy source:
@Override public int compare(Path o1,Path o2){
  return -(o1.getName().compareTo(o2.getName()));
}

Fixed version (ground truth):
@Override public int compare(Path o1,Path o2){
  return o2.getName().compareTo(o1.getName());
}
Program: 26560
Project: 26560
Buggy source:
/** 
 * Build up the classpath for execution  -behaves very differently on a mini test cluster vs a production production one.
 * @param hoyaConfDir relative path to the dir containing hoya config options to put on theclasspath -or null
 * @return a classpath
 */
private String buildClasspath(String hoyaConfDir){
  StringBuilder classPathEnv=new StringBuilder();
  if (getUsingMiniMRCluster()) {
    classPathEnv.append(System.getProperty("String_Node_Str"));
  }
 else {
    classPathEnv.append(ApplicationConstants.Environment.CLASSPATH.$()).append(File.pathSeparatorChar).append("String_Node_Str");
    for (    String c : getConfig().getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH)) {
      classPathEnv.append(File.pathSeparatorChar);
      classPathEnv.append(c.trim());
    }
    if (hoyaConfDir != null) {
      classPathEnv.append(File.pathSeparatorChar).append(hoyaConfDir);
    }
  }
  return classPathEnv.toString();
}

Fixed version (ground truth):
/** 
 * Build up the classpath for execution  -behaves very differently on a mini test cluster vs a production production one.
 * @param hoyaConfDir relative path to the dir containing hoya config options to put on theclasspath -or null
 * @return a classpath
 */
private String buildClasspath(String hoyaConfDir){
  StringBuilder classPathEnv=new StringBuilder();
  if (getUsingMiniMRCluster()) {
    classPathEnv.append(System.getProperty("String_Node_Str"));
  }
 else {
    classPathEnv.append(ApplicationConstants.Environment.CLASSPATH.$()).append(File.pathSeparatorChar).append("String_Node_Str");
    String[] strs=getConfig().getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH);
    if (strs != null) {
      for (      String c : strs) {
        classPathEnv.append(File.pathSeparatorChar);
        classPathEnv.append(c.trim());
      }
    }
    if (hoyaConfDir != null) {
      classPathEnv.append(File.pathSeparatorChar).append(hoyaConfDir);
    }
  }
  return classPathEnv.toString();
}
Program: 26561
Project: 26561
Buggy source:
/** 
 * Get the lines of recent output
 * @return the last few lines of output; an empty list if there are noneor the process is not actually running
 */
public List<String> getRecentOutput(){
  return new ArrayList<String>(recentLines);
}

Fixed version (ground truth):
/** 
 * Get the lines of recent output
 * @return the last few lines of output; an empty list if there are noneor the process is not actually running
 */
public synchronized List<String> getRecentOutput(){
  return new ArrayList<String>(recentLines);
}
Program: 26562
Project: 26562
Buggy source:
/** 
 * Propagate a property from a source to a dest config, with a best-effort attempt at propagating the origin. If the 
 * @param dest destination
 * @param src source
 * @param key key to try to copy
 * @return true if the key was found and propagated
 */
public static boolean propagate(Configuration dest,Configuration src,String key){
  String val=src.get(key);
  if (val != null) {
    String[] origin=src.getPropertySources(key);
    if (origin.length > 0) {
      dest.set(key,val,origin[0]);
    }
 else {
      dest.set(key,val);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Propagate a property from a source to a dest config, with a best-effort attempt at propagating the origin. If the 
 * @param dest destination
 * @param src source
 * @param key key to try to copy
 * @return true if the key was found and propagated
 */
public static boolean propagate(Configuration dest,Configuration src,String key){
  String val=src.get(key);
  if (val != null) {
    String[] origin=src.getPropertySources(key);
    if (origin != null && origin.length > 0) {
      dest.set(key,val,origin[0]);
    }
 else {
      dest.set(key,val);
      return true;
    }
  }
  return false;
}
Program: 26563
Project: 26563
Buggy source:
public static String listDir(File dir){
  StringBuilder builder=new StringBuilder();
  String[] confDirEntries=dir.list();
  for (  String entry : confDirEntries) {
    builder.append(entry).append("String_Node_Str");
  }
  return builder.toString();
}

Fixed version (ground truth):
public static String listDir(File dir){
  if (dir == null)   return "String_Node_Str";
  StringBuilder builder=new StringBuilder();
  String[] confDirEntries=dir.list();
  for (  String entry : confDirEntries) {
    builder.append(entry).append("String_Node_Str");
  }
  return builder.toString();
}
Program: 26564
Project: 26564
Buggy source:
/** 
 * Add the passed   {@link Service} to the list of services managed by this{@link SequenceService}
 * @param service the {@link Service} to be added
 */
@Override public void addService(Service service){
  log.debug("String_Node_Str",service.getName());
synchronized (serviceList) {
    serviceList.add(service);
  }
}

Fixed version (ground truth):
/** 
 * Add the passed   {@link Service} to the list of services managed by this{@link SequenceService}
 * @param service the {@link Service} to be added
 */
@Override public synchronized void addService(Service service){
  log.debug("String_Node_Str",service.getName());
synchronized (serviceList) {
    serviceList.add(service);
  }
}
Program: 26566
Project: 26566
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_low_profile);
  findViewById(R.id.toggle).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      ActionBar ab=getSupportActionBar();
      View decorView=getWindow().getDecorView();
      if (ab.isShowing()) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
          decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
        }
        ab.hide();
      }
 else {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
          decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
        }
        ab.show();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_low_profile);
  findViewById(R.id.toggle).setOnClickListener(new View.OnClickListener(){
    @Override @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) public void onClick(    View v){
      ActionBar ab=getSupportActionBar();
      View decorView=getWindow().getDecorView();
      if (ab.isShowing()) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
          decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
        }
        ab.hide();
      }
 else {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
          decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
        }
        ab.show();
      }
    }
  }
);
}
Program: 26567
Project: 26567
Buggy source:
@Override public void onClick(View v){
  ActionBar ab=getSupportActionBar();
  View decorView=getWindow().getDecorView();
  if (ab.isShowing()) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    }
    ab.hide();
  }
 else {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
    }
    ab.show();
  }
}

Fixed version (ground truth):
@Override @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) public void onClick(View v){
  ActionBar ab=getSupportActionBar();
  View decorView=getWindow().getDecorView();
  if (ab.isShowing()) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    }
    ab.hide();
  }
 else {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
    }
    ab.show();
  }
}
Program: 26568
Project: 26568
Buggy source:
private String addCustomizedNamespacePrefix(String customizedNamespacePrefix,String expression){
  return expression.replaceAll("String_Node_Str","String_Node_Str" + customizedNamespacePrefix + "String_Node_Str");
}

Fixed version (ground truth):
private String addCustomizedNamespacePrefix(String customizedNamespacePrefix,String expression){
  return expression.replaceAll("String_Node_Str","String_Node_Str" + customizedNamespacePrefix + "String_Node_Str"+ "String_Node_Str");
}
Program: 26569
Project: 26569
Buggy source:
@Override public void filter(Reader reader,Writer writer,List<Replace> replaces) throws IOException {
  SAXBuilder saxBuilder=new SAXBuilder();
  Document doc=null;
  try {
    doc=saxBuilder.build(reader);
  }
 catch (  JDOMException e) {
    throw new IOException("String_Node_Str",e);
  }
  for (  Replace replace : replaces) {
    XPathFactory xPathFactory=XPathFactory.instance();
    XPathExpression xPathExpression=null;
    String rootNamespaceURI=doc.getRootElement().getNamespaceURI();
    if (StringUtils.isEmpty(rootNamespaceURI)) {
      xPathExpression=xPathFactory.compile(replace.getXpath());
    }
 else {
      String customizedNamespacePrefix="String_Node_Str";
      Namespace rootNamespace=Namespace.getNamespace(customizedNamespacePrefix,doc.getRootElement().getNamespaceURI());
      String expression=replace.getXpath().replace("String_Node_Str","String_Node_Str" + customizedNamespacePrefix + "String_Node_Str");
      xPathExpression=xPathFactory.compile(expression,Filters.fpassthrough(),null,rootNamespace);
    }
    for (    Object obj : xPathExpression.evaluate(doc)) {
      if (obj instanceof Element) {
        ((Element)obj).setText(replace.getValue());
      }
 else       if (obj instanceof Attribute) {
        ((Attribute)obj).setValue(replace.getValue());
      }
 else {
        throw new IOException("String_Node_Str" + obj.getClass().toString());
      }
    }
  }
  XMLOutputter xmlOutputter=new XMLOutputter(Format.getPrettyFormat());
  xmlOutputter.output(doc,writer);
}

Fixed version (ground truth):
@Override public void filter(Reader reader,Writer writer,List<Replace> replaces) throws IOException {
  SAXBuilder saxBuilder=new SAXBuilder();
  Document doc=null;
  try {
    doc=saxBuilder.build(reader);
  }
 catch (  JDOMException e) {
    throw new IOException("String_Node_Str",e);
  }
  for (  Replace replace : replaces) {
    XPathFactory xPathFactory=XPathFactory.instance();
    XPathExpression xPathExpression=null;
    String rootNamespaceURI=doc.getRootElement().getNamespaceURI();
    if (StringUtils.isEmpty(rootNamespaceURI)) {
      xPathExpression=xPathFactory.compile(replace.getXpath());
    }
 else {
      Namespace rootNamespace=Namespace.getNamespace(CUSTOMIZED_NAMESPACE_PREFIX,doc.getRootElement().getNamespaceURI());
      String expression=addCustomizedNamespacePrefix(CUSTOMIZED_NAMESPACE_PREFIX,replace.getXpath());
      xPathExpression=xPathFactory.compile(expression,Filters.fpassthrough(),null,rootNamespace);
    }
    for (    Object obj : xPathExpression.evaluate(doc)) {
      if (obj instanceof Element) {
        ((Element)obj).setText(replace.getValue());
      }
 else       if (obj instanceof Attribute) {
        ((Attribute)obj).setValue(replace.getValue());
      }
 else {
        throw new IOException("String_Node_Str" + obj.getClass().toString());
      }
    }
  }
  XMLOutputter xmlOutputter=new XMLOutputter(Format.getPrettyFormat());
  xmlOutputter.output(doc,writer);
}
Program: 26570
Project: 26570
Buggy source:
public S3RiverFeedDefinition(String feedname,String bucket,String pathPrefix,String downloadHost,int updateRate,List<String> includes,List<String> excludes,String accessKey,String secretKey,boolean jsonSupport){
  this.feedname=feedname;
  this.bucket=bucket;
  this.pathPrefix=pathPrefix;
  this.downloadHost=downloadHost;
  this.updateRate=updateRate;
  this.includes=includes;
  this.excludes=excludes;
  this.accessKey=accessKey;
  this.secretKey=secretKey;
}

Fixed version (ground truth):
public S3RiverFeedDefinition(String feedname,String bucket,String pathPrefix,String downloadHost,int updateRate,List<String> includes,List<String> excludes,String accessKey,String secretKey,boolean jsonSupport){
  this.feedname=feedname;
  this.bucket=bucket;
  this.pathPrefix=pathPrefix;
  this.downloadHost=downloadHost;
  this.updateRate=updateRate;
  this.includes=includes;
  this.excludes=excludes;
  this.accessKey=accessKey;
  this.secretKey=secretKey;
  this.jsonSupport=jsonSupport;
}
Program: 26571
Project: 26571
Buggy source:
public TransientVector pop(){
  ensureEditable();
  if (cnt == 0)   throw new IllegalStateException("String_Node_Str");
  if (cnt == 1) {
    cnt=0;
    return this;
  }
  int i=cnt - 1;
  if ((i & 0x01f) > 0) {
    --cnt;
    return this;
  }
  Object[] newtail=arrayFor(cnt - 2);
  Node newroot=popTail(shift,root);
  int newshift=shift;
  if (newroot == null) {
    newroot=new Node(root.edit);
  }
  if (shift > 5 && newroot.array[1] == null) {
    newroot=ensureEditable((Node)newroot.array[0]);
    newshift-=5;
  }
  root=newroot;
  shift=newshift;
  --cnt;
  tail=newtail;
  return this;
}

Fixed version (ground truth):
public TransientVector pop(){
  ensureEditable();
  if (cnt == 0)   throw new IllegalStateException("String_Node_Str");
  if (cnt == 1) {
    cnt=0;
    return this;
  }
  int i=cnt - 1;
  if ((i & 0x01f) > 0) {
    --cnt;
    return this;
  }
  Object[] newtail=editableArrayFor(cnt - 2);
  Node newroot=popTail(shift,root);
  int newshift=shift;
  if (newroot == null) {
    newroot=new Node(root.edit);
  }
  if (shift > 5 && newroot.array[1] == null) {
    newroot=ensureEditable((Node)newroot.array[0]);
    newshift-=5;
  }
  root=newroot;
  shift=newshift;
  --cnt;
  tail=newtail;
  return this;
}
Program: 26572
Project: 26572
Buggy source:
private HashCollisionNode ensureEditable(AtomicReference<Thread> edit,int count,Object[] array){
  if (this.edit == edit) {
    this.array=array;
    return this;
  }
  return new HashCollisionNode(edit,count,hash,array);
}

Fixed version (ground truth):
private HashCollisionNode ensureEditable(AtomicReference<Thread> edit,int count,Object[] array){
  if (this.edit == edit) {
    this.array=array;
    return this;
  }
  return new HashCollisionNode(edit,hash,count,array);
}
Program: 26573
Project: 26573
Buggy source:
HashCollisionNode(AtomicReference<Thread> edit,int hash,Object... array){
  this.edit=edit;
  this.hash=hash;
  this.array=array;
}

Fixed version (ground truth):
HashCollisionNode(AtomicReference<Thread> edit,int hash,int count,Object... array){
  this.edit=edit;
  this.hash=hash;
  this.count=count;
  this.array=array;
}
Program: 26574
Project: 26574
Buggy source:
private static INode createNode(AtomicReference<Thread> edit,int shift,Object key1,Object val1,int key2hash,Object key2,Object val2){
  int key1hash=Util.hash(key1);
  if (key1hash == key2hash)   return new HashCollisionNode(null,key1hash,new Object[]{key1,val1,key2,val2});
  Box _=new Box(null);
  return BitmapIndexedNode.EMPTY.assoc(edit,shift,key1hash,key1,val1,_).assoc(edit,shift,key2hash,key2,val2,_);
}

Fixed version (ground truth):
private static INode createNode(AtomicReference<Thread> edit,int shift,Object key1,Object val1,int key2hash,Object key2,Object val2){
  int key1hash=Util.hash(key1);
  if (key1hash == key2hash)   return new HashCollisionNode(null,key1hash,2,new Object[]{key1,val1,key2,val2});
  Box _=new Box(null);
  return BitmapIndexedNode.EMPTY.assoc(edit,shift,key1hash,key1,val1,_).assoc(edit,shift,key2hash,key2,val2,_);
}
Program: 26575
Project: 26575
Buggy source:
public INode without(AtomicReference<Thread> edit,int shift,int hash,Object key,Box removedLeaf){
  return null;
}

Fixed version (ground truth):
public INode without(AtomicReference<Thread> edit,int shift,int hash,Object key,Box removedLeaf){
  int idx=findIndex(key);
  if (idx == -1)   return this;
  if (array.length == 2)   return null;
  HashCollisionNode editable=ensureEditable(edit);
  editable.array[idx]=editable.array[2 * count - 2];
  editable.array[idx + 1]=editable.array[2 * count - 1];
  editable.array[2 * count - 2]=editable.array[2 * count - 1]=null;
  editable.count--;
  return editable;
}
Program: 26576
Project: 26576
Buggy source:
public INode assoc(AtomicReference<Thread> edit,int shift,int hash,Object key,Object val,Box addedLeaf){
  if (hash == this.hash) {
    int idx=findIndex(key);
    if (idx != -1) {
      if (array[idx + 1] == val)       return this;
      return editAndSet(idx + 1,val);
    }
    Object[] newArray=new Object[array.length + 2];
    System.arraycopy(array,0,newArray,0,array.length);
    newArray[array.length]=key;
    newArray[array.length + 1]=val;
    return ensureEditable(edit,newArray);
  }
  return new BitmapIndexedNode(edit,bitpos(this.hash,shift),new Object[]{this}).assoc(edit,shift,hash,key,val,addedLeaf);
}

Fixed version (ground truth):
public INode assoc(AtomicReference<Thread> edit,int shift,int hash,Object key,Object val,Box addedLeaf){
  if (hash == this.hash) {
    int idx=findIndex(key);
    if (idx != -1) {
      if (array[idx + 1] == val)       return this;
      return editAndSet(edit,idx + 1,val);
    }
    Object[] newArray=new Object[array.length + 2];
    System.arraycopy(array,0,newArray,0,array.length);
    newArray[array.length]=key;
    newArray[array.length + 1]=val;
    return ensureEditable(edit,count + 1,newArray);
  }
  return new BitmapIndexedNode(edit,bitpos(this.hash,shift),new Object[]{this}).assoc(edit,shift,hash,key,val,addedLeaf);
}
Program: 26577
Project: 26577
Buggy source:
Object doValAt(Object key,Object notFound){
  return root.find(0,Util.hash(key),key,notFound);
}

Fixed version (ground truth):
Object doValAt(Object key,Object notFound){
  if (key == null)   if (hasNull)   return nullValue;
 else   return notFound;
  if (root == null)   return null;
  return root.find(0,Util.hash(key),key,notFound);
}
Program: 26578
Project: 26578
Buggy source:
HashCollisionNode ensureEditable(AtomicReference<Thread> edit,Object[] array){
  if (this.edit == edit) {
    this.array=array;
    return this;
  }
  return new HashCollisionNode(edit,hash,array);
}

Fixed version (ground truth):
HashCollisionNode ensureEditable(AtomicReference<Thread> edit,int count,Object[] array){
  if (this.edit == edit) {
    this.array=array;
    return this;
  }
  return new HashCollisionNode(edit,count,hash,array);
}
Program: 26579
Project: 26579
Buggy source:
HashCollisionNode editAndSet(int i,Object a,int j,Object b){
  HashCollisionNode editable=ensureEditable(edit);
  editable.array[i]=a;
  editable.array[j]=b;
  return editable;
}

Fixed version (ground truth):
HashCollisionNode editAndSet(AtomicReference<Thread> edit,int i,Object a,int j,Object b){
  HashCollisionNode editable=ensureEditable(edit);
  editable.array[i]=a;
  editable.array[j]=b;
  return editable;
}
Program: 26580
Project: 26580
Buggy source:
private static Expr analyzeSymbol(Symbol sym) throws Exception {
  Symbol tag=tagOf(sym);
  if (sym.ns == null) {
    LocalBinding b=referenceLocal(sym);
    if (b != null)     return new LocalBindingExpr(b,tag);
  }
 else {
    if (namespaceFor(sym) == null) {
      Symbol nsSym=Symbol.create(sym.ns);
      Class c=HostExpr.maybeClass(nsSym,false);
      if (c != null) {
        if (Reflector.getField(c,sym.name,true) != null)         return new StaticFieldExpr((Integer)LINE.deref(),c,sym.name);
      }
    }
  }
  Object o=resolve(sym);
  if (o instanceof Var) {
    Var v=(Var)o;
    if (isMacro(v) != null)     throw new Exception("String_Node_Str" + v);
    registerVar(v);
    return new VarExpr(v,tag);
  }
 else   if (o instanceof Class)   return new ConstantExpr(o);
 else   if (o instanceof Symbol)   return new UnresolvedVarExpr((Symbol)o);
  throw new Exception("String_Node_Str" + sym + "String_Node_Str");
}

Fixed version (ground truth):
private static Expr analyzeSymbol(Symbol sym) throws Exception {
  Symbol tag=tagOf(sym);
  if (sym.ns == null) {
    LocalBinding b=referenceLocal(sym);
    if (b != null)     return new LocalBindingExpr(b,tag);
  }
 else {
    if (namespaceFor(sym) == null) {
      Symbol nsSym=Symbol.create(sym.ns);
      Class c=HostExpr.maybeClass(nsSym,false);
      if (c != null) {
        if (Reflector.getField(c,sym.name,true) != null)         return new StaticFieldExpr((Integer)LINE.deref(),c,sym.name);
        throw new Exception("String_Node_Str" + sym.name + "String_Node_Str"+ c);
      }
    }
  }
  Object o=resolve(sym);
  if (o instanceof Var) {
    Var v=(Var)o;
    if (isMacro(v) != null)     throw new Exception("String_Node_Str" + v);
    registerVar(v);
    return new VarExpr(v,tag);
  }
 else   if (o instanceof Class)   return new ConstantExpr(o);
 else   if (o instanceof Symbol)   return new UnresolvedVarExpr((Symbol)o);
  throw new Exception("String_Node_Str" + sym + "String_Node_Str");
}
Program: 26581
Project: 26581
Buggy source:
static Object invokeMatchingMethod(String methodName,List methods,Object target,Object[] args) throws Exception {
  Method m=null;
  Object[] boxedArgs=null;
  if (methods.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str" + methodName + "String_Node_Str"+ target.getClass());
  }
 else   if (methods.size() == 1) {
    m=(Method)methods.get(0);
    boxedArgs=boxArgs(m.getParameterTypes(),args);
  }
 else {
    Method foundm=null;
    for (Iterator i=methods.iterator(); i.hasNext(); ) {
      m=(Method)i.next();
      Class[] params=m.getParameterTypes();
      if (isCongruent(params,args)) {
        if (foundm == null || Compiler.subsumes(params,foundm.getParameterTypes())) {
          foundm=m;
          boxedArgs=boxArgs(params,args);
        }
      }
    }
    m=foundm;
  }
  if (m == null)   throw new IllegalArgumentException("String_Node_Str" + methodName + "String_Node_Str"+ target.getClass());
  if (!Modifier.isPublic(m.getDeclaringClass().getModifiers())) {
    m=getAsMethodOfPublicBase(m.getDeclaringClass(),m);
  }
  if (m == null)   throw new IllegalArgumentException("String_Node_Str" + methodName + "String_Node_Str"+ target.getClass());
  try {
    return prepRet(m.getReturnType(),m.invoke(target,boxedArgs));
  }
 catch (  InvocationTargetException e) {
    if (e.getCause() instanceof Exception)     throw (Exception)e.getCause();
    throw e;
  }
}

Fixed version (ground truth):
static Object invokeMatchingMethod(String methodName,List methods,Object target,Object[] args) throws Exception {
  Method m=null;
  Object[] boxedArgs=null;
  if (methods.isEmpty()) {
    throw new IllegalArgumentException(noMethodReport(methodName,target));
  }
 else   if (methods.size() == 1) {
    m=(Method)methods.get(0);
    boxedArgs=boxArgs(m.getParameterTypes(),args);
  }
 else {
    Method foundm=null;
    for (Iterator i=methods.iterator(); i.hasNext(); ) {
      m=(Method)i.next();
      Class[] params=m.getParameterTypes();
      if (isCongruent(params,args)) {
        if (foundm == null || Compiler.subsumes(params,foundm.getParameterTypes())) {
          foundm=m;
          boxedArgs=boxArgs(params,args);
        }
      }
    }
    m=foundm;
  }
  if (m == null)   throw new IllegalArgumentException(noMethodReport(methodName,target));
  if (!Modifier.isPublic(m.getDeclaringClass().getModifiers())) {
    m=getAsMethodOfPublicBase(m.getDeclaringClass(),m);
  }
  if (m == null)   throw new IllegalArgumentException(noMethodReport(methodName,target));
  try {
    return prepRet(m.getReturnType(),m.invoke(target,boxedArgs));
  }
 catch (  InvocationTargetException e) {
    if (e.getCause() instanceof Exception)     throw (Exception)e.getCause();
    throw e;
  }
}
Program: 26582
Project: 26582
Buggy source:
public Object[] toArray(Object[] a){
  if (a.length >= count()) {
    ISeq s=seq();
    for (int i=0; s != null; ++i, s=s.rest()) {
      a[i]=s.first();
    }
    if (a.length >= count())     a[count()]=null;
    return a;
  }
 else   return toArray();
}

Fixed version (ground truth):
public Object[] toArray(Object[] a){
  if (a.length >= count()) {
    ISeq s=seq();
    for (int i=0; s != null; ++i, s=s.rest()) {
      a[i]=s.first();
    }
    if (a.length > count())     a[count()]=null;
    return a;
  }
 else   return toArray();
}