nus-yam/ex-repair huggingface dataset:
Program: 151761
Project: 151761
Buggy source:
/** 
 * Convenience method to get the Trigger Name
 * @return
 */
public String getTriggerName(){
  return getStringValue(KEY_TRIGGER_NAME);
}

Fixed version (ground truth):
/** 
 * Convenience method to get the Trigger Name
 * @return
 */
public String getTriggerName(){
  return get(KEY_TRIGGER_NAME);
}
Program: 151762
Project: 151762
Buggy source:
/** 
 * Convenience method to get the Cron Expression
 * @return
 */
public String getCronExpressionName(){
  return getStringValue(KEY_TRIGGER_CRON_EXPRESSION);
}

Fixed version (ground truth):
/** 
 * Convenience method to get the Cron Expression
 * @return
 */
public String getCronExpressionName(){
  return get(KEY_TRIGGER_CRON_EXPRESSION);
}
Program: 151763
Project: 151763
Buggy source:
AudioOutputQueue(final AudioFormat format) throws LineUnavailableException, InterruptedException {
  m_format=format;
  m_bytesPerFrame=m_format.getChannels() * m_format.getSampleSizeInBits() / 8;
  m_lineLastFrame=new byte[m_bytesPerFrame];
  DataLine.Info lineInfo=new DataLine.Info(SourceDataLine.class,m_format,(int)Math.round(LineBufferSeconds * m_format.getSampleRate()) * m_bytesPerFrame);
  m_line=(SourceDataLine)AudioSystem.getLine(lineInfo);
  m_line.open(m_format);
  m_queueThread.start();
  try {
    while (!m_line.isActive())     Thread.sleep(10);
  }
 catch (  InterruptedException e) {
    close();
    throw e;
  }
}

Fixed version (ground truth):
AudioOutputQueue(final AudioFormat format) throws LineUnavailableException {
  m_format=format;
  m_bytesPerFrame=m_format.getChannels() * m_format.getSampleSizeInBits() / 8;
  m_lineLastFrame=new byte[m_bytesPerFrame];
  DataLine.Info lineInfo=new DataLine.Info(SourceDataLine.class,m_format,(int)Math.round(LineBufferSeconds * m_format.getSampleRate()) * m_bytesPerFrame);
  m_line=(SourceDataLine)AudioSystem.getLine(lineInfo);
  m_line.open(m_format);
  m_queueThread.start();
  try {
    while (!m_line.isActive())     Thread.sleep(10);
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    close();
  }
}
Program: 151765
Project: 151765
Buggy source:
public synchronized void sync(long nowRemoteFrameTime){
  m_remoteFrameTimeOffset=nowRemoteFrameTime - getNowFrameTime() - (int)m_format.getSampleRate();
  s_logger.info("String_Node_Str" + m_remoteFrameTimeOffset);
}

Fixed version (ground truth):
public synchronized void sync(long nowRemoteFrameTime){
  m_remoteFrameTimeOffset=nowRemoteFrameTime - getNowFrameTime();
  s_logger.info("String_Node_Str" + m_remoteFrameTimeOffset);
}
Program: 151766
Project: 151766
Buggy source:
public void close() throws InterruptedException {
  m_queueThread.interrupt();
  try {
    m_queueThread.join();
  }
 catch (  InterruptedException e) {
    s_logger.log(Level.WARNING,"String_Node_Str",e);
    throw e;
  }
 finally {
    m_line.stop();
    m_line.close();
  }
}

Fixed version (ground truth):
public void close(){
  m_queueThread.interrupt();
  try {
    m_queueThread.join();
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    s_logger.log(Level.WARNING,"String_Node_Str",e);
  }
 finally {
    m_line.stop();
    m_line.close();
  }
}
Program: 151769
Project: 151769
Buggy source:
@Override public void channelClosed(ChannelHandlerContext ctx,ChannelStateEvent e) throws Exception {
  if (m_audioOutputQueue != null) {
    s_logger.info("String_Node_Str");
    m_audioOutputQueue.close();
  }
}

Fixed version (ground truth):
@Override public synchronized void channelClosed(ChannelHandlerContext ctx,ChannelStateEvent e) throws Exception {
  s_logger.info("String_Node_Str");
  if (m_audioOutputQueue != null)   m_audioOutputQueue.close();
  if (m_audioChannel != null)   m_audioChannel.close();
  if (m_controlChannel != null)   m_controlChannel.close();
  if (m_timingChannel != null)   m_timingChannel.close();
}
Program: 151770
Project: 151770
Buggy source:
@Override public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=Channels.pipeline();
  pipeline.addLast("String_Node_Str",AirReceiver.ChannelExecutionHandler);
  pipeline.addLast("String_Node_Str",m_exceptionLoggingHandler);
  pipeline.addLast("String_Node_Str",m_decodeHandler);
  pipeline.addLast("String_Node_Str",m_encodeHandler);
  pipeline.addLast("String_Node_Str",m_packetLoggingHandler);
  if (channelType.equals(RaopRtpChannelType.Audio))   pipeline.addLast("String_Node_Str",m_audioToControlRouterUpstreamHandler);
  if (channelType.equals(RaopRtpChannelType.Control))   pipeline.addLast("String_Node_Str",m_controlToAudioRouterDownstreamHandler);
  if (channelType.equals(RaopRtpChannelType.Audio))   pipeline.addLast("String_Node_Str",m_resendRequestHandler);
  if (channelType.equals(RaopRtpChannelType.Audio) && (m_decryptionHandler != null))   pipeline.addLast("String_Node_Str",m_decryptionHandler);
  if (channelType.equals(RaopRtpChannelType.Audio) && (m_audioDecodeHandler != null))   pipeline.addLast("String_Node_Str",m_audioDecodeHandler);
  if (channelType.equals(RaopRtpChannelType.Control))   pipeline.addLast("String_Node_Str",m_syncHandler);
  if (channelType.equals(RaopRtpChannelType.Audio))   pipeline.addLast("String_Node_Str",m_audioEnqueueHandler);
  return pipeline;
}

Fixed version (ground truth):
@Override public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=Channels.pipeline();
  pipeline.addLast("String_Node_Str",AirReceiver.ChannelExecutionHandler);
  pipeline.addLast("String_Node_Str",m_exceptionLoggingHandler);
  pipeline.addLast("String_Node_Str",m_decodeHandler);
  pipeline.addLast("String_Node_Str",m_encodeHandler);
  pipeline.addLast("String_Node_Str",m_packetLoggingHandler);
  if (channelType.equals(RaopRtpChannelType.Timing))   pipeline.addLast("String_Node_Str",m_timeSourceHandler);
  if (channelType.equals(RaopRtpChannelType.Audio))   pipeline.addLast("String_Node_Str",m_audioToControlRouterUpstreamHandler);
  if (channelType.equals(RaopRtpChannelType.Control))   pipeline.addLast("String_Node_Str",m_controlToAudioRouterDownstreamHandler);
  if (channelType.equals(RaopRtpChannelType.Audio))   pipeline.addLast("String_Node_Str",m_resendRequestHandler);
  if (channelType.equals(RaopRtpChannelType.Audio) && (m_decryptionHandler != null))   pipeline.addLast("String_Node_Str",m_decryptionHandler);
  if (channelType.equals(RaopRtpChannelType.Audio) && (m_audioDecodeHandler != null))   pipeline.addLast("String_Node_Str",m_audioDecodeHandler);
  if (channelType.equals(RaopRtpChannelType.Control))   pipeline.addLast("String_Node_Str",m_syncHandler);
  if (channelType.equals(RaopRtpChannelType.Audio))   pipeline.addLast("String_Node_Str",m_audioEnqueueHandler);
  return pipeline;
}
Program: 151771
Project: 151771
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent evt) throws Exception {
  HttpRequest req=(HttpRequest)evt.getMessage();
  HttpMethod method=req.getMethod();
  if (RaopRtspMethods.ANNOUNCE.equals(method)) {
    announceReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.SETUP.equals(method)) {
    setupReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.RECORD.equals(method)) {
    recordReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.FLUSH.equals(method)) {
    flushReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.TEARDOWN.equals(method)) {
    teardownReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.SET_PARAMETER.equals(method)) {
    setParameterReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.GET_PARAMETER.equals(method)) {
    getParameterReceived(ctx,req);
    return;
  }
  super.messageReceived(ctx,evt);
}

Fixed version (ground truth):
@Override public synchronized void messageReceived(ChannelHandlerContext ctx,MessageEvent evt) throws Exception {
  HttpRequest req=(HttpRequest)evt.getMessage();
  HttpMethod method=req.getMethod();
  if (RaopRtspMethods.ANNOUNCE.equals(method)) {
    announceReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.SETUP.equals(method)) {
    setupReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.RECORD.equals(method)) {
    recordReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.FLUSH.equals(method)) {
    flushReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.TEARDOWN.equals(method)) {
    teardownReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.SET_PARAMETER.equals(method)) {
    setParameterReceived(ctx,req);
    return;
  }
 else   if (RaopRtspMethods.GET_PARAMETER.equals(method)) {
    getParameterReceived(ctx,req);
    return;
  }
  super.messageReceived(ctx,evt);
}
Program: 151772
Project: 151772
Buggy source:
@Override public void writeRequested(ChannelHandlerContext ctx,MessageEvent evt) throws Exception {
  RaopRtpPacket packet=(RaopRtpPacket)evt.getMessage();
  if (!(packet instanceof RaopRtpPacket.RetransmitRequest)) {
    super.writeRequested(ctx,evt);
    return;
  }
  if (evt.getChannel() == m_controlChannel) {
    super.writeRequested(ctx,evt);
    return;
  }
  m_controlChannel.write(evt.getMessage(),evt.getRemoteAddress());
}

Fixed version (ground truth):
@Override public void writeRequested(ChannelHandlerContext ctx,MessageEvent evt) throws Exception {
  RaopRtpPacket packet=(RaopRtpPacket)evt.getMessage();
  if (!(packet instanceof RaopRtpPacket.RetransmitRequest)) {
    super.writeRequested(ctx,evt);
    return;
  }
  Channel controlChannel;
synchronized (RaopAudioHandler.this) {
    controlChannel=m_controlChannel;
  }
  if (evt.getChannel() == controlChannel) {
    super.writeRequested(ctx,evt);
    return;
  }
  controlChannel.write(evt.getMessage());
}
Program: 151775
Project: 151775
Buggy source:
private void backup() throws IOException {
  if (server.config.properties.getBoolean("String_Node_Str")) {
    println("String_Node_Str");
  }
  announce(t("String_Node_Str"));
  File copy;
  try {
    copy=makeTemporaryCopy();
    server.runCommand("String_Node_Str",null);
    zipBackup(copy);
  }
  finally {
    deleteRecursively(TEMP_DIRECTORY);
  }
  purgeOldBackups();
  announce(t("String_Node_Str"));
}

Fixed version (ground truth):
private void backup() throws IOException {
  if (server.config.properties.getBoolean("String_Node_Str")) {
    println("String_Node_Str");
  }
  announce(t("String_Node_Str"));
  File copy;
  try {
    copy=makeTemporaryCopy();
    server.runCommand("String_Node_Str",null);
    zipBackup(copy);
    this.tag=null;
  }
  finally {
    deleteRecursively(TEMP_DIRECTORY);
  }
  purgeOldBackups();
  announce(t("String_Node_Str"));
}
Program: 151776
Project: 151776
Buggy source:
private static File getBackup(boolean old){
  File[] files=getAutoBackups();
  long firstCreatedTime=old ? Long.MAX_VALUE : 0;
  File firstCreatedFile=null;
  for (  File file : files) {
    long date;
    try {
      date=dateMillis(file);
    }
 catch (    ParseException e) {
      continue;
    }
    if ((old && date < firstCreatedTime) || (!old && date > firstCreatedTime)) {
      firstCreatedFile=file;
      firstCreatedTime=date;
    }
  }
  return firstCreatedFile;
}

Fixed version (ground truth):
/** 
 * Get newest / oldest backup (auto backup).
 * @param old
 * @return 
 */
private static File getBackup(boolean old){
  File[] files=getAutoBackups();
  long firstCreatedTime=old ? Long.MAX_VALUE : 0;
  File firstCreatedFile=null;
  for (  File file : files) {
    long date;
    try {
      date=dateMillis(file);
    }
 catch (    ParseException e) {
      continue;
    }
    if ((old && date < firstCreatedTime) || (!old && date > firstCreatedTime)) {
      firstCreatedFile=file;
      firstCreatedTime=date;
    }
  }
  return firstCreatedFile;
}
Program: 151778
Project: 151778
Buggy source:
/** 
 * Checks if this server runs bukkit. Determined by existence of "bukkit.yml".
 * @return 
 */
public boolean isBukkitServer(){
  return new File("String_Node_Str").exists();
}

Fixed version (ground truth):
/** 
 * Checks if this server runs bukkit. Determined by existence of "bukkit.yml".
 */
public boolean isBukkitServer(){
  return new File("String_Node_Str").exists();
}
Program: 151779
Project: 151779
Buggy source:
/** 
 * Returns the main "world" directory, containing "level.dat", "players" etc.
 * @return 
 */
public File getWorldDirectory(){
  File file=new File(options.get("String_Node_Str"));
  if (isBukkitServer()) {
    return new File(file,options.get("String_Node_Str"));
  }
  return file;
}

Fixed version (ground truth):
/** 
 * Returns the main "world" directory, containing "level.dat", "players" etc.
 */
public File getWorldDirectory(){
  File file=new File(options.get("String_Node_Str"));
  if (isBukkitServer()) {
    return new File(file,options.get("String_Node_Str"));
  }
  return file;
}
Program: 151780
Project: 151780
Buggy source:
/** 
 * Returns the minecraft world dat-file.
 * @return 
 */
public File getWorldFile(){
  return new File(getWorldDirectory(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Returns the minecraft world dat-file.
 */
public File getWorldFile(){
  return new File(getWorldDirectory(),"String_Node_Str");
}
Program: 151781
Project: 151781
Buggy source:
/** 
 * Returns the dat-file of player 'name'.
 * @param name
 * @return 
 */
public File getPlayerFile(String name){
  return new File(new File(getWorldDirectory(),"String_Node_Str"),name + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Returns the dat-file of player 'name'.
 */
public File getPlayerFile(String name){
  return new File(new File(getWorldDirectory(),"String_Node_Str"),name + "String_Node_Str");
}
Program: 151782
Project: 151782
Buggy source:
/** 
 * Rollback to backup with tag 'tag'.
 * @param tag
 */
public void rollback(String tag) throws Exception {
  autoBackup.rollback(tag);
}

Fixed version (ground truth):
/** 
 * Rollback to backup with tag 'tag'.
 */
public void rollback(RollbackCommand.ExecCom com,String tag) throws Exception {
  autoBackup.rollback(com,tag);
}
Program: 151783
Project: 151783
Buggy source:
@Override public void sendMsg(String m){
  feedback.send(m);
}

Fixed version (ground truth):
public void sendMsg(String msg);
Program: 151784
Project: 151784
Buggy source:
private void execute(BackupCommand.Com com){
  String[] args=extractArguments(com.getMessage());
  if (args.length != 1) {
    com.sendMsg("String_Node_Str");
    return;
  }
  if (args[0].charAt(0) == '@') {
    try {
      com.getServer().rollback(Integer.parseInt(args[0].substring(1,args[0].length())));
    }
 catch (    NumberFormatException ex) {
      com.sendMsg("String_Node_Str");
    }
catch (    Exception ex) {
      com.sendMsg(ex.getMessage());
    }
  }
 else {
    try {
      com.getServer().rollback(args[0]);
    }
 catch (    Exception ex) {
      com.sendMsg(ex.getMessage());
    }
  }
}

Fixed version (ground truth):
private void execute(final BackupCommand.Com com){
  String[] args=extractArguments(com.getMessage());
  if (args.length != 1 && args.length != 2) {
    com.sendMsg("String_Node_Str");
    return;
  }
  boolean f=false;
  int i=0;
  if (args[i].equals("String_Node_Str")) {
    f=true;
    i++;
  }
  final boolean force=f;
  if (args[i].charAt(0) == '@') {
    try {
      com.getServer().rollback(new ExecCom(){
        @Override public void sendWarningRollbackAborted(        String msg){
          sendMsg(msg + warning);
        }
        @Override public void sendErrorRollbackFail(        String msg){
          sendMsg(error + msg + afterError);
        }
        @Override public void sendMsg(        String msg){
          com.sendMsg(msg);
        }
        @Override public boolean isForce(){
          return force;
        }
      }
,Integer.parseInt(args[i].substring(1,args[i].length())));
    }
 catch (    NumberFormatException ex) {
      com.sendMsg("String_Node_Str");
    }
catch (    Exception ex) {
      com.sendMsg(ex.getMessage());
    }
  }
 else {
    try {
      com.getServer().rollback(new ExecCom(){
        @Override public void sendWarningRollbackAborted(        String msg){
          sendMsg(msg + warning);
        }
        @Override public void sendErrorRollbackFail(        String msg){
          com.sendMsg(error + msg + afterError);
        }
        @Override public void sendMsg(        String msg){
          com.sendMsg(msg);
        }
        @Override public boolean isForce(){
          return force;
        }
      }
,args[i]);
    }
 catch (    Exception ex) {
      com.sendMsg(ex.getMessage());
    }
  }
}
Program: 151785
Project: 151785
Buggy source:
public AutoBackup(Server server){
  this.server=server;
  BACKUP_AUTO_DIRECTORY.mkdirs();
  BACKUP_TAGGED_DIRECTORY.mkdirs();
  RESOURCES_MAP.add(server.getWorldDirectory());
  if (server.isBukkitServer()) {
    RESOURCES_CONFIG.addAll(RESOURCE_DIRS_CONFIG_BUKKIT);
  }
  purgeOldBackups();
  copyBuffer=new byte[8192];
  archiver=new Archiver();
  archiver.start();
  archiver.setName("String_Node_Str");
}

Fixed version (ground truth):
public AutoBackup(Server server){
  this.server=server;
  BACKUP_AUTO_DIRECTORY.mkdirs();
  BACKUP_TAGGED_DIRECTORY.mkdirs();
  RESOURCES_MAP.add(server.getMapDirectory());
  if (server.isBukkitServer()) {
    RESOURCES_CONFIG.addAll(RESOURCE_DIRS_CONFIG_BUKKIT);
  }
  purgeOldBackups();
  copyBuffer=new byte[8192];
  archiver=new Archiver();
  archiver.start();
  archiver.setName("String_Node_Str");
}
Program: 151786
Project: 151786
Buggy source:
/** 
 * Rollback to server status at backup 'rollback'.
 */
private void rollback() throws IOException {
  IO.unzip(rollback,TEMP_DIRECTORY);
  List<File> backup=new ArrayList<File>();
  File backupConfig=new File(TEMP_DIRECTORY,BACKUP_CONFIG_FOLDER);
  for (  File file : RESOURCES_CONFIG) {
    deleteRecursively(file);
    backup.add(new File(backupConfig,file.getName()));
  }
  File backupMap=new File(TEMP_DIRECTORY,BACKUP_MAP_FOLDER);
  for (  File file : RESOURCES_MAP) {
    deleteRecursively(file);
    backup.add(new File(backupMap,file.getName()));
  }
  File dest=new File("String_Node_Str");
  for (  File file : backup) {
    if (file.isDirectory()) {
      FileUtils.copyDirectoryToDirectory(file,dest);
    }
 else {
      FileUtils.copyFileToDirectory(file,dest);
    }
  }
  deleteRecursively(TEMP_DIRECTORY);
}

Fixed version (ground truth):
/** 
 * Rollback to server status at backup 'rollback'.
 */
private void rollback(){
  com.sendMsg("String_Node_Str");
  List<File> backup=new ArrayList<File>();
  File backupConfig=new File(TEMP_DIRECTORY,BACKUP_CONFIG_FOLDER);
  for (  File file : RESOURCES_CONFIG) {
    deleteRecursively(file);
    backup.add(new File(backupConfig,file.getName()));
  }
  File backupMap=new File(TEMP_DIRECTORY,BACKUP_MAP_FOLDER);
  for (  File file : RESOURCES_MAP) {
    deleteRecursively(file);
    backup.add(new File(backupMap,file.getName()));
  }
  File dest=new File("String_Node_Str");
  try {
    for (    File file : backup) {
      if (file.isDirectory()) {
        FileUtils.copyDirectoryToDirectory(file,dest);
      }
 else {
        FileUtils.copyFileToDirectory(file,dest);
      }
    }
  }
 catch (  IOException ex) {
    com.sendErrorRollbackFail(ex.getMessage());
  }
}
Program: 151787
Project: 151787
Buggy source:
private void doRollback(){
  server.manualRestart();
  try {
    rollback();
  }
 catch (  IOException ex) {
    println("String_Node_Str" + ex);
  }
  server.continueRestart();
}

Fixed version (ground truth):
private void doRollback(){
  prepareRollback();
  if (!com.isForce() && !canRollback()) {
    deleteRecursively(TEMP_DIRECTORY);
    return;
  }
  server.manualRestart();
  rollback();
  deleteRecursively(TEMP_DIRECTORY);
  server.continueRestart();
}
Program: 151788
Project: 151788
Buggy source:
/** 
 * Prepare the backup archive.
 * @return
 * @throws IOException 
 */
private File makeTemporaryCopy() throws IOException {
  Date date=new Date();
  File backup=new File(TEMP_DIRECTORY,String.format(NAME_FORMAT,date));
  File backupConfig=new File(backup,BACKUP_CONFIG_FOLDER);
  File backupMap=new File(backup,BACKUP_MAP_FOLDER);
  for (  File file : RESOURCES_CONFIG) {
    copy(file,new File(backupConfig,file.getName()));
  }
  for (  File file : RESOURCES_MAP) {
    copy(file,new File(backupMap,file.getName()));
  }
  PrintWriter out=new PrintWriter(new File(backup,"String_Node_Str"));
  out.println("String_Node_Str" + VERSION);
  out.print("String_Node_Str" + new SimpleDateFormat("String_Node_Str").format(date));
  out.close();
  return backup;
}

Fixed version (ground truth):
/** 
 * Prepare the backup archive.
 * @return
 * @throws IOException 
 */
private File makeTemporaryCopy() throws IOException {
  Date date=new Date();
  File backup=new File(TEMP_DIRECTORY,String.format(NAME_FORMAT,date));
  File backupConfig=new File(backup,BACKUP_CONFIG_FOLDER);
  File backupMap=new File(backup,BACKUP_MAP_FOLDER);
  for (  File file : RESOURCES_CONFIG) {
    copy(file,new File(backupConfig,file.getName()));
  }
  for (  File file : RESOURCES_MAP) {
    copy(file,new File(backupMap,file.getName()));
  }
  PrintWriter out=new PrintWriter(new File(backup,"String_Node_Str"));
  out.println("String_Node_Str" + VERSION);
  out.print("String_Node_Str");
  if (server.isBukkitServer()) {
    out.println("String_Node_Str");
  }
 else {
    out.println("String_Node_Str");
  }
  out.print("String_Node_Str" + new SimpleDateFormat("String_Node_Str").format(date));
  out.close();
  return backup;
}
Program: 151789
Project: 151789
Buggy source:
public boolean loadResources(){
  for (  Resource resource : resources) {
    resource.load();
  }
  if (playerList != null) {
    playerList.updatePlayerGroups();
  }
  if (globalConfig.loadsuccess) {
    config=globalConfig.config;
  }
 else {
    System.out.println("String_Node_Str");
    return false;
  }
  if (!Translations.getInstance().setLanguage(config.properties.get("String_Node_Str"))) {
    options.set("String_Node_Str","String_Node_Str");
    options.save();
  }
  addressFactory.toggle(!config.properties.getBoolean("String_Node_Str"));
  saveResources();
  if (eventhost != null) {
    eventhost.loadEvents();
  }
  return globalConfig.loadsuccess;
}

Fixed version (ground truth):
public boolean loadResources(){
  for (  Resource resource : resources) {
    resource.load();
  }
  if (playerList != null) {
    playerList.updatePlayerGroups();
  }
  if (globalConfig.loadsuccess) {
    config=globalConfig.config;
  }
 else {
    System.out.println("String_Node_Str");
    return false;
  }
  if (!Translations.getInstance().setLanguage(config.properties.get("String_Node_Str"))) {
    options.set("String_Node_Str","String_Node_Str");
    options.save();
  }
  addressFactory.toggle(!config.properties.getBoolean("String_Node_Str"));
  if (eventhost != null) {
    eventhost.loadEvents();
  }
  saveResources();
  return globalConfig.loadsuccess;
}
Program: 151790
Project: 151790
Buggy source:
public void saveResources(){
  for (  Resource resource : resources) {
    resource.save();
  }
}

Fixed version (ground truth):
public void saveResources(){
  if (eventhost != null) {
    eventhost.saveGlobalVars();
  }
  for (  Resource resource : resources) {
    resource.save();
  }
}
Program: 151791
Project: 151791
Buggy source:
public void loadEvents(){
  if (running != null) {
    for (    String k : running.keySet()) {
      running.get(k).stopping=true;
      running.get(k).interrupt();
    }
  }
  npcs=new ConcurrentHashMap<String,NpcBot>();
  running=new HashMap<String,RunningEvent>();
  events=new ConcurrentHashMap<Event,Long>();
  Iterator<Event> it=server.config.events.iterator();
  while (it.hasNext()) {
    Event ev=it.next();
    events.put(ev,(long)0);
  }
}

Fixed version (ground truth):
public void loadEvents(){
  try {
    if (running != null) {
      for (      String k : running.keySet()) {
        running.get(k).stopping=true;
        running.get(k).interrupt();
      }
    }
  }
 catch (  Exception e) {
  }
  npcs=new ConcurrentHashMap<String,NpcBot>();
  running=new HashMap<String,RunningEvent>();
  events=new ConcurrentHashMap<Event,Long>();
  globals=new ConcurrentHashMap<String,String>();
  Iterator<Event> it=server.config.events.iterator();
  while (it.hasNext()) {
    Event ev=it.next();
    events.put(ev,(long)0);
    globals.put(ev.name,ev.value);
  }
}
Program: 151792
Project: 151792
Buggy source:
private void assignVariable(String symbol,String value){
  if (symbol == null || symbol.length() < 2) {
    return;
  }
  if (value == null) {
    value="String_Node_Str";
  }
  char scope=symbol.charAt(0);
  String var=symbol.substring(1);
  if (scope == LOCALSCOPE) {
    vars.put(var,value);
  }
 else   if (scope == PLAYERSCOPE) {
    player.vars.put(var,value);
  }
 else   if (scope == GLOBALSCOPE) {
    eventHost.globalVarLock.lock();
    Event e=eventHost.findEvent(var);
    if (e != null) {
      e.value=value;
    }
    eventHost.globalVarLock.unlock();
  }
 else {
    notifyError("String_Node_Str");
  }
}

Fixed version (ground truth):
private void assignVariable(String symbol,String value){
  if (symbol == null || symbol.length() < 2) {
    return;
  }
  if (value == null) {
    value="String_Node_Str";
  }
  char scope=symbol.charAt(0);
  String var=symbol.substring(1);
  if (scope == LOCALSCOPE) {
    vars.put(var,value);
  }
 else   if (scope == PLAYERSCOPE) {
    player.vars.put(var,value);
  }
 else   if (scope == GLOBALSCOPE) {
    if (eventHost.globals.containsKey(var)) {
      eventHost.globals.put(var,value);
    }
 else {
      notifyError("String_Node_Str" + var + "String_Node_Str");
    }
  }
 else {
    notifyError("String_Node_Str");
  }
}
Program: 151794
Project: 151794
Buggy source:
private static File getBackup(boolean old){
  BACKUP_AUTO_DIRECTORY.mkdir();
  File[] files=BACKUP_AUTO_DIRECTORY.listFiles(new FileFilter(){
    public boolean accept(    File file){
      return file.isFile() && file.getPath().contains("String_Node_Str");
    }
  }
);
  long firstCreatedTime=old ? Long.MAX_VALUE : 0;
  File firstCreatedFile=null;
  for (  File file : files) {
    long date;
    try {
      date=date(file);
    }
 catch (    ParseException e) {
      continue;
    }
    if ((old && date < firstCreatedTime) || (!old && date > firstCreatedTime)) {
      firstCreatedFile=file;
      firstCreatedTime=date;
    }
  }
  return firstCreatedFile;
}

Fixed version (ground truth):
private static File getBackup(boolean old){
  BACKUP_AUTO_DIRECTORY.mkdirs();
  BACKUP_TAGGED_DIRECTORY.mkdirs();
  File[] files=BACKUP_AUTO_DIRECTORY.listFiles(new FileFilter(){
    public boolean accept(    File file){
      return file.isFile() && file.getPath().contains("String_Node_Str");
    }
  }
);
  long firstCreatedTime=old ? Long.MAX_VALUE : 0;
  File firstCreatedFile=null;
  for (  File file : files) {
    long date;
    try {
      date=date(file);
    }
 catch (    ParseException e) {
      continue;
    }
    if ((old && date < firstCreatedTime) || (!old && date > firstCreatedTime)) {
      firstCreatedFile=file;
      firstCreatedTime=date;
    }
  }
  return firstCreatedFile;
}
Program: 151795
Project: 151795
Buggy source:
private void backup() throws IOException {
  if (server.config.properties.getBoolean("String_Node_Str")) {
    System.out.println("String_Node_Str");
  }
  announce(t("String_Node_Str"));
  server.runCommand("String_Node_Str",null);
  File copy;
  try {
    copy=makeTemporaryCopy();
    server.runCommand("String_Node_Str",null);
    zipBackup(copy);
  }
  finally {
    deleteRecursively(TEMP_DIRECTORY);
  }
  purgeOldBackups();
  announce(t("String_Node_Str"));
}

Fixed version (ground truth):
private void backup() throws IOException {
  if (server.config.properties.getBoolean("String_Node_Str")) {
    System.out.println("String_Node_Str");
  }
  announce(t("String_Node_Str"));
  File copy;
  try {
    copy=makeTemporaryCopy();
    server.runCommand("String_Node_Str",null);
    zipBackup(copy);
  }
  finally {
    deleteRecursively(TEMP_DIRECTORY);
  }
  purgeOldBackups();
  announce(t("String_Node_Str"));
}
Program: 151796
Project: 151796
Buggy source:
@Override public void run(){
  while (run) {
    if (needsBackup()) {
      try {
        server.saveLock.acquire();
      }
 catch (      InterruptedException e) {
        continue;
      }
      forceBackup=false;
      server.autoSpaceCheck.check(true);
      if (server.config.properties.getBoolean("String_Node_Str")) {
        server.runCommand("String_Node_Str",t("String_Node_Str"));
      }
      server.setSaving(true);
      server.runCommand("String_Node_Str",null);
      while (server.isSaving()) {
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
      }
      try {
        backup();
      }
 catch (      IOException e) {
        server.errorLog(e,"String_Node_Str");
        System.out.println("String_Node_Str" + e);
        System.out.println("String_Node_Str");
      }
      server.saveLock.release();
      if (server.numPlayers() == 0) {
        pauseBackup=true;
      }
    }
    if (pauseBackup && server.numPlayers() > 0) {
      pauseBackup=false;
    }
    try {
      Thread.sleep(60000);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (run) {
    if (needsBackup()) {
      try {
        server.saveLock.acquire();
      }
 catch (      InterruptedException e) {
        continue;
      }
      forceBackup=false;
      if (server.config.properties.getBoolean("String_Node_Str")) {
        server.runCommand("String_Node_Str",t("String_Node_Str"));
      }
      server.setSaving(true);
      server.runCommand("String_Node_Str",null);
      while (server.isSaving()) {
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
      }
      server.runCommand("String_Node_Str",null);
      server.autoSpaceCheck.check(true);
      try {
        backup();
      }
 catch (      IOException e) {
        server.errorLog(e,"String_Node_Str");
        System.out.println("String_Node_Str" + e);
        System.out.println("String_Node_Str");
      }
      server.saveLock.release();
      if (server.numPlayers() == 0) {
        pauseBackup=true;
      }
    }
    if (pauseBackup && server.numPlayers() > 0) {
      pauseBackup=false;
    }
    try {
      Thread.sleep(60000);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 151800
Project: 151800
Buggy source:
private String evaluateVar(String varname){
  if (varname == null || varname.equals("String_Node_Str"))   return "String_Node_Str";
  if (varname.charAt(0) == REFERENCEOP)   return varname.substring(1);
 else   if (varname.charAt(0) == LOCALSCOPE) {
    String loc=varname.substring(1);
    if (loc.equals("String_Node_Str"))     return player != null ? player.getName() : "String_Node_Str";
 else     if (loc.equals("String_Node_Str"))     return event.name;
 else     if (loc.equals("String_Node_Str"))     return "String_Node_Str" + event.name;
 else     if (loc.equals("String_Node_Str"))     return event.value;
 else     if (loc.equals("String_Node_Str"))     return String.valueOf(event.coordinate);
 else     if (loc.equals("String_Node_Str"))     return String.valueOf(System.currentTimeMillis());
 else     if (loc.equals("String_Node_Str"))     return threadstack.size() == 0 ? "String_Node_Str" : threadstack.remove(0);
 else     if (server.eventhost.colors.containsKey(loc))     return "String_Node_Str" + server.eventhost.colors.get(loc);
 else     return String.valueOf(vars.get(loc));
  }
 else   if (varname.charAt(0) == PLAYERSCOPE) {
    return String.valueOf(player.vars.get(varname.substring(1)));
  }
 else   if (varname.charAt(0) == GLOBALSCOPE) {
    Event ev=server.eventhost.findEvent(varname.substring(1));
    if (ev == null) {
      notifyError("String_Node_Str");
      return "String_Node_Str";
    }
 else     return String.valueOf(ev.value);
  }
  return null;
}

Fixed version (ground truth):
private String evaluateVar(String varname){
  if (varname == null || varname.equals("String_Node_Str"))   return "String_Node_Str";
  if (varname.charAt(0) == REFERENCEOP)   return varname.substring(1);
 else   if (varname.charAt(0) == LOCALSCOPE) {
    String loc=varname.substring(1);
    if (loc.equals("String_Node_Str"))     return player != null ? player.getName() : "String_Node_Str";
 else     if (loc.equals("String_Node_Str"))     return event.name;
 else     if (loc.equals("String_Node_Str"))     return "String_Node_Str" + event.name;
 else     if (loc.equals("String_Node_Str"))     return event.value;
 else     if (loc.equals("String_Node_Str"))     return String.valueOf(event.coordinate);
 else     if (loc.equals("String_Node_Str"))     return String.valueOf(System.currentTimeMillis());
 else     if (loc.equals("String_Node_Str"))     return threadstack.size() == 0 ? "String_Node_Str" : threadstack.remove(0);
 else     if (loc.equals("String_Node_Str"))     return threadstack.size() == 0 ? "String_Node_Str" : threadstack.get(0);
 else     if (server.eventhost.colors.containsKey(loc))     return "String_Node_Str" + server.eventhost.colors.get(loc);
 else     return String.valueOf(vars.get(loc));
  }
 else   if (varname.charAt(0) == PLAYERSCOPE) {
    return String.valueOf(player.vars.get(varname.substring(1)));
  }
 else   if (varname.charAt(0) == GLOBALSCOPE) {
    Event ev=server.eventhost.findEvent(varname.substring(1));
    if (ev == null) {
      notifyError("String_Node_Str");
      return "String_Node_Str";
    }
 else     return String.valueOf(ev.value);
  }
  return null;
}
Program: 151801
Project: 151801
Buggy source:
@Override void saveAttributes(AttributeList attributes){
  attributes.addAttribute(NAME,name);
  if (coordinate != null)   attributes.addAttribute(COORDINATE,coordinate.toString());
  if (interval != 0)   attributes.addAttribute(INTERVAL,interval);
  if (script != null && !script.equals("String_Node_Str"))   attributes.setValue("String_Node_Str",script);
  if (allow != null)   attributes.addAttribute(ALLOW,allow);
  if (disabled)   attributes.addAttribute(DISABLED,"String_Node_Str");
  if (isbutton)   attributes.addAttribute(ISBUTTON,"String_Node_Str");
  if (!value.equals("String_Node_Str"))   attributes.addAttribute(VALUE,value);
  if (coordinate.dimension() != Coordinate.Dimension.get("String_Node_Str"))   attributes.addAttribute(DIMENSION,coordinate.dimension().toString());
}

Fixed version (ground truth):
@Override void saveAttributes(AttributeList attributes){
  attributes.addAttribute(NAME,name);
  if (interval != 0)   attributes.addAttribute(INTERVAL,interval);
  if (script != null && !script.equals("String_Node_Str"))   attributes.setValue("String_Node_Str",script);
  if (allow != null)   attributes.addAttribute(ALLOW,allow);
  if (disabled)   attributes.addAttribute(DISABLED,"String_Node_Str");
  if (isbutton)   attributes.addAttribute(ISBUTTON,"String_Node_Str");
  if (coordinate != null)   attributes.addAttribute(COORDINATE,coordinate.toString());
  if (coordinate != null && coordinate.dimension() != Coordinate.Dimension.get("String_Node_Str"))   attributes.addAttribute(DIMENSION,coordinate.dimension().toString());
  if (!value.equals("String_Node_Str"))   attributes.addAttribute(VALUE,value);
}
Program: 151802
Project: 151802
Buggy source:
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals("String_Node_Str")) {
    allow=new Permission(value);
  }
 else   if (name.equals("String_Node_Str")) {
    argument=value;
  }
}

Fixed version (ground truth):
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals("String_Node_Str")) {
    allow=new Permission(value);
  }
 else   if (name.equals("String_Node_Str")) {
    content(value);
  }
}
Program: 151803
Project: 151803
Buggy source:
@Override protected void executeWithTarget(Server server,String message,String target,CommandFeedback feedback){
  mute(server,name);
  server.adminLog("String_Node_Str" + name);
  feedback.send("String_Node_Str",target);
}

Fixed version (ground truth):
@Override protected void executeWithTarget(Server server,String message,String target,CommandFeedback feedback){
  unmute(server,target);
  server.adminLog("String_Node_Str" + target);
  feedback.send("String_Node_Str",target);
}
Program: 151805
Project: 151805
Buggy source:
private void respawn() throws IOException {
  writeLock.lock();
  out.writeByte(9);
  out.writeByte(position.dimension.index());
  out.writeByte(0);
  out.writeShort(128);
  out.writeLong(0);
  writeLock.unlock();
}

Fixed version (ground truth):
private void respawn() throws IOException {
  writeLock.lock();
  out.writeByte(9);
  out.writeByte(position.dimension.index());
  out.writeByte(0);
  out.writeShort(128);
  out.writeLong(0);
  write(readUTF16());
  writeLock.unlock();
}
Program: 151807
Project: 151807
Buggy source:
protected void login() throws IOException {
  writeLock.lock();
  out.writeByte(1);
  out.writeInt(VERSION);
  write(name);
  out.writeLong(0);
  out.writeInt(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  writeLock.unlock();
}

Fixed version (ground truth):
protected void login() throws IOException {
  writeLock.lock();
  out.writeByte(1);
  out.writeInt(VERSION);
  write(name);
  out.writeLong(0);
  write(readUTF16());
  out.writeInt(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  writeLock.unlock();
}
Program: 151808
Project: 151808
Buggy source:
@Override public void save(){
  load();
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str","String_Node_Str");
  super.save();
}

Fixed version (ground truth):
@Override public void save(){
  load();
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str","String_Node_Str");
  super.save();
}
Program: 151810
Project: 151810
Buggy source:
public void execute(Player player,String message){
  String name=extractArgument(message);
  if (name == null) {
    if (player.isAttemptLock()) {
      player.setAttemptedAction(null);
      player.addTMessage(Color.GRAY,"String_Node_Str");
      return;
    }
  }
  if (name != null && name.equals("String_Node_Str")) {
    Map<String,Integer> list=player.getServer().data.chests.chestList(player);
    if (list.size() == 0) {
      player.addTMessage(Color.GRAY,"String_Node_Str");
    }
 else {
      player.addTMessage(Color.GRAY,"String_Node_Str");
      for (      String current : list.keySet()) {
        player.addMessage(Color.GRAY,list.get(current) + "String_Node_Str" + current);
      }
    }
  }
 else {
    player.addTMessage(Color.GRAY,"String_Node_Str");
    player.setAttemptedAction(Action.Lock);
    player.setChestName(name);
  }
}

Fixed version (ground truth):
public void execute(Player player,String message){
  String name=extractArgument(message);
  if (name == null) {
    if (player.isAttemptLock()) {
      player.setAttemptedAction(null);
      player.addTMessage(Color.GRAY,"String_Node_Str");
      return;
    }
  }
  if (name != null && name.equals("String_Node_Str")) {
    Map<String,Integer> list=player.getServer().data.chests.chestList(player);
    if (list.size() == 0) {
      player.addTMessage(Color.GRAY,"String_Node_Str");
    }
 else {
      player.addTMessage(Color.GRAY,"String_Node_Str");
      for (      String current : list.keySet()) {
        player.addMessage(Color.GRAY,list.get(current) + "String_Node_Str" + current);
      }
    }
  }
 else {
    if (name != null && name.length() > 16) {
      player.addTMessage(Color.RED,"String_Node_Str");
      return;
    }
    player.addTMessage(Color.GRAY,"String_Node_Str");
    player.setAttemptedAction(Action.Lock);
    player.setChestName(name);
  }
}
Program: 151812
Project: 151812
Buggy source:
public void add(Area area){
  topAreas.add(area);
  areas.add(area);
}

Fixed version (ground truth):
public void add(Area area){
  topAreas.add(area);
}
Program: 151813
Project: 151813
Buggy source:
public Area(String name,Coordinate start,Coordinate end){
  this();
  this.name=name;
  this.start=start;
  this.end=end;
  position=Integer.MAX_VALUE;
  level=0;
  init();
  finish();
}

Fixed version (ground truth):
public Area(String name,Coordinate start,Coordinate end){
  this();
  this.name=name;
  this.start=start;
  this.end=end;
  position=Integer.MAX_VALUE;
  level=0;
  init();
  super.finish();
}
Program: 151815
Project: 151815
Buggy source:
public boolean setName(String name){
  renameName=server.data.players.getRenameName(name);
  name=name.trim();
  if (name.length() == 0 || this.name != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (name == "String_Node_Str") {
    kick(t("String_Node_Str"));
    return false;
  }
  if (!guest && server.options.getBoolean("String_Node_Str") && !server.whitelist.isWhitelisted(name)) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (server.playerList.findPlayerExact(name) != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  this.name=name;
  updateGroup();
  watchdog.setName("String_Node_Str" + name);
  server.connectionLog("String_Node_Str",extsocket,name);
  if (server.numPlayers() == 0) {
    server.time.set();
  }
  server.playerList.addPlayer(this);
  return true;
}

Fixed version (ground truth):
public boolean setName(String name){
  renameName=server.data.players.getRenameName(name);
  name=name.trim();
  if (name.length() == 0 || this.name != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (name == "String_Node_Str") {
    kick(t("String_Node_Str"));
    return false;
  }
  if (!guest && server.options.getBoolean("String_Node_Str") && !server.whitelist.isWhitelisted(name)) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (server.playerList.findPlayerExact(name) != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  this.name=name;
  updateGroup();
  addMessage(Integer.toString(group));
  watchdog.setName("String_Node_Str" + name);
  server.connectionLog("String_Node_Str",extsocket,name);
  if (server.numPlayers() == 0) {
    server.time.set();
  }
  server.playerList.addPlayer(this);
  return true;
}
Program: 151816
Project: 151816
Buggy source:
public void execute(Player player,String message){
  List<Area> areas=player.getServer().config.dimensions.areas(player.position());
  StringBuilder str=new StringBuilder();
  for (  Area area : areas) {
    str.append(area.name);
    str.append("String_Node_Str");
  }
  if (!areas.isEmpty()) {
    str.delete(0,str.length() - 2);
  }
  player.addTMessage(Color.GRAY,"String_Node_Str",Color.WHITE,str.toString());
}

Fixed version (ground truth):
public void execute(Player player,String message){
  List<Area> areas=player.getServer().config.dimensions.areas(player.position());
  StringBuilder str=new StringBuilder();
  for (  Area area : areas) {
    str.append(area.name);
    str.append("String_Node_Str");
  }
  if (!areas.isEmpty()) {
    str.delete(str.length() - 2,str.length() - 1);
  }
  player.addTMessage(Color.GRAY,"String_Node_Str",Color.WHITE,str.toString());
}
Program: 151818
Project: 151818
Buggy source:
private boolean areaSizeOk(Player player){
  return (Math.abs(player.areastart.x() - player.areaend.x()) <= 50) && (Math.abs(player.areastart.y() - player.areaend.y()) <= 50) && player.areaend.dimension() == player.areastart.dimension();
}

Fixed version (ground truth):
private boolean areaSizeOk(Player player){
  return (Math.abs(player.areastart.x() - player.areaend.x()) < 50) && (Math.abs(player.areastart.z() - player.areaend.z()) < 50) && player.areaend.dimension() == player.areastart.dimension();
}
Program: 151820
Project: 151820
Buggy source:
protected AbstractConfig(String filename){
  this.filename=filename;
}

Fixed version (ground truth):
protected AbstractConfig(String filename){
  this.filename=filename;
  loadHeader();
}
Program: 151821
Project: 151821
Buggy source:
public Area(String name,Coordinate start,Coordinate end){
  this();
  this.name=name;
  this.start=start;
  this.end=end;
  position=Integer.MAX_VALUE;
  level=0;
}

Fixed version (ground truth):
public Area(String name,Coordinate start,Coordinate end){
  this();
  this.name=name;
  this.start=start;
  this.end=end;
  position=Integer.MAX_VALUE;
  level=0;
  init();
}
Program: 151822
Project: 151822
Buggy source:
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals(NAME)) {
    this.name=value;
  }
 else   if (name.equals(START)) {
    start=getCoord(value,0);
  }
 else   if (name.equals(END)) {
    end=getCoord(value,128);
  }
 else   if (name.equals(OWNER)) {
    owner=value;
  }
 else   if (name.equals(PRIORITY)) {
    priority=getInt(value);
  }
}

Fixed version (ground truth):
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals(NAME)) {
    this.name=value;
  }
 else   if (name.equals(START)) {
    start=getCoord(value,0);
  }
 else   if (name.equals(END)) {
    end=getCoord(value,127);
  }
 else   if (name.equals(OWNER)) {
    owner=value;
  }
 else   if (name.equals(PRIORITY)) {
    priority=getInt(value);
  }
}
Program: 151823
Project: 151823
Buggy source:
Permission permission(String args){
  for (  Argument arg : arguments) {
    if (args.startsWith(arg.argument)) {
      return arg.allow;
    }
  }
  return null;
}

Fixed version (ground truth):
Permission permission(String args){
  if (arguments == null) {
    return null;
  }
  for (  Argument arg : arguments) {
    if (args.startsWith(arg.argument)) {
      return arg.allow;
    }
  }
  return null;
}
Program: 151824
Project: 151824
Buggy source:
public CommandConfig getTopConfig(String name){
  if (commands.containsKey(name)) {
    return commands.get(name);
  }
  for (  CommandConfig command : commands.values()) {
    if (command.aliases.contains(name)) {
      return command;
    }
  }
  return null;
}

Fixed version (ground truth):
public CommandConfig getTopConfig(String name){
  if (commands.containsKey(name)) {
    return commands.get(name);
  }
  for (  CommandConfig command : commands.values()) {
    if (command.alias(name)) {
      return command;
    }
  }
  return null;
}
Program: 151825
Project: 151825
Buggy source:
public Iterator<CommandConfig> iterator(){
  return commands.values().iterator();
}

Fixed version (ground truth):
@Override public Iterator<CommandConfig> iterator(){
  return commands.values().iterator();
}