nus-yam/ex-repair huggingface dataset:
Program: 54205
Project: 54205
Buggy source:
/** 
 * 添加任务
 */
private void addJob(Job job,JobPo jobPo) throws DupEntryException {
  if (job.isSchedule()) {
    addCronJob(jobPo);
    LOGGER.info("String_Node_Str",job);
  }
 else {
    appContext.getExecutableJobQueue().add(jobPo);
    LOGGER.info("String_Node_Str",job);
  }
}

Fixed version (ground truth):
/** 
 * 添加任务
 */
private void addJob(Job job,JobPo jobPo) throws DupEntryException {
  if (job.isSchedule()) {
    addCronJob(jobPo);
  }
 else {
    boolean needAdd2ExecutableJobQueue=true;
    String ignoreAddOnExecuting=job.getParam("String_Node_Str");
    if (ignoreAddOnExecuting != null && "String_Node_Str".equals(ignoreAddOnExecuting)) {
      if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) != null) {
        needAdd2ExecutableJobQueue=false;
      }
    }
    if (needAdd2ExecutableJobQueue) {
      appContext.getExecutableJobQueue().add(jobPo);
    }
  }
  LOGGER.info("String_Node_Str",job);
}
Program: 54207
Project: 54207
Buggy source:
public static void main(String[] args){
  final TaskTracker taskTracker=new TaskTracker();
  taskTracker.setJobRunnerClass(TestJobRunner.class);
  taskTracker.setRegistryAddress("String_Node_Str");
  taskTracker.setNodeGroup("String_Node_Str");
  taskTracker.setClusterName("String_Node_Str");
  taskTracker.setWorkThreads(10);
  taskTracker.addMasterChangeListener(new MasterChangeListenerImpl());
  taskTracker.addConfig("String_Node_Str","String_Node_Str");
  taskTracker.addConfig("String_Node_Str","String_Node_Str");
  taskTracker.start();
  Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
    @Override public void run(){
      taskTracker.stop();
    }
  }
));
}

Fixed version (ground truth):
public static void main(String[] args){
  final TaskTracker taskTracker=new TaskTracker();
  taskTracker.setJobRunnerClass(TestJobRunner.class);
  taskTracker.setRegistryAddress("String_Node_Str");
  taskTracker.setNodeGroup("String_Node_Str");
  taskTracker.setClusterName("String_Node_Str");
  taskTracker.setWorkThreads(10);
  taskTracker.addMasterChangeListener(new MasterChangeListenerImpl());
  taskTracker.addConfig("String_Node_Str","String_Node_Str");
  taskTracker.start();
  Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
    @Override public void run(){
      taskTracker.stop();
    }
  }
));
}
Program: 54208
Project: 54208
Buggy source:
@Override public void delete(JvmDataReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request));
}

Fixed version (ground truth):
@Override public void delete(JvmDataReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request)).doDelete();
}
Program: 54209
Project: 54209
Buggy source:
@Override public void delete(JvmDataReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request));
}

Fixed version (ground truth):
@Override public void delete(JvmDataReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request)).doDelete();
}
Program: 54210
Project: 54210
Buggy source:
@Override public void delete(JvmDataReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request));
}

Fixed version (ground truth):
@Override public void delete(JvmDataReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request)).doDelete();
}
Program: 54211
Project: 54211
Buggy source:
@Override public void delete(NodeOnOfflineLogPaginationReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request));
}

Fixed version (ground truth):
@Override public void delete(NodeOnOfflineLogPaginationReq request){
  new DeleteSql(getSqlTemplate()).delete(getTableName()).whereSql(buildWhereSql(request)).doDelete();
}
Program: 54212
Project: 54212
Buggy source:
@Override public JobPo getJob(String taskTrackerNodeGroup,String taskId){
  return new SelectSql(getSqlTemplate()).select().from().table(getTableName()).where("String_Node_Str",taskId).and("String_Node_Str",taskTrackerNodeGroup).single(RshHolder.JOB_PO_RSH);
}

Fixed version (ground truth):
@Override public JobPo getJob(String taskTrackerNodeGroup,String taskId){
  return new SelectSql(getSqlTemplate()).select().all().from().table(getTableName()).where("String_Node_Str",taskId).and("String_Node_Str",taskTrackerNodeGroup).single(RshHolder.JOB_PO_RSH);
}
Program: 54213
Project: 54213
Buggy source:
@Override public JobPo getJob(String taskTrackerNodeGroup,String taskId){
  return new SelectSql(getSqlTemplate()).select().from().table(getTableName(taskTrackerNodeGroup)).where("String_Node_Str",taskId).and("String_Node_Str",taskTrackerNodeGroup).single(RshHolder.JOB_PO_RSH);
}

Fixed version (ground truth):
@Override public JobPo getJob(String taskTrackerNodeGroup,String taskId){
  return new SelectSql(getSqlTemplate()).select().all().from().table(getTableName(taskTrackerNodeGroup)).where("String_Node_Str",taskId).and("String_Node_Str",taskTrackerNodeGroup).single(RshHolder.JOB_PO_RSH);
}
Program: 54214
Project: 54214
Buggy source:
@Override public JobPo get(String jobId){
  return new SelectSql(getSqlTemplate()).select().from().table(getTableName()).where("String_Node_Str",jobId).single(RshHolder.JOB_PO_RSH);
}

Fixed version (ground truth):
@Override public JobPo get(String jobId){
  return new SelectSql(getSqlTemplate()).select().all().from().table(getTableName()).where("String_Node_Str",jobId).single(RshHolder.JOB_PO_RSH);
}
Program: 54215
Project: 54215
Buggy source:
@Override public List<JobPo> getJobs(String taskTrackerIdentity){
  return new SelectSql(getSqlTemplate()).select().from().table(getTableName()).where("String_Node_Str",taskTrackerIdentity).list(RshHolder.JOB_PO_LIST_RSH);
}

Fixed version (ground truth):
@Override public List<JobPo> getJobs(String taskTrackerIdentity){
  return new SelectSql(getSqlTemplate()).select().all().from().table(getTableName()).where("String_Node_Str",taskTrackerIdentity).list(RshHolder.JOB_PO_LIST_RSH);
}
Program: 54216
Project: 54216
Buggy source:
@Override public JobPo getJob(String jobId){
  return new SelectSql(getSqlTemplate()).select().from().table(getTableName()).where("String_Node_Str",jobId).single(RshHolder.JOB_PO_RSH);
}

Fixed version (ground truth):
@Override public JobPo getJob(String jobId){
  return new SelectSql(getSqlTemplate()).select().all().from().table(getTableName()).where("String_Node_Str",jobId).single(RshHolder.JOB_PO_RSH);
}
Program: 54217
Project: 54217
Buggy source:
/** 
 * 添加Cron 任务
 */
private void addCronJob(JobPo jobPo) throws DupEntryException {
  Date nextTriggerTime=CronExpressionUtils.getNextTriggerTime(jobPo.getCronExpression());
  if (nextTriggerTime != null) {
    appContext.getCronJobQueue().add(jobPo);
    jobPo.setTriggerTime(nextTriggerTime.getTime());
    appContext.getExecutableJobQueue().add(jobPo);
  }
}

Fixed version (ground truth):
/** 
 * 添加Cron 任务
 */
private void addCronJob(JobPo jobPo) throws DupEntryException {
  Date nextTriggerTime=CronExpressionUtils.getNextTriggerTime(jobPo.getCronExpression());
  if (nextTriggerTime != null) {
    appContext.getCronJobQueue().add(jobPo);
    if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) == null) {
      jobPo.setTriggerTime(nextTriggerTime.getTime());
      appContext.getExecutableJobQueue().add(jobPo);
    }
  }
}
Program: 54218
Project: 54218
Buggy source:
/** 
 * 更新任务
 */
private boolean replaceOnExist(Job job,JobPo jobPo){
  JobPo oldJobPo;
  if (job.isSchedule()) {
    oldJobPo=appContext.getCronJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  }
 else {
    oldJobPo=appContext.getExecutableJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  }
  if (oldJobPo != null) {
    String jobId=oldJobPo.getJobId();
    appContext.getExecutableJobQueue().remove(job.getTaskTrackerNodeGroup(),jobId);
    if (job.isSchedule()) {
      appContext.getCronJobQueue().remove(jobId);
    }
    jobPo.setJobId(jobId);
  }
  try {
    addJob(job,jobPo);
  }
 catch (  DupEntryException e) {
    LOGGER.error("String_Node_Str",job);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * 更新任务
 */
private boolean replaceOnExist(Job job,JobPo jobPo){
  JobPo oldJobPo;
  if (job.isSchedule()) {
    oldJobPo=appContext.getCronJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  }
 else {
    oldJobPo=appContext.getExecutableJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  }
  if (oldJobPo != null) {
    String jobId=oldJobPo.getJobId();
    appContext.getExecutableJobQueue().remove(job.getTaskTrackerNodeGroup(),jobId);
    if (job.isSchedule()) {
      appContext.getCronJobQueue().remove(jobId);
    }
    jobPo.setJobId(jobId);
  }
  try {
    addJob(job,jobPo);
  }
 catch (  DupEntryException e) {
    LOGGER.warn("String_Node_Str",job);
    return false;
  }
  return true;
}
Program: 54219
Project: 54219
Buggy source:
public InsertSql columns(String... columns){
  if (columns == null || columns.length == 0) {
    throw new JdbcException("String_Node_Str");
  }
  if (columnsSize > 0) {
    throw new JdbcException("String_Node_Str");
  }
  columnsSize=columns.length;
  sql.append("String_Node_Str");
  String split="String_Node_Str";
  for (  String column : columns) {
    sql.append(split);
    split="String_Node_Str";
    sql.append("String_Node_Str").append(column.trim()).append("String_Node_Str");
  }
  sql.append("String_Node_Str");
  return this;
}

Fixed version (ground truth):
public InsertSql columns(String... columns){
  if (columns == null || columns.length == 0) {
    throw new JdbcException("String_Node_Str");
  }
  if (columnsSize > 0) {
    throw new JdbcException("String_Node_Str");
  }
  columnsSize=columns.length;
  sql.append("String_Node_Str");
  String split="String_Node_Str";
  for (  String column : columns) {
    sql.append(split);
    split="String_Node_Str";
    sql.append("String_Node_Str").append(column.trim()).append("String_Node_Str");
  }
  sql.append("String_Node_Str");
  sql.append("String_Node_Str");
  split="String_Node_Str";
  for (int i=0; i < columnsSize; i++) {
    sql.append(split);
    split="String_Node_Str";
    sql.append("String_Node_Str");
  }
  sql.append("String_Node_Str");
  return this;
}
Program: 54220
Project: 54220
Buggy source:
public InsertSql values(Object... values){
  if (values == null || values.length != columnsSize) {
    throw new JdbcException("String_Node_Str");
  }
  params.add(values);
  if (params.size() > 1) {
    sql.append("String_Node_Str");
  }
  sql.append("String_Node_Str");
  String split="String_Node_Str";
  for (int i=0; i < columnsSize; i++) {
    sql.append(split);
    split="String_Node_Str";
    sql.append("String_Node_Str");
  }
  sql.append("String_Node_Str");
  return this;
}

Fixed version (ground truth):
public InsertSql values(Object... values){
  if (values == null || values.length != columnsSize) {
    throw new JdbcException("String_Node_Str");
  }
  params.add(values);
  return this;
}
Program: 54221
Project: 54221
Buggy source:
public int[] doBatchInsert(){
  if (params.size() == 0) {
    throw new JdbcException("String_Node_Str");
  }
  String finalSQL=sql.toString();
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug(SQLFormatter.format(finalSQL));
  }
  try {
    Object[][] objects=new Object[params.size()][];
    for (int i=0; i < params.size(); i++) {
      objects[i]=params.get(i);
    }
    return sqlTemplate.batchInsert(finalSQL,objects);
  }
 catch (  SQLException e) {
    if (e.getMessage().contains("String_Node_Str")) {
      throw new DupEntryException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
    }
 else     if (e.getMessage().contains("String_Node_Str")) {
      throw new TableNotExistException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
    }
    throw new JdbcException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
  }
catch (  Exception e) {
    throw new JdbcException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
  }
}

Fixed version (ground truth):
public int[] doBatchInsert(){
  if (params.size() == 0) {
    throw new JdbcException("String_Node_Str");
  }
  String finalSQL=sql.toString();
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug(SQLFormatter.format(finalSQL));
  }
  try {
    Object[][] objects=new Object[params.size()][columnsSize];
    for (int i=0; i < params.size(); i++) {
      objects[i]=params.get(i);
    }
    return sqlTemplate.batchInsert(finalSQL,objects);
  }
 catch (  SQLException e) {
    if (e.getMessage().contains("String_Node_Str")) {
      throw new DupEntryException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
    }
 else     if (e.getMessage().contains("String_Node_Str")) {
      throw new TableNotExistException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
    }
    throw new JdbcException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
  }
catch (  Exception e) {
    throw new JdbcException("String_Node_Str" + SQLFormatter.format(finalSQL),e);
  }
}
Program: 54222
Project: 54222
Buggy source:
public void remove(K key){
  StoreTxLogPosition storeTxLogPosition=storeTxLogEngine.append(Operation.REMOVE,key);
  IndexItem<K> indexItem=index.removeIndexItem(storeTxLogPosition,key);
  if (indexItem != null) {
    dataBlockEngine.remove(storeTxLogPosition,indexItem);
  }
  dataCache.remove(key);
}

Fixed version (ground truth):
public void remove(K key){
  dataCache.remove(key);
  StoreTxLogPosition storeTxLogPosition=storeTxLogEngine.append(Operation.REMOVE,key);
  IndexItem<K> indexItem=index.removeIndexItem(storeTxLogPosition,key);
  if (indexItem != null) {
    dataBlockEngine.remove(storeTxLogPosition,indexItem);
  }
}
Program: 54223
Project: 54223
Buggy source:
private void singleResultsProcess(List<TaskTrackerJobResult> results){
  TaskTrackerJobResult result=results.get(0);
  if (!needRetry(result)) {
    if (result.getJobWrapper().getJob().isNeedFeedback()) {
      clientNotifier.send(results);
    }
 else {
      jobFinishHandler.onComplete(results);
    }
  }
 else {
    jobFinishHandler.onComplete(results);
  }
}

Fixed version (ground truth):
private void singleResultsProcess(List<TaskTrackerJobResult> results){
  TaskTrackerJobResult result=results.get(0);
  if (!needRetry(result)) {
    if (result.getJobWrapper().getJob().isNeedFeedback()) {
      clientNotifier.send(results);
    }
 else {
      jobFinishHandler.onComplete(results);
    }
  }
 else {
    retryHandler.onComplete(results);
  }
}
Program: 54224
Project: 54224
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  List<TableSchema> tableSchemas=getTableSchema("String_Node_Str");
  for (  TableSchema tableSchema : tableSchemas) {
    commonRepo.executeSQL(tableSchema.table);
    if (CollectionUtils.isEmpty(tableSchema.indexes)) {
      continue;
    }
    for (    String index : tableSchema.indexes) {
      try {
        commonRepo.executeSQL(index);
      }
 catch (      BadSqlGrammarException e) {
        if (!e.getMessage().contains("String_Node_Str")) {
          throw e;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  List<TableSchema> tableSchemas=getTableSchema("String_Node_Str");
  for (  TableSchema tableSchema : tableSchemas) {
    commonRepo.executeSQL(tableSchema.table);
    if (CollectionUtils.isEmpty(tableSchema.indexes)) {
      continue;
    }
    for (    String index : tableSchema.indexes) {
      try {
        commonRepo.executeSQL(index);
      }
 catch (      BadSqlGrammarException e) {
        if (isDuplicateIndex(e)) {
        }
 else {
          throw e;
        }
      }
    }
  }
}
Program: 54225
Project: 54225
Buggy source:
public final void stop(){
  try {
    if (start.compareAndSet(true,false)) {
      monitorDataCollectScheduledFuture.cancel(true);
      monitorDataCollectScheduleExecutor.shutdown();
      JVMMonitor.stop();
      LOGGER.info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public final void stop(){
  try {
    if (start.compareAndSet(true,false)) {
      collectScheduledFuture.cancel(true);
      collectScheduleExecutor.shutdown();
      JVMMonitor.stop();
      LOGGER.info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 54226
Project: 54226
Buggy source:
public final void start(){
  monitorSite=config.getParameter("String_Node_Str");
  if (StringUtils.isEmpty(monitorSite)) {
    return;
  }
  try {
    if (start.compareAndSet(false,true)) {
      monitorDataCollectScheduledFuture=monitorDataCollectScheduleExecutor.scheduleWithFixedDelay(new Runnable(){
        @Override public void run(){
          try {
            MonitorData monitorData=collectMonitorData();
            long seconds=SystemClock.now() / 1000;
            long residue=seconds % INTERVAL;
            seconds=seconds - residue;
            monitorData.setTimestamp(seconds * 1000);
            monitorData.setJvmMonitorData(JVMCollector.collect());
            report(monitorData);
            checkSendJVMInfo();
          }
 catch (          Throwable t) {
            LOGGER.error("String_Node_Str",t);
          }
        }
      }
,5,INTERVAL,TimeUnit.SECONDS);
      JVMMonitor.start();
      checkSendJVMInfo();
      LOGGER.info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public final void start(){
  monitorSite=config.getParameter("String_Node_Str");
  if (StringUtils.isEmpty(monitorSite)) {
    return;
  }
  try {
    if (start.compareAndSet(false,true)) {
      collectScheduledFuture=collectScheduleExecutor.scheduleWithFixedDelay(new Runnable(){
        @Override public void run(){
          Calendar calendar=Calendar.getInstance();
          int minute=calendar.get(Calendar.MINUTE);
          try {
            if (preMinute == null) {
              preMinute=minute;
              return;
            }
            int diff=minute - preMinute;
            diff=diff < 0 ? diff + 60 : diff;
            if (diff >= interval) {
              MonitorData monitorData=collectMonitorData();
              long seconds=SystemClock.now() / 1000;
              seconds=seconds - (seconds % 60);
              seconds=seconds - interval * 60;
              monitorData.setTimestamp(seconds * 1000);
              monitorData.setJvmMonitorData(JVMCollector.collect());
              report(monitorData);
              checkSendJVMInfo();
              preMinute=minute;
            }
          }
 catch (          Throwable t) {
            LOGGER.error("String_Node_Str",t);
          }
        }
      }
,1,1,TimeUnit.SECONDS);
      JVMMonitor.start();
      checkSendJVMInfo();
      LOGGER.info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 54227
Project: 54227
Buggy source:
@Override public void run(){
  try {
    MonitorData monitorData=collectMonitorData();
    long seconds=SystemClock.now() / 1000;
    long residue=seconds % INTERVAL;
    seconds=seconds - residue;
    monitorData.setTimestamp(seconds * 1000);
    monitorData.setJvmMonitorData(JVMCollector.collect());
    report(monitorData);
    checkSendJVMInfo();
  }
 catch (  Throwable t) {
    LOGGER.error("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@Override public void run(){
  Calendar calendar=Calendar.getInstance();
  int minute=calendar.get(Calendar.MINUTE);
  try {
    if (preMinute == null) {
      preMinute=minute;
      return;
    }
    int diff=minute - preMinute;
    diff=diff < 0 ? diff + 60 : diff;
    if (diff >= interval) {
      MonitorData monitorData=collectMonitorData();
      long seconds=SystemClock.now() / 1000;
      seconds=seconds - (seconds % 60);
      seconds=seconds - interval * 60;
      monitorData.setTimestamp(seconds * 1000);
      monitorData.setJvmMonitorData(JVMCollector.collect());
      report(monitorData);
      checkSendJVMInfo();
      preMinute=minute;
    }
  }
 catch (  Throwable t) {
    LOGGER.error("String_Node_Str",t);
  }
}
Program: 54228
Project: 54228
Buggy source:
public AbstractPreLoader(final Application application){
  if (start.compareAndSet(false,true)) {
    loadSize=application.getConfig().getParameter("String_Node_Str",500);
    factor=application.getConfig().getParameter("String_Node_Str",0.5);
    scheduledFuture=LOAD_EXECUTOR_SERVICE.scheduleWithFixedDelay(new Runnable(){
      @Override public void run(){
        for (        String loadTaskTrackerNodeGroup : LOAD_SIGNAL) {
          JobPriorityBlockingQueue queue=JOB_MAP.get(loadTaskTrackerNodeGroup);
          if (queue.size() / loadSize < factor) {
            List<JobPo> loads=load(loadTaskTrackerNodeGroup,curSequence * (loadSize - queue.size()));
            if (CollectionUtils.isNotEmpty(loads)) {
              for (              JobPo load : loads) {
                if (!queue.offer(load)) {
                  break;
                }
              }
            }
          }
          LOAD_SIGNAL.remove(loadTaskTrackerNodeGroup);
        }
      }
    }
,500,500,TimeUnit.MILLISECONDS);
  }
  application.getEventCenter().subscribe(new EventSubscriber(application.getConfig().getIdentity() + "String_Node_Str",new Observer(){
    @Override public void onObserved(    EventInfo eventInfo){
      setCurSequence(application);
    }
  }
),EcTopic.NODE_ADD,EcTopic.NODE_REMOVE);
  setCurSequence(application);
}

Fixed version (ground truth):
public AbstractPreLoader(final Application application){
  if (start.compareAndSet(false,true)) {
    loadSize=application.getConfig().getParameter("String_Node_Str",300);
    factor=application.getConfig().getParameter("String_Node_Str",0.2);
    scheduledFuture=LOAD_EXECUTOR_SERVICE.scheduleWithFixedDelay(new Runnable(){
      @Override public void run(){
        for (        String loadTaskTrackerNodeGroup : LOAD_SIGNAL) {
          JobPriorityBlockingQueue queue=JOB_MAP.get(loadTaskTrackerNodeGroup);
          if (queue.size() / loadSize < factor) {
            List<JobPo> loads=load(loadTaskTrackerNodeGroup,curSequence * (loadSize - queue.size()));
            if (CollectionUtils.isNotEmpty(loads)) {
              for (              JobPo load : loads) {
                if (!queue.offer(load)) {
                  break;
                }
              }
            }
          }
          LOAD_SIGNAL.remove(loadTaskTrackerNodeGroup);
        }
      }
    }
,500,500,TimeUnit.MILLISECONDS);
  }
  application.getEventCenter().subscribe(new EventSubscriber(application.getConfig().getIdentity() + "String_Node_Str",new Observer(){
    @Override public void onObserved(    EventInfo eventInfo){
      setCurSequence(application);
    }
  }
),EcTopic.NODE_ADD,EcTopic.NODE_REMOVE);
  setCurSequence(application);
}
Program: 54229
Project: 54229
Buggy source:
public void stop(){
  FIXED_EXECUTOR_SERVICE.shutdown();
}

Fixed version (ground truth):
public void stop(){
  if (start) {
    start=false;
    scheduledFuture.cancel(true);
    FIXED_EXECUTOR_SERVICE.shutdown();
  }
}
Program: 54231
Project: 54231
Buggy source:
public void addNodes(List<Node> nodes){
  Node newMaster=null;
  for (  Node node : nodes) {
    if (newMaster == null) {
      newMaster=node;
    }
 else {
      if (newMaster.getCreateTime() > node.getCreateTime()) {
        newMaster=node;
      }
    }
  }
  if (master != newMaster) {
    master=newMaster;
    notifyListener();
  }
}

Fixed version (ground truth):
public void addNodes(List<Node> nodes){
  Node newMaster=null;
  for (  Node node : nodes) {
    if (newMaster == null) {
      newMaster=node;
    }
 else {
      if (newMaster.getCreateTime() > node.getCreateTime()) {
        newMaster=node;
      }
    }
  }
  if (master == null || !master.equals(newMaster)) {
    master=newMaster;
    notifyListener();
  }
}
Program: 54232
Project: 54232
Buggy source:
public void addNodes(List<Node> nodes){
  Node newMaster=null;
  for (  Node node : nodes) {
    if (newMaster == null) {
      newMaster=node;
    }
 else {
      if (newMaster.getCreateTime() > node.getCreateTime()) {
        newMaster=node;
      }
    }
  }
  if (master == null || !master.equals(newMaster)) {
    master=newMaster;
    notifyListener();
  }
}

Fixed version (ground truth):
public void addNodes(List<Node> nodes){
  Node newMaster=null;
  for (  Node node : nodes) {
    if (newMaster == null) {
      newMaster=node;
    }
 else {
      if (newMaster.getCreateTime() > node.getCreateTime()) {
        newMaster=node;
      }
    }
  }
  addNode(newMaster);
}
Program: 54233
Project: 54233
Buggy source:
public static void removeNode(Node removedNode){
  if (master != null) {
    if (master.getIdentity().equals(removedNode.getIdentity())) {
      List<Node> nodes=NodeManager.getNodeList(Application.Config.getNodeType());
      if (CollectionUtils.isNotEmpty(nodes)) {
        Node newMaster=null;
        for (        Node node : nodes) {
          if (newMaster == null) {
            newMaster=node;
          }
 else {
            if (newMaster.getCreateTime() > node.getCreateTime()) {
              newMaster=node;
            }
          }
        }
        master=newMaster;
        notifyListener();
      }
    }
  }
}

Fixed version (ground truth):
public static void removeNode(Node removedNode){
  if (master != null) {
    if (master.getIdentity().equals(removedNode.getIdentity())) {
      List<Node> nodes=NodeManager.getNodeList(Application.Config.getNodeType(),Application.Config.getNodeGroup());
      if (CollectionUtils.isNotEmpty(nodes)) {
        Node newMaster=null;
        for (        Node node : nodes) {
          if (newMaster == null) {
            newMaster=node;
          }
 else {
            if (newMaster.getCreateTime() > node.getCreateTime()) {
              newMaster=node;
            }
          }
        }
        master=newMaster;
        notifyListener();
      }
    }
  }
}
Program: 54234
Project: 54234
Buggy source:
@Override public Response submitJob(List<Job> jobs){
  Response response=super.submitJob(jobs);
  if (!response.isSuccess()) {
    List<Line> lines=new ArrayList<Line>();
    for (    Job job : response.getFailedJobs()) {
      String line=JsonUtils.objectToJsonString(job);
      lines.add(new Line(line));
    }
    try {
      if (fileAccessor == null) {
        throw new RuntimeException("String_Node_Str");
      }
      fileAccessor.addLines(lines);
      response.setSuccess(true);
      response.setCode(ResponseCode.FAILED_AND_SAVE_FILE);
    }
 catch (    FileException e) {
      response.setSuccess(false);
      response.setMsg(e.getMessage());
    }
  }
  return response;
}

Fixed version (ground truth):
@Override public Response submitJob(List<Job> jobs){
  Response response=superSubmitJob(jobs);
  if (!response.isSuccess()) {
    List<Line> lines=new ArrayList<Line>();
    for (    Job job : response.getFailedJobs()) {
      String line=JsonUtils.objectToJsonString(job);
      lines.add(new Line(line));
    }
    try {
      if (fileAccessor == null) {
        throw new RuntimeException("String_Node_Str");
      }
      fileAccessor.addLines(lines);
      response.setSuccess(true);
      response.setCode(ResponseCode.FAILED_AND_SAVE_FILE);
    }
 catch (    FileException e) {
      response.setSuccess(false);
      response.setMsg(e.getMessage());
    }
  }
  return response;
}
Program: 54235
Project: 54235
Buggy source:
@Override protected void nodeStart(){
  retryScheduler=new RetryScheduler<Job>(30){
    @Override protected boolean isRemotingEnable(){
      return isServerEnable();
    }
    @Override protected boolean retry(    List<Job> jobs){
      return submitJob(jobs).isSuccess();
    }
  }
;
  fileAccessor=retryScheduler.getFileAccessor();
  super.nodeStart();
  retryScheduler.start();
}

Fixed version (ground truth):
@Override protected void nodeStart(){
  retryScheduler=new RetryScheduler<Job>(30){
    @Override protected boolean isRemotingEnable(){
      return isServerEnable();
    }
    @Override protected boolean retry(    List<Job> jobs){
      return superSubmitJob(jobs).isSuccess();
    }
  }
;
  fileAccessor=retryScheduler.getFileAccessor();
  super.nodeStart();
  retryScheduler.start();
}
Program: 54236
Project: 54236
Buggy source:
@Override protected boolean retry(List<Job> jobs){
  return submitJob(jobs).isSuccess();
}

Fixed version (ground truth):
@Override protected boolean retry(List<Job> jobs){
  return superSubmitJob(jobs).isSuccess();
}
Program: 54238
Project: 54238
Buggy source:
public static void addNode(Node node){
  if ((Application.Config.getNodeType().equals(node.getNodeType()) && Application.Config.getNodeGroup().equals(node.getGroup())) || (NodeType.JOB_TRACKER.equals(Application.Config.getNodeType()))) {
    List<Node> nodeList=NODES.get(node.getNodeType());
    if (CollectionUtils.isEmpty(nodeList)) {
      nodeList=new CopyOnWriteArrayList<Node>();
      NODES.put(node.getNodeType(),nodeList);
    }
    nodeList.add(node);
    LOGGER.info("String_Node_Str" + node);
  }
}

Fixed version (ground truth):
public static void addNode(Node node){
  if ((NodeType.JOB_TRACKER.equals(node.getNodeType())) || ((Application.Config.getNodeType().equals(node.getNodeType()) && Application.Config.getNodeGroup().equals(node.getGroup())) || (NodeType.JOB_TRACKER.equals(Application.Config.getNodeType())))) {
    List<Node> nodeList=NODES.get(node.getNodeType());
    if (CollectionUtils.isEmpty(nodeList)) {
      nodeList=new CopyOnWriteArrayList<Node>();
      NODES.put(node.getNodeType(),nodeList);
    }
    nodeList.add(node);
    LOGGER.info("String_Node_Str" + node);
  }
}
Program: 54240
Project: 54240
Buggy source:
@Override public boolean equals(Object o){
  if (o.getClass() != FuseBind.class)   return false;
  FuseBind b=(FuseBind)o;
  if (b.source != null) {
    if (!b.source.equals(this.source))     return false;
  }
 else   if (this.source != null)   return false;
  if (b.mountpoint != null) {
    if (!b.mountpoint.equals(this.mountpoint))     return false;
  }
 else   if (this.mountpoint != null)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o == null || o.getClass() != FuseBind.class)   return false;
  FuseBind b=(FuseBind)o;
  if (b.source != null) {
    if (!b.source.equals(this.source))     return false;
  }
 else   if (this.source != null)   return false;
  if (b.mountpoint != null) {
    if (!b.mountpoint.equals(this.mountpoint))     return false;
  }
 else   if (this.mountpoint != null)   return false;
  return true;
}
Program: 54241
Project: 54241
Buggy source:
@Override public boolean equals(Object o){
  return o.getClass() == CVE.class && id.equals(((CVE)o).id);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o == null) {
    return false;
  }
  return o.getClass() == this.getClass() && id.equals(((CVE)o).id);
}
Program: 54242
Project: 54242
Buggy source:
@Override public boolean equals(Object o){
  return o.getClass() == Link.class && url.equals(((Link)o).url);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o == null) {
    return false;
  }
  return o.getClass() == this.getClass() && url.equals(((Link)o).url);
}
Program: 54243
Project: 54243
Buggy source:
@Override public boolean equals(Object o){
  return o.getClass() == OSVDB.class && id == ((OSVDB)o).id;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o == null) {
    return false;
  }
  return o.getClass() == this.getClass() && id == ((OSVDB)o).id;
}
Program: 54244
Project: 54244
Buggy source:
public static void initCore() throws DaemonException, SuException {
  if (mCoreInitialized)   return;
  String socket_path=getCorePath() + "String_Node_Str";
  if (!Client.isConnected()) {
    if (!Client.Connect(socket_path)) {
      startCoreDaemon();
      if (!Client.Connect(socket_path))       throw new DaemonException("String_Node_Str");
    }
  }
  if (!Client.isAuthenticated() && !Client.Login("String_Node_Str","String_Node_Str")) {
    throw new DaemonException("String_Node_Str");
  }
  if (!Client.LoadHandlers()) {
    throw new DaemonException("String_Node_Str");
  }
  ChildManager.storeHandlers();
  reloadTools();
  mCoreInitialized=true;
  Services.getNetworkRadar().onAutoScanChanged();
}

Fixed version (ground truth):
public static void initCore() throws DaemonException, SuException {
  if (mCoreInitialized)   return;
  String socket_path=getCorePath() + "String_Node_Str";
  if (!Client.isConnected()) {
    if (!Client.Connect(socket_path)) {
      startCoreDaemon();
      if (!Client.Connect(socket_path))       throw new DaemonException("String_Node_Str");
    }
  }
  if (!Client.isAuthenticated() && !Client.Login("String_Node_Str","String_Node_Str")) {
    throw new DaemonException("String_Node_Str");
  }
  if (!Client.LoadHandlers()) {
    throw new DaemonException("String_Node_Str");
  }
  ChildManager.storeHandlers();
  reloadTools();
  mCoreInitialized=true;
  Services.getNetworkRadar().onAutoScanChanged();
  getNetwork().onCoreAttached();
}
Program: 54245
Project: 54245
Buggy source:
private static void uncaughtReloadNetworkMapping() throws UnknownHostException, SocketException {
  mNetwork=new Network(mContext,mIfname);
  mIfname=mNetwork.getInterface().getName();
  reset();
  mInitialized=true;
  Network.watchForIssue480();
}

Fixed version (ground truth):
private static void uncaughtReloadNetworkMapping() throws UnknownHostException, SocketException {
  mNetwork=new Network(mContext,mIfname);
  mIfname=mNetwork.getInterface().getName();
  reset();
  mInitialized=true;
}
Program: 54246
Project: 54246
Buggy source:
public boolean initNetworkInterface(String iface){
  InterfaceAddress ifaceAddress=null;
  try {
    if (iface == null)     iface=getAvailableInterfaces().get(0);
    mInterface=NetworkInterface.getByName(iface);
    if (mInterface.getInterfaceAddresses().isEmpty()) {
      return false;
    }
    for (    InterfaceAddress ia : mInterface.getInterfaceAddresses()) {
      if (Patterns.IP_ADDRESS.matcher(ia.getAddress().getHostAddress()).matches()) {
        ifaceAddress=ia;
        Logger.warning("String_Node_Str" + ia.getAddress().getHostAddress() + "String_Node_Str"+ Short.toString(ia.getNetworkPrefixLength()));
        break;
      }
 else       Logger.error("String_Node_Str" + ia.getAddress().getHostAddress() + "String_Node_Str"+ Short.toString(ia.getNetworkPrefixLength()));
    }
    if (ifaceAddress == null) {
      return false;
    }
    SubnetUtils su=new SubnetUtils(ifaceAddress.getAddress().getHostAddress() + "String_Node_Str" + Short.toString(ifaceAddress.getNetworkPrefixLength()));
    mLocal=new IP4Address(su.getInfo().getAddress());
    mNetmask=new IP4Address(su.getInfo().getNetmask());
    mBase=new IP4Address(su.getInfo().getNetworkAddress());
    String gateway=getSystemGateway(mInterface.getDisplayName());
    if (gateway == null) {
      mGateway=null;
      Logger.debug("String_Node_Str");
    }
 else {
      mGateway=new IP4Address(gateway);
      Logger.debug("String_Node_Str" + gateway);
      Logger.debug("String_Node_Str" + mGateway);
    }
    return true;
  }
 catch (  Exception e) {
    Logger.error("String_Node_Str" + e.getLocalizedMessage());
  }
  return false;
}

Fixed version (ground truth):
public boolean initNetworkInterface(String iface){
  InterfaceAddress ifaceAddress=null;
  try {
    if (iface == null)     iface=getAvailableInterfaces().get(0);
    mInterface=NetworkInterface.getByName(iface);
    if (mInterface.getInterfaceAddresses().isEmpty()) {
      return false;
    }
    for (    InterfaceAddress ia : mInterface.getInterfaceAddresses()) {
      if (Patterns.IP_ADDRESS.matcher(ia.getAddress().getHostAddress()).matches()) {
        ifaceAddress=ia;
        Logger.warning("String_Node_Str" + ia.getAddress().getHostAddress() + "String_Node_Str"+ Short.toString(ia.getNetworkPrefixLength()));
        break;
      }
 else       Logger.error("String_Node_Str" + ia.getAddress().getHostAddress() + "String_Node_Str"+ Short.toString(ia.getNetworkPrefixLength()));
    }
    if (ifaceAddress == null) {
      return false;
    }
    SubnetUtils su=new SubnetUtils(ifaceAddress.getAddress().getHostAddress() + "String_Node_Str" + Short.toString(ifaceAddress.getNetworkPrefixLength()));
    mLocal=new IP4Address(su.getInfo().getAddress());
    mNetmask=new IP4Address(su.getInfo().getNetmask());
    mBase=new IP4Address(su.getInfo().getNetworkAddress());
    updateGateway();
    return true;
  }
 catch (  Exception e) {
    Logger.error("String_Node_Str" + e.getLocalizedMessage());
  }
  return false;
}
Program: 54247
Project: 54247
Buggy source:
public ToolBox(){
  raw=new Raw();
  shell=new Shell();
  ruby=new Ruby();
  nmap=new NMap();
  hydra=new Hydra();
  arpSpoof=new ArpSpoof();
  ettercap=new Ettercap();
  fusemounts=new Fusemounts();
  ipTables=new IPTables();
  tcpDump=new TcpDump();
  msf=new Msf();
  networkRadar=new NetworkRadar();
  msfrpcd=new MsfRpcd();
  logcat=new Logcat();
}

Fixed version (ground truth):
public ToolBox(){
  raw=new Raw();
  shell=new Shell();
  ruby=new Ruby();
  nmap=new NMap();
  hydra=new Hydra();
  arpSpoof=new ArpSpoof();
  ettercap=new Ettercap();
  fusemounts=new Fusemounts();
  ipTables=new IPTables();
  tcpDump=new TcpDump();
  msf=new Msf();
  networkRadar=new NetworkRadar();
  msfrpcd=new MsfRpcd();
  logcat=new Logcat();
  ip=new Ip();
}
Program: 54248
Project: 54248
Buggy source:
public void reload(){
  raw.setEnabled();
  shell.setEnabled();
  nmap.setEnabled();
  hydra.setEnabled();
  arpSpoof.setEnabled();
  ettercap.setEnabled();
  fusemounts.setEnabled();
  ipTables.setEnabled();
  tcpDump.setEnabled();
  networkRadar.setEnabled();
  logcat.setEnabled();
  ruby.init();
  msf.init();
  msfrpcd.init();
}

Fixed version (ground truth):
public void reload(){
  raw.setEnabled();
  shell.setEnabled();
  nmap.setEnabled();
  hydra.setEnabled();
  arpSpoof.setEnabled();
  ettercap.setEnabled();
  fusemounts.setEnabled();
  ipTables.setEnabled();
  tcpDump.setEnabled();
  networkRadar.setEnabled();
  logcat.setEnabled();
  ip.setEnabled();
  ruby.init();
  msf.init();
  msfrpcd.init();
}
Program: 54249
Project: 54249
Buggy source:
@Override public void onNewLine(String line){
  if (libcFingerprint == null) {
    if (!line.contains("String_Node_Str")) {
      return;
    }
    libcFingerprint=line.substring(0,line.indexOf(':' + 1));
  }
 else   if (!line.startsWith(libcFingerprint)) {
    return;
  }
  super.onNewLine(line);
}

Fixed version (ground truth):
@Override public void onNewLine(String line){
  if (libcFingerprint == null) {
    if (!line.contains("String_Node_Str")) {
      return;
    }
    libcFingerprint=line.substring(0,line.indexOf(':') + 1);
  }
 else   if (!line.startsWith(libcFingerprint)) {
    return;
  }
  super.onNewLine(line);
}
Program: 54250
Project: 54250
Buggy source:
public boolean canExecuteInDir(String dir){
  if (!user(dir) && !remount(dir)) {
    dir=getRealPath(dir);
    if (!root(dir)) {
      dir=null;
    }
  }
  if (dir != null) {
synchronized (this) {
      resolvedDir=dir;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean canExecuteInDir(String dir){
  if (!user(dir) && !remount(dir)) {
    dir=getRealPath(dir);
    if (!root(dir)) {
      dir=null;
    }
  }
  if (dir != null) {
    if (System.getKnownIssues().isIssueFound(1)) {
      String corePath=System.getCorePath();
      String realCorePath=getRealPath(corePath);
      if (realCorePath != null)       corePath=realCorePath;
      dir=dir.replace(corePath,"String_Node_Str");
    }
synchronized (this) {
      resolvedDir=dir;
    }
    return true;
  }
  return false;
}
Program: 54251
Project: 54251
Buggy source:
/** 
 * check if the dSploit user can create executable files inside a directory.
 * @param dir directory to check
 * @return true if can execute files into {@code dir}, false otherwise
 */
private boolean user(String dir){
  String tmpname;
  File tmpfile=null;
  if (dir == null)   return false;
  tmpfile=new File(dir);
  try {
    if (!tmpfile.exists())     tmpfile.mkdirs();
    do {
      tmpname=UUID.randomUUID().toString();
    }
 while ((tmpfile=new File(dir,tmpname)).exists());
    tmpfile.createNewFile();
    return (tmpfile.canExecute() || tmpfile.setExecutable(true,false));
  }
 catch (  IOException e) {
    Logger.warning(String.format("String_Node_Str",dir));
  }
 finally {
    if (tmpfile != null && tmpfile.exists())     tmpfile.delete();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * check if the cSploit user can create executable files inside a directory.
 * @param dir directory to check
 * @return true if can execute files into {@code dir}, false otherwise
 */
private boolean user(String dir){
  String tmpname;
  File tmpfile=null;
  if (dir == null)   return false;
  tmpfile=new File(dir);
  try {
    if (!tmpfile.exists())     tmpfile.mkdirs();
    do {
      tmpname=UUID.randomUUID().toString();
    }
 while ((tmpfile=new File(dir,tmpname)).exists());
    tmpfile.createNewFile();
    return (tmpfile.canExecute() || tmpfile.setExecutable(true,false));
  }
 catch (  IOException e) {
    Logger.warning(String.format("String_Node_Str",dir));
  }
 finally {
    if (tmpfile != null && tmpfile.exists())     tmpfile.delete();
  }
  return false;
}
Program: 54252
Project: 54252
Buggy source:
public boolean canExecuteInDir(String dir){
  if (!user(dir) && !remount(dir)) {
    dir=getRealPath(dir);
    if (!root(dir)) {
      dir=null;
    }
  }
  if (dir != null) {
    if (System.getKnownIssues().isIssueFound(1)) {
      String corePath=System.getCorePath();
      String realCorePath=getRealPath(corePath);
      if (realCorePath != null)       corePath=realCorePath;
      dir=dir.replace(corePath,"String_Node_Str");
    }
synchronized (this) {
      resolvedDir=dir;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean canExecuteInDir(String dir){
  if (!user(dir) && !remount(dir)) {
    dir=getRealPath(dir);
    if (!root(dir)) {
      dir=null;
    }
  }
  if (dir != null) {
    if (System.getKnownIssues().isIssueFound(1)) {
      String corePath=System.getCorePath();
      dir=dir.replace(corePath,"String_Node_Str");
      corePath=getRealPath(corePath);
      if (corePath != null)       dir=dir.replace(corePath,"String_Node_Str");
    }
synchronized (this) {
      resolvedDir=dir;
    }
    return true;
  }
  return false;
}
Program: 54253
Project: 54253
Buggy source:
/** 
 * get version of installed MetaSploit Framework
 * @return the version of installed MetaSploit Framework
 */
public static String getLocalMsfVersion(){
  if (mLocalMsfVersion != null)   return mLocalMsfVersion;
  mLocalMsfVersion=readFirstLine(getMsfPath() + "String_Node_Str");
  return mLocalMsfVersion;
}

Fixed version (ground truth):
/** 
 * get version of installed MetaSploit Framework
 * @return the version of installed MetaSploit Framework
 */
public static String getLocalMsfVersion(){
  if (mLocalMsfVersion == null)   mLocalMsfVersion=readFirstLine(getMsfPath() + "String_Node_Str");
  return mLocalMsfVersion;
}
Program: 54254
Project: 54254
Buggy source:
/** 
 * get version of installed ruby
 * @return the installed version of ruby
 */
public static String getLocalRubyVersion(){
  if (mLocalRubyVersion != null)   return mLocalRubyVersion;
  String line=readFirstLine(getRubyPath() + "String_Node_Str");
  if (line != null)   return (mLocalRubyVersion=line);
  return null;
}

Fixed version (ground truth):
/** 
 * get version of installed ruby
 * @return the installed version of ruby
 */
public static String getLocalRubyVersion(){
  if (mLocalRubyVersion == null)   mLocalRubyVersion=readFirstLine(getRubyPath() + "String_Node_Str");
  return mLocalRubyVersion;
}
Program: 54256
Project: 54256
Buggy source:
public static void setMsfBranch(String branch){
  try {
synchronized (mMsfRepoParser) {
      mMsfRepoParser.setBranch(branch);
    }
  }
 catch (  Exception e) {
    Logger.error(e.getMessage());
  }
}

Fixed version (ground truth):
public static void setMsfBranch(String branch){
  try {
synchronized (mMsfRepoParser) {
      mMsfRepoParser.setBranch(branch);
    }
  }
 catch (  Exception e) {
    Logger.error(e.getClass().getName() + "String_Node_Str" + e.getMessage());
  }
}
Program: 54258
Project: 54258
Buggy source:
private void onMsfPathChanged(){
  measureMsfSize();
  mWipeMSF.setEnabled(new File(System.getRubyPath()).isDirectory() || new File(System.getMsfPath()).isDirectory());
}

Fixed version (ground truth):
private void onMsfPathChanged(){
  measureMsfSize();
  System.updateLocalRubyVersion();
  System.updateLocalMsfVersion();
  boolean haveMsf=false;
  File dir;
  File[] content;
  if ((dir=new File(System.getRubyPath())).isDirectory() || (dir=new File(System.getMsfPath())).isDirectory()) {
    content=dir.listFiles();
    haveMsf=content != null && content.length > 2;
  }
  mWipeMSF.setEnabled(haveMsf);
}
Program: 54259
Project: 54259
Buggy source:
@Override public void run(){
  String[] branches=UpdateService.getMsfBranches();
  boolean hasRelease=false;
  pref.setEntryValues(branches);
  pref.setEntries(branches);
  for (int i=0; !hasRelease && i < branches.length; i++) {
    hasRelease=branches[i].equals("String_Node_Str");
  }
  pref.setDefaultValue((hasRelease ? "String_Node_Str" : "String_Node_Str"));
  pref.setEnabled(true);
}

Fixed version (ground truth):
@Override public void run(){
  UpdateService.getMsfBranches();
  sendBroadcast(new Intent(SETTINGS_MSF_BRANCHES_AVAILABLE));
}
Program: 54260
Project: 54260
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction().equals(SETTINGS_WIPE_DONE)) {
    System.updateLocalRubyVersion();
    System.updateLocalMsfVersion();
    mWipeMSF.setEnabled(new File(System.getRubyPath()).isDirectory());
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction().equals(SETTINGS_WIPE_DONE)) {
    onMsfPathChanged();
  }
 else   if (intent.getAction().equals(SETTINGS_MSF_BRANCHES_AVAILABLE)) {
    onMsfBranchesAvailable();
  }
}
Program: 54261
Project: 54261
Buggy source:
private void getMsfBranches(){
  if (mBranchesWaiter != null) {
    if (mBranchesWaiter.getState() == Thread.State.TERMINATED)     try {
      mBranchesWaiter.join();
    }
 catch (    InterruptedException e) {
      Logger.error(e.getMessage());
    }
    return;
  }
  final ListPreference pref=mMsfBranch;
  mMsfBranch.setEnabled(false);
  mBranchesWaiter=new Thread(new Runnable(){
    @Override public void run(){
      String[] branches=UpdateService.getMsfBranches();
      boolean hasRelease=false;
      pref.setEntryValues(branches);
      pref.setEntries(branches);
      for (int i=0; !hasRelease && i < branches.length; i++) {
        hasRelease=branches[i].equals("String_Node_Str");
      }
      pref.setDefaultValue((hasRelease ? "String_Node_Str" : "String_Node_Str"));
      pref.setEnabled(true);
    }
  }
);
  mBranchesWaiter.start();
}

Fixed version (ground truth):
private void getMsfBranches(){
  if (mBranchesWaiter != null) {
    if (mBranchesWaiter.getState() == Thread.State.TERMINATED)     try {
      mBranchesWaiter.join();
    }
 catch (    InterruptedException e) {
      Logger.error(e.getMessage());
    }
    return;
  }
  final ListPreference pref=mMsfBranch;
  mMsfBranch.setEnabled(false);
  mBranchesWaiter=new Thread(new Runnable(){
    @Override public void run(){
      UpdateService.getMsfBranches();
      sendBroadcast(new Intent(SETTINGS_MSF_BRANCHES_AVAILABLE));
    }
  }
);
  mBranchesWaiter.start();
}