nus-yam/ex-repair huggingface dataset:
Program: 45032
Project: 45032
Buggy source:
@Override public void onEnable(){
  pm=this.getServer().getPluginManager();
  pdfFile=this.getDescription();
  name=pdfFile.getName();
  version=pdfFile.getVersion();
  configManager.load();
  pm.registerEvent(Event.Type.CREATURE_SPAWN,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DAMAGE,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DEATH,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_TARGET,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_INTERACT,playerListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_INTERACT_ENTITY,playerListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.WORLD_LOAD,worldListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.WORLD_SAVE,worldListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.CHUNK_LOAD,worldListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.CHUNK_UNLOAD,worldListener,Event.Priority.Normal,this);
  this.getCommand("String_Node_Str").setExecutor(new WolfCommandExecutor(this));
  log(Level.INFO,"String_Node_Str" + version + "String_Node_Str");
  setupPermissions();
  setupDatabase();
}

Fixed version (ground truth):
@Override public void onEnable(){
  currentServer=this.getServer();
  pm=this.getServer().getPluginManager();
  pdfFile=this.getDescription();
  name=pdfFile.getName();
  version=pdfFile.getVersion();
  configManager.load();
  pm.registerEvent(Event.Type.CREATURE_SPAWN,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DAMAGE,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_DEATH,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.ENTITY_TARGET,entityListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_INTERACT,playerListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_INTERACT_ENTITY,playerListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.WORLD_LOAD,worldListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.WORLD_SAVE,worldListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.CHUNK_LOAD,worldListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.CHUNK_UNLOAD,worldListener,Event.Priority.Normal,this);
  this.getCommand("String_Node_Str").setExecutor(new WolfCommandExecutor(this));
  log(Level.INFO,"String_Node_Str" + version + "String_Node_Str");
  setupPermissions();
  setupDatabase();
}
Program: 45033
Project: 45033
Buggy source:
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  if (!event.isCancelled()) {
    Player player=event.getPlayer();
    Entity entity=event.getRightClicked();
    World world=entity.getWorld();
    WorldConfig worldConfig=configManager.getWorldConfig(world);
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (!wolfManager.hasWolf(wolf.getEntityId()) && wolf.isTamed() && wolf.getOwner().equals(player)) {
        wolfManager.addWolf(wolf);
      }
      if (player.getItemInHand().getTypeId() == worldConfig.item) {
        if (plugin.hasPermissions(player,"String_Node_Str")) {
          if (wolf.isTamed() && wolf.getOwner().equals(player)) {
            if (!wolfManager.hasWolf(wolf.getEntityId())) {
              wolfManager.addWolf(wolf);
              player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.YELLOW+ wolfManager.getName(wolf.getEntityId()));
            }
            selectedWolfManager.addSelectedWolf(player.getName(),wolf);
            player.sendMessage(ChatColor.GREEN + "String_Node_Str");
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  if (!event.isCancelled()) {
    Player player=event.getPlayer();
    Entity entity=event.getRightClicked();
    World world=entity.getWorld();
    WorldConfig worldConfig=configManager.getWorldConfig(world);
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (!wolfManager.hasWolf(wolf.getEntityId()) && wolf.isTamed() && wolf.getOwner().equals(player)) {
        wolfManager.addWolf(wolf);
      }
      player.sendMessage("String_Node_Str" + wolf.getEntityId() + "String_Node_Str"+ wolfManager.getWolfTable(wolf.getEntityId()).getId());
      if (player.getItemInHand().getTypeId() == worldConfig.item) {
        if (plugin.hasPermissions(player,"String_Node_Str")) {
          if (wolf.isTamed() && wolf.getOwner().equals(player)) {
            if (!wolfManager.hasWolf(wolf.getEntityId())) {
              wolfManager.addWolf(wolf);
              player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.YELLOW+ wolfManager.getName(wolf.getEntityId()));
            }
            selectedWolfManager.addSelectedWolf(player.getName(),wolf);
            player.sendMessage(ChatColor.GREEN + "String_Node_Str");
          }
        }
      }
    }
  }
}
Program: 45034
Project: 45034
Buggy source:
@Override public void onWorldSave(WorldSaveEvent event){
  wolfInventoryManager.save(event.getWorld());
}

Fixed version (ground truth):
@Override public void onWorldSave(WorldSaveEvent event){
  wolfInventoryManager.save(event.getWorld());
  List<Entity> entities=event.getWorld().getEntities();
  for (  Entity entity : entities) {
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed()) {
        WolfTable wt=wolfManager.getWolfTable(wolf.getEntityId());
        if (wt != null) {
          wt.setLocationX(wolf.getLocation().getBlockX());
          wt.setLocationY(wolf.getLocation().getBlockY());
          wt.setLocationZ(wolf.getLocation().getBlockZ());
          wolfManager.updateWolfTable(wt);
        }
      }
    }
  }
}
Program: 45035
Project: 45035
Buggy source:
@Override public void onChunkUnload(ChunkUnloadEvent event){
  Entity[] entities=event.getChunk().getEntities();
  for (  Entity entity : entities) {
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed()) {
        WolfTable wt=wolfManager.getWolfTable(wolf.getEntityId());
        if (wt != null) {
          wt.setLocationX(wolf.getLocation().getX());
          wt.setLocationY(wolf.getLocation().getY());
          wt.setLocationZ(wolf.getLocation().getZ());
          wolfManager.updateWolfTable(wt);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onChunkUnload(ChunkUnloadEvent event){
  Entity[] entities=event.getChunk().getEntities();
  for (  Entity entity : entities) {
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed()) {
        WolfTable wt=wolfManager.getWolfTable(wolf.getEntityId());
        if (wt != null) {
          wt.setLocationX(wolf.getLocation().getBlockX());
          wt.setLocationY(wolf.getLocation().getBlockY());
          wt.setLocationZ(wolf.getLocation().getBlockZ());
          wolfManager.updateWolfTable(wt);
        }
      }
    }
  }
}
Program: 45036
Project: 45036
Buggy source:
@Override public void onWorldLoad(WorldLoadEvent event){
  wolfInventoryManager.load(event.getWorld());
}

Fixed version (ground truth):
@Override public void onWorldLoad(WorldLoadEvent event){
  wolfInventoryManager.load(event.getWorld());
  List<Entity> entities=event.getWorld().getEntities();
  for (  Entity entity : entities) {
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (wolf.isTamed()) {
        WolfTable wt=wolfManager.getWolfTable(wolf.getLocation());
        if (wt != null) {
          wt.setEntityId(wolf.getEntityId());
          wolfManager.updateWolfTable(wt);
        }
      }
    }
  }
}
Program: 45037
Project: 45037
Buggy source:
/** 
 * Get WolfTable by location
 * @param location
 * @return
 */
public WolfTable getWolfTable(final Location location){
  return plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",location.getX()).eq("String_Node_Str",location.getY()).eq("String_Node_Str",location.getZ()).findUnique();
}

Fixed version (ground truth):
/** 
 * Get WolfTable by location
 * @param location
 * @return
 */
public WolfTable getWolfTable(final Location location){
  return plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",location.getBlockX()).eq("String_Node_Str",location.getBlockY()).eq("String_Node_Str",location.getBlockZ()).findUnique();
}
Program: 45038
Project: 45038
Buggy source:
public void setLocationX(final double locationX){
  this.locationX=locationX;
}

Fixed version (ground truth):
public void setLocationX(final int locationX){
  this.locationX=locationX;
}
Program: 45039
Project: 45039
Buggy source:
public void setLocationZ(final double locationZ){
  this.locationZ=locationZ;
}

Fixed version (ground truth):
public void setLocationZ(final int locationZ){
  this.locationZ=locationZ;
}
Program: 45040
Project: 45040
Buggy source:
public void setLocationY(final double locationY){
  this.locationY=locationY;
}

Fixed version (ground truth):
public void setLocationY(final int locationY){
  this.locationY=locationY;
}
Program: 45041
Project: 45041
Buggy source:
public double getLocationX(){
  return locationX;
}

Fixed version (ground truth):
public int getLocationX(){
  return locationX;
}
Program: 45042
Project: 45042
Buggy source:
public double getLocationZ(){
  return locationZ;
}

Fixed version (ground truth):
public int getLocationZ(){
  return locationZ;
}
Program: 45043
Project: 45043
Buggy source:
public double getLocationY(){
  return locationY;
}

Fixed version (ground truth):
public int getLocationY(){
  return locationY;
}
Program: 45044
Project: 45044
Buggy source:
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  if (!event.isCancelled()) {
    Player player=event.getPlayer();
    Entity entity=event.getRightClicked();
    World world=entity.getWorld();
    WorldConfig worldConfig=configManager.getWorldConfig(world);
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (plugin.hasPermissions(player,"String_Node_Str")) {
        int item=worldConfig.item;
        if (item != 0) {
          if (player.getItemInHand().getTypeId() == item) {
            if (wolf.isTamed()) {
              selectedWolfManager.addSelectedWolf(player.getName(),wolf);
              player.sendMessage(ChatColor.GREEN + "String_Node_Str");
            }
 else {
            }
          }
        }
 else {
          player.sendMessage(ChatColor.RED + "String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteractEntity(PlayerInteractEntityEvent event){
  if (!event.isCancelled()) {
    Player player=event.getPlayer();
    Entity entity=event.getRightClicked();
    World world=entity.getWorld();
    WorldConfig worldConfig=configManager.getWorldConfig(world);
    if (entity instanceof Wolf) {
      Wolf wolf=(Wolf)entity;
      if (plugin.hasPermissions(player,"String_Node_Str")) {
        int item=worldConfig.item;
        if (item != 0) {
          if (player.getItemInHand().getTypeId() == item) {
            if (wolf.isTamed()) {
              if (!wolfManager.hasWolf(wolf.getEntityId())) {
                wolfManager.addWolf(wolf);
                player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.YELLOW+ wolfManager.getName(wolf.getEntityId()));
              }
 else {
                player.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.YELLOW+ wolfManager.getName(wolf.getEntityId())+ ChatColor.GREEN+ "String_Node_Str");
              }
              selectedWolfManager.addSelectedWolf(player.getName(),wolf);
              player.sendMessage(ChatColor.GREEN + "String_Node_Str");
            }
 else {
            }
          }
        }
 else {
          player.sendMessage(ChatColor.RED + "String_Node_Str");
        }
      }
    }
  }
}
Program: 45045
Project: 45045
Buggy source:
/** 
 * Get the wolf's world by name
 * @param name
 * @return
 */
public World getWorld(final String name){
  return getWorld(getEntityId(name));
}

Fixed version (ground truth):
/** 
 * Get the wolf's world by name
 * @param name
 * @return
 */
public World getWorld(final String name){
  return getWorld(getentityId(name));
}
Program: 45046
Project: 45046
Buggy source:
/** 
 * Get wolf name by entityid
 * @param entityid
 * @return String
 */
public String getName(final int entityid){
  WolfTable wolfTable=plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",entityid).findUnique();
  return wolfTable.getName();
}

Fixed version (ground truth):
/** 
 * Get wolf name by entityId
 * @param entityId
 * @return String
 */
public String getName(final int entityId){
  WolfTable wolfTable=plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",entityId).findUnique();
  return wolfTable.getName();
}
Program: 45047
Project: 45047
Buggy source:
/** 
 * Check if wolf exist by name
 * @param name
 * @return
 */
public boolean hasWolf(final String name){
  return hasWolf(getEntityId(name));
}

Fixed version (ground truth):
/** 
 * Check if wolf exist by name
 * @param name
 * @return
 */
public boolean hasWolf(final String name){
  return hasWolf(getentityId(name));
}
Program: 45048
Project: 45048
Buggy source:
/** 
 * Remove a wolf
 * @param name
 */
public void removeWolf(final int entityid){
  WolfTable wolfTable=plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",entityid).findUnique();
  if (wolfTable != null) {
    inventory.remove(entityid);
    plugin.getDatabase().delete(wolfTable);
  }
}

Fixed version (ground truth):
/** 
 * Remove a wolf
 * @param name
 */
public void removeWolf(final int entityId){
  WolfTable wolfTable=plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",entityId).findUnique();
  if (wolfTable != null) {
    inventory.remove(entityId);
    plugin.getDatabase().delete(wolfTable);
  }
}
Program: 45049
Project: 45049
Buggy source:
/** 
 * Get the wolf's owner by name
 * @param name
 * @return
 */
public Player getOwner(final String name){
  return getOwner(getEntityId(name));
}

Fixed version (ground truth):
/** 
 * Get the wolf's owner by name
 * @param name
 * @return
 */
public Player getOwner(final String name){
  return getOwner(getentityId(name));
}
Program: 45050
Project: 45050
Buggy source:
/** 
 * Get wolf by name
 * @param name
 * @return Wolf
 */
public Wolf getWolf(final String name){
  return getWolf(getEntityId(name));
}

Fixed version (ground truth):
/** 
 * Get wolf by name
 * @param name
 * @return Wolf
 */
public Wolf getWolf(final String name){
  return getWolf(getentityId(name));
}
Program: 45051
Project: 45051
Buggy source:
/** 
 * Get a WolfTable
 * @param name
 * @return WolfTable
 */
public WolfTable getWolfTable(final int entityid){
  return plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",entityid).findUnique();
}

Fixed version (ground truth):
/** 
 * Get a WolfTable
 * @param name
 * @return WolfTable
 */
public WolfTable getWolfTable(final int entityId){
  return plugin.getDatabase().find(WolfTable.class).where().eq("String_Node_Str",entityId).findUnique();
}
Program: 45052
Project: 45052
Buggy source:
/** 
 * Get wolf's inventory
 * @param entityid
 * @return
 */
public TileEntityVirtualChest getInventory(final int entityid){
  if (!inventory.containsKey(entityid)) {
    inventory.put(entityid,new TileEntityVirtualChest());
  }
  return inventory.get(entityid);
}

Fixed version (ground truth):
/** 
 * Get wolf's inventory
 * @param entityId
 * @return
 */
public TileEntityVirtualChest getInventory(final int entityId){
  if (!inventory.containsKey(entityId)) {
    inventory.put(entityId,new TileEntityVirtualChest());
  }
  return inventory.get(entityId);
}
Program: 45053
Project: 45053
Buggy source:
public void setEntityId(final int entityid){
  this.entityid=entityid;
}

Fixed version (ground truth):
public void setEntityId(final int entityId){
  this.entityId=entityId;
}
Program: 45054
Project: 45054
Buggy source:
public int getEntityId(){
  return entityid;
}

Fixed version (ground truth):
public int getEntityId(){
  return entityId;
}
Program: 45055
Project: 45055
Buggy source:
public static void start(){
  if (!isConfigured()) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  Event nextEvent;
  while ((nextEvent=eventSourceMultiplexer.getNextEvent()) != null && isEarlierThanEmulationEnd(now())) {
    Time eventTime=nextEvent.getScheduledTime();
    if (eventTime.isEarlierThan(now())) {
      String msg="String_Node_Str" + now() + "String_Node_Str"+ "String_Node_Str"+ eventTime+ "String_Node_Str";
      if (stopOnError) {
        throw new RuntimeException(msg);
      }
 else {
        System.err.println(msg);
      }
    }
    if (isEarlierThanEmulationEnd(eventTime)) {
      if (isLaterThanEmulationStart(eventTime)) {
        now=eventTime;
        nextEvent.process();
        processCount++;
      }
    }
 else {
      now=emulationEnd;
    }
  }
}

Fixed version (ground truth):
public static void start(){
  if (!isConfigured()) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  Event nextEvent;
  while ((nextEvent=eventSourceMultiplexer.getNextEvent()) != null && isEarlierThanEmulationEnd(now())) {
    Time eventTime=nextEvent.getScheduledTime();
    if (eventTime.isEarlierThan(now())) {
      String msg="String_Node_Str" + now() + "String_Node_Str"+ "String_Node_Str"+ eventTime+ "String_Node_Str";
      if (stopOnError) {
        throw new RuntimeException(msg);
      }
 else {
        System.err.println(msg);
      }
    }
 else     if (isEarlierThanEmulationEnd(eventTime)) {
      if (isLaterThanEmulationStart(eventTime)) {
        now=eventTime;
        nextEvent.process();
        processCount++;
      }
    }
 else {
      now=emulationEnd;
    }
  }
}
Program: 45056
Project: 45056
Buggy source:
public static void reset(){
  emulationStart=null;
  emulationEnd=null;
  eventSourceMultiplexer=null;
  now=new Time(0L,Unit.MILLISECONDS);
}

Fixed version (ground truth):
public static void reset(){
  emulationStart=null;
  emulationEnd=null;
  eventSourceMultiplexer=null;
  processCount=0;
  now=new Time(0L,Unit.MILLISECONDS);
}
Program: 45057
Project: 45057
Buggy source:
public static void setup(Time emulationStart,Time emulationEnd,EventSourceMultiplexer eventSource){
  EventScheduler.emulationStart=emulationStart;
  EventScheduler.emulationEnd=emulationEnd;
  EventScheduler.eventSourceMultiplexer=eventSource;
}

Fixed version (ground truth):
public static void setup(Time emulationStart,Time emulationEnd,EventSourceMultiplexer eventSource){
  reset();
  EventScheduler.emulationStart=emulationStart;
  EventScheduler.emulationEnd=emulationEnd;
  EventScheduler.eventSourceMultiplexer=eventSource;
}
Program: 45058
Project: 45058
Buggy source:
private static MultipleEventSource createMultipleEventParser(Set<FileSystemClient> clients,Set<Machine> machines,File tracesDir,EventsGeneratedBySimulationQueue eventsGeneratedBySimulationQueue){
  EventSource[] parsers=new EventSource[machines.size() + clients.size() + 1];
  try {
    int parserCount=0;
    InputStream traceStream;
    for (    Machine machine : machines) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + machine.getId()));
      parsers[parserCount++]=new MachineActivityEventParser(machine,traceStream);
    }
    for (    FileSystemClient client : clients) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + client.getMachine().getId()));
      parsers[parserCount++]=new FileSystemEventParser(client,traceStream);
    }
    parsers[parserCount]=eventsGeneratedBySimulationQueue;
  }
 catch (  FileNotFoundException e) {
    throw new IllegalStateException(e);
  }
  return new MultipleEventSource(parsers);
}

Fixed version (ground truth):
private static MultipleEventSource createMultipleEventParser(Set<FileSystemClient> clients,Set<Machine> machines,File tracesDir,PriorityQueue<Event> eventsGeneratedBySimulationQueue){
  EventSource[] parsers=new EventSource[machines.size() + clients.size()];
  try {
    int parserCount=0;
    InputStream traceStream;
    for (    Machine machine : machines) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + machine.getId()));
      parsers[parserCount++]=new MachineActivityEventParser(machine,traceStream);
    }
    for (    FileSystemClient client : clients) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + client.getMachine().getId()));
      parsers[parserCount++]=new FileSystemEventParser(client,traceStream);
    }
  }
 catch (  FileNotFoundException e) {
    throw new IllegalStateException(e);
  }
  return new MultipleEventSource(parsers,eventsGeneratedBySimulationQueue);
}
Program: 45060
Project: 45060
Buggy source:
private static Set<Machine> createMachines(EventsGeneratedBySimulationQueue aPlaceForEventsGeneratedBySimulation,File tracesDir,long timeBeforeSleep){
  Set<Machine> machines=new HashSet<Machine>();
  List<String> fsTracesFiles=Arrays.asList(tracesDir.list(fsTracesFilter));
  List<String> idlenessTracesFiles=Arrays.asList(tracesDir.list(idlenessTracesFilter));
  for (  String fsTraceFile : fsTracesFiles) {
    String machineName=fsTraceFile.split("String_Node_Str")[1];
    if (idlenessTracesFiles.contains("String_Node_Str" + machineName)) {
      machines.add(new Machine(aPlaceForEventsGeneratedBySimulation,machineName,timeBeforeSleep));
    }
  }
  return machines;
}

Fixed version (ground truth):
private static Set<Machine> createMachines(PriorityQueue<Event> aPlaceForEventsGeneratedBySimulation,File tracesDir,long timeBeforeSleep){
  Set<Machine> machines=new HashSet<Machine>();
  List<String> fsTracesFiles=Arrays.asList(tracesDir.list(fsTracesFilter));
  List<String> idlenessTracesFiles=Arrays.asList(tracesDir.list(idlenessTracesFilter));
  for (  String fsTraceFile : fsTracesFiles) {
    String machineName=fsTraceFile.split("String_Node_Str")[1];
    if (idlenessTracesFiles.contains("String_Node_Str" + machineName)) {
      machines.add(new Machine(aPlaceForEventsGeneratedBySimulation,machineName,timeBeforeSleep));
    }
  }
  return machines;
}
Program: 45061
Project: 45061
Buggy source:
/** 
 * It create all clients.
 * @param aPlaceForEventsGeneratedBySimulation
 * @param herald
 * @param aggregator
 * @param machines2
 * @return
 */
private static Set<FileSystemClient> createClients(EventsGeneratedBySimulationQueue aPlaceForEventsGeneratedBySimulation,Set<Machine> machines,MetadataServer herald){
  Set<FileSystemClient> newClients=new HashSet<FileSystemClient>();
  for (  Machine machine : machines) {
    newClients.add(new FileSystemClient(aPlaceForEventsGeneratedBySimulation,machine,herald));
  }
  return newClients;
}

Fixed version (ground truth):
/** 
 * It create all clients.
 * @param aPlaceForEventsGeneratedBySimulation
 * @param herald
 * @param aggregator
 * @param machines2
 * @return
 */
private static Set<FileSystemClient> createClients(PriorityQueue<Event> aPlaceForEventsGeneratedBySimulation,Set<Machine> machines,MetadataServer herald){
  Set<FileSystemClient> newClients=new HashSet<FileSystemClient>();
  for (  Machine machine : machines) {
    newClients.add(new FileSystemClient(aPlaceForEventsGeneratedBySimulation,machine,herald));
  }
  return newClients;
}
Program: 45062
Project: 45062
Buggy source:
public MultipleEventSource(EventSource[] parsers){
  this.parsers=new PushBackEventParser[parsers.length];
  for (int i=0; i < parsers.length; i++) {
    this.parsers[i]=new PushBackEventParser(parsers[i]);
  }
}

Fixed version (ground truth):
public MultipleEventSource(EventSource[] parsers,PriorityQueue<Event> simulationGeneratedEventsQueue){
  this.parsers=new PushBackEventParser[parsers.length];
  this.simulationGeneratedEventsQueue=simulationGeneratedEventsQueue;
  for (int i=0; i < parsers.length; i++) {
    this.parsers[i]=new PushBackEventParser(parsers[i]);
  }
}
Program: 45063
Project: 45063
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ filePath;
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ filePath;
}
Program: 45064
Project: 45064
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ filePath;
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ filePath;
}
Program: 45065
Project: 45065
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ filePath+ "String_Node_Str"+ length;
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ filePath+ "String_Node_Str"+ length;
}
Program: 45066
Project: 45066
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ filePath;
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ filePath;
}
Program: 45067
Project: 45067
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ filePath;
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ filePath;
}
Program: 45068
Project: 45068
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ filePath+ "String_Node_Str"+ length;
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ filePath+ "String_Node_Str"+ length;
}
Program: 45069
Project: 45069
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ getDuration()+ "String_Node_Str"+ localFSClient;
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ getDuration()+ "String_Node_Str"+ localFSClient;
}
Program: 45070
Project: 45070
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime();
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime();
}
Program: 45071
Project: 45071
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime();
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime();
}
Program: 45072
Project: 45072
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ getDuration();
}

Fixed version (ground truth):
@Override public String toString(){
  return getHandler() + "String_Node_Str" + EVENT_NAME+ "String_Node_Str"+ getScheduledTime()+ "String_Node_Str"+ getDuration();
}
Program: 45073
Project: 45073
Buggy source:
/** 
 * @param scheduler
 */
public EventHandler(EventsGeneratedBySimulationQueue eventsGeneratedBySimulationQueue){
  this.eventsGeneratedBySimulationQueue=eventsGeneratedBySimulationQueue;
}

Fixed version (ground truth):
/** 
 * @param scheduler
 */
public EventHandler(PriorityQueue<Event> eventsGeneratedBySimulationQueue){
  this.eventsGeneratedBySimulationQueue=eventsGeneratedBySimulationQueue;
}
Program: 45074
Project: 45074
Buggy source:
public void send(Event event){
  eventsGeneratedBySimulationQueue.addEvent(event);
}

Fixed version (ground truth):
public void send(Event event){
  eventsGeneratedBySimulationQueue.add(event);
}
Program: 45075
Project: 45075
Buggy source:
/** 
 * @param scheduler
 * @param machine
 * @param metadataServer
 */
public FileSystemClient(EventsGeneratedBySimulationQueue eventsGeneratedBySimulationQueue,Machine machine,MetadataServer metadataServer){
  super(eventsGeneratedBySimulationQueue);
  this.metadataServer=metadataServer;
  this.machine=machine;
  this.id="String_Node_Str" + machine.bindClient(this) + machine;
}

Fixed version (ground truth):
/** 
 * @param scheduler
 * @param machine
 * @param metadataServer
 */
public FileSystemClient(PriorityQueue<Event> eventsGeneratedBySimulationQueue,Machine machine,MetadataServer metadataServer){
  super(eventsGeneratedBySimulationQueue);
  this.metadataServer=metadataServer;
  this.machine=machine;
  this.id="String_Node_Str" + machine.bindClient(this) + machine;
}
Program: 45076
Project: 45076
Buggy source:
/** 
 * @param eventsGeneratedBySimulationQueue
 * @param id
 * @param timeBeforeSleep
 */
public Machine(EventsGeneratedBySimulationQueue eventsGeneratedBySimulationQueue,String id,long timeBeforeSleep){
  super(eventsGeneratedBySimulationQueue);
  this.id=id;
  this.deployedDataServers=new HashSet<DataServer>();
  this.clients=new HashSet<FileSystemClient>();
  this.timeBeforeSleep=new Time(timeBeforeSleep,Unit.SECONDS);
  currentStateName=ShutdownEvent.EVENT_NAME;
  currentStateStartTime=Time.GENESIS;
  supposedCurrentStateEndTime=Time.END_OF_THE_WORLD;
  pendingFSActivityEvents=new ArrayList<FileSystemActivityEvent>();
}

Fixed version (ground truth):
/** 
 * @param eventsGeneratedBySimulationQueue
 * @param id
 * @param timeBeforeSleep
 */
public Machine(PriorityQueue<Event> eventsGeneratedBySimulationQueue,String id,long timeBeforeSleep){
  super(eventsGeneratedBySimulationQueue);
  this.id=id;
  this.deployedDataServers=new HashSet<DataServer>();
  this.clients=new HashSet<FileSystemClient>();
  this.timeBeforeSleep=new Time(timeBeforeSleep,Unit.SECONDS);
  currentStateName=ShutdownEvent.EVENT_NAME;
  currentStateStartTime=Time.GENESIS;
  supposedCurrentStateEndTime=Time.END_OF_THE_WORLD;
  pendingFSActivityEvents=new ArrayList<FileSystemActivityEvent>();
}
Program: 45077
Project: 45077
Buggy source:
/** 
 * @param scheduler
 * @param dataPlacementAlgorithm
 * @param replicationLevel
 * @param timeBeforeDeleteData in seconds
 * @param timeBeforeUpdateReplicas in seconds
 */
public MetadataServer(EventsGeneratedBySimulationQueue eventsGeneratedBySimulationQueue,DataPlacementAlgorithm dataPlacementAlgorithm,int replicationLevel,long timeBeforeDeleteData,long timeBeforeUpdateReplicas){
  super(eventsGeneratedBySimulationQueue);
  if (dataPlacementAlgorithm == null)   throw new IllegalArgumentException();
  if (replicationLevel < 1)   throw new IllegalArgumentException();
  if (timeBeforeDeleteData < 0)   throw new IllegalArgumentException();
  if (timeBeforeUpdateReplicas < 0)   throw new IllegalArgumentException();
  this.dataPlacement=dataPlacementAlgorithm;
  this.files=new HashMap<String,ReplicationGroup>();
  this.openFiles=new HashMap<String,ReplicationGroup>();
  this.toDelete=new HashMap<String,ReplicationGroup>();
  this.replicationLevel=replicationLevel;
  this.timeBeforeDeleteData=new Time(timeBeforeDeleteData,Unit.SECONDS);
  this.timeBeforeUpdateReplicas=new Time(timeBeforeUpdateReplicas,Unit.SECONDS);
}

Fixed version (ground truth):
/** 
 * @param scheduler
 * @param dataPlacementAlgorithm
 * @param replicationLevel
 * @param timeBeforeDeleteData in seconds
 * @param timeBeforeUpdateReplicas in seconds
 */
public MetadataServer(PriorityQueue<Event> eventsGeneratedBySimulationQueue,DataPlacementAlgorithm dataPlacementAlgorithm,int replicationLevel,long timeBeforeDeleteData,long timeBeforeUpdateReplicas){
  super(eventsGeneratedBySimulationQueue);
  if (dataPlacementAlgorithm == null)   throw new IllegalArgumentException();
  if (replicationLevel < 1)   throw new IllegalArgumentException();
  if (timeBeforeDeleteData < 0)   throw new IllegalArgumentException();
  if (timeBeforeUpdateReplicas < 0)   throw new IllegalArgumentException();
  this.dataPlacement=dataPlacementAlgorithm;
  this.files=new HashMap<String,ReplicationGroup>();
  this.openFiles=new HashMap<String,ReplicationGroup>();
  this.toDelete=new HashMap<String,ReplicationGroup>();
  this.replicationLevel=replicationLevel;
  this.timeBeforeDeleteData=new Time(timeBeforeDeleteData,Unit.SECONDS);
  this.timeBeforeUpdateReplicas=new Time(timeBeforeUpdateReplicas,Unit.SECONDS);
}
Program: 45078
Project: 45078
Buggy source:
/** 
 * @param o
 * @return
 */
@Override public int compareTo(Time o){
  double diff=timeMicroSeconds - o.timeMicroSeconds;
  if (diff < 0) {
    return -1;
  }
 else   if (diff > 0) {
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * @param o
 * @return
 */
@Override public int compareTo(Time otherTime){
  long diff=timeMicroSeconds - otherTime.timeMicroSeconds;
  if (diff < 0) {
    return -1;
  }
 else   if (diff > 0) {
    return 1;
  }
  return 0;
}
Program: 45079
Project: 45079
Buggy source:
public void closePath(FileSystemClient client,String filePath,Time now){
  ReplicationGroup replicationGroup=openFiles.remove(filePath);
  Time noTime=new Time(0,Unit.SECONDS);
  boolean hasChanged=!noTime.equals(replicationGroup.getTotalChangesDuration());
  if (replicationGroup != null && hasChanged) {
    Time time=now.plus(timeBeforeUpdateReplicas);
    send(new UpdateReplicationGroup(this,time,replicationGroup.getTotalChangesDuration(),filePath));
  }
}

Fixed version (ground truth):
public void closePath(FileSystemClient client,String filePath,Time now){
  ReplicationGroup replicationGroup=openFiles.remove(filePath);
  if (replicationGroup != null) {
    Time noTime=new Time(0,Unit.SECONDS);
    if (!noTime.equals(replicationGroup.getTotalChangesDuration())) {
      Time time=now.plus(timeBeforeUpdateReplicas);
      send(new UpdateReplicationGroup(this,time,replicationGroup.getTotalChangesDuration(),filePath));
    }
  }
}
Program: 45080
Project: 45080
Buggy source:
private void handleSleep(SleepEvent event){
  Aggregator aggregator=Aggregator.getInstance();
  Time now=event.getScheduledTime();
  Time currentStateActualDuration=now.minus(currentStateStartTime);
  if (currentStateName.equals(ShutdownEvent.EVENT_NAME)) {
    aggregator.aggregateShutdownDuration(getId(),currentStateActualDuration);
  }
 else   if (currentStateName.equals(SleepEvent.EVENT_NAME)) {
    throw new IllegalStateException(String.format("String_Node_Str",getId()));
  }
 else   if (currentStateName.equals(UserActivityEvent.EVENT_NAME)) {
    aggregator.aggregateActiveDuration(getId(),currentStateActualDuration);
  }
 else   if (currentStateName.equals(UserIdlenessEvent.EVENT_NAME)) {
    aggregateIdlenessPeriod(currentStateActualDuration);
  }
  currentStateName=SleepEvent.EVENT_NAME;
  currentStateStartTime=now;
  supposedCurrentStateEndTime=currentStateStartTime.plus(event.getDuration());
}

Fixed version (ground truth):
private void handleSleep(SleepEvent event){
  Aggregator aggregator=Aggregator.getInstance();
  Time now=event.getScheduledTime();
  Time currentStateActualDuration=now.minus(currentStateStartTime);
  if (currentStateName.equals(ShutdownEvent.EVENT_NAME)) {
    aggregator.aggregateShutdownDuration(getId(),currentStateActualDuration);
  }
 else   if (currentStateName.equals(UserActivityEvent.EVENT_NAME)) {
    aggregator.aggregateActiveDuration(getId(),currentStateActualDuration);
  }
 else   if (currentStateName.equals(UserIdlenessEvent.EVENT_NAME)) {
    aggregateIdlenessPeriod(currentStateActualDuration);
  }
  currentStateName=SleepEvent.EVENT_NAME;
  currentStateStartTime=now;
  supposedCurrentStateEndTime=currentStateStartTime.plus(event.getDuration());
}
Program: 45082
Project: 45082
Buggy source:
private Event parseWriteEvent(StringTokenizer tokenizer){
  Time[] timestampAndDuration=parseTime(tokenizer.nextToken());
  String filePath=tokenizer.nextToken();
  long length=Long.parseLong(tokenizer.nextToken());
  return new WriteEvent(client,timestampAndDuration[0],length,timestampAndDuration[2],filePath);
}

Fixed version (ground truth):
private Event parseWriteEvent(StringTokenizer tokenizer){
  Time[] timestampAndDuration=parseTime(tokenizer.nextToken());
  String filePath=tokenizer.nextToken();
  long length=Long.parseLong(tokenizer.nextToken());
  return new WriteEvent(client,timestampAndDuration[0],length,timestampAndDuration[1],filePath);
}
Program: 45083
Project: 45083
Buggy source:
/** 
 * Create Data Servers.
 * @param scheduler
 * @param machines
 * @return
 */
private static Set<DataServer> createDataServers(EventScheduler scheduler,Set<Machine> machines){
  Set<DataServer> dataServers=new HashSet<DataServer>();
  for (  Machine machine : machines) {
    dataServers.add(new DataServer(scheduler,machine));
  }
  return dataServers;
}

Fixed version (ground truth):
/** 
 * Create Data Servers.
 * @param aPlaceForEventsGeneratedBySimulation
 * @param machines
 * @return
 */
private static Set<DataServer> createDataServers(Set<Machine> machines){
  Set<DataServer> dataServers=new HashSet<DataServer>();
  for (  Machine machine : machines) {
    dataServers.add(new DataServer(machine));
  }
  return dataServers;
}
Program: 45084
Project: 45084
Buggy source:
private static MultipleEventSource createMultipleEventParser(Set<FileSystemClient> clients,Set<Machine> machines,File tracesDir){
  EventSource[] parsers=new EventSource[machines.size() + clients.size()];
  try {
    int parserCount=0;
    InputStream traceStream;
    for (    Machine machine : machines) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + machine.getId()));
      parsers[parserCount++]=new MachineActivityEventParser(machine,traceStream);
    }
    for (    FileSystemClient client : clients) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + client.getMachine().getId()));
      parsers[parserCount++]=new FileSystemEventParser(client,traceStream);
    }
  }
 catch (  FileNotFoundException e) {
    throw new IllegalStateException(e);
  }
  return new MultipleEventSource(parsers);
}

Fixed version (ground truth):
private static MultipleEventSource createMultipleEventParser(Set<FileSystemClient> clients,Set<Machine> machines,File tracesDir,EventsGeneratedBySimulationQueue eventsGeneratedBySimulationQueue){
  EventSource[] parsers=new EventSource[machines.size() + clients.size() + 1];
  try {
    int parserCount=0;
    InputStream traceStream;
    for (    Machine machine : machines) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + machine.getId()));
      parsers[parserCount++]=new MachineActivityEventParser(machine,traceStream);
    }
    for (    FileSystemClient client : clients) {
      traceStream=new FileInputStream(new File(tracesDir,"String_Node_Str" + client.getMachine().getId()));
      parsers[parserCount++]=new FileSystemEventParser(client,traceStream);
    }
    parsers[parserCount]=eventsGeneratedBySimulationQueue;
  }
 catch (  FileNotFoundException e) {
    throw new IllegalStateException(e);
  }
  return new MultipleEventSource(parsers);
}
Program: 45086
Project: 45086
Buggy source:
private static Set<Machine> createMachines(EventScheduler scheduler,File tracesDir,long timeBeforeSleep){
  Set<Machine> machines=new HashSet<Machine>();
  List<String> fsTracesFiles=Arrays.asList(tracesDir.list(fsTracesFilter));
  List<String> idlenessTracesFiles=Arrays.asList(tracesDir.list(idlenessTracesFilter));
  for (  String fsTraceFile : fsTracesFiles) {
    String machineName=fsTraceFile.split("String_Node_Str")[1];
    if (idlenessTracesFiles.contains("String_Node_Str" + machineName)) {
      machines.add(new Machine(scheduler,machineName,timeBeforeSleep));
    }
  }
  return machines;
}

Fixed version (ground truth):
private static Set<Machine> createMachines(EventsGeneratedBySimulationQueue aPlaceForEventsGeneratedBySimulation,File tracesDir,long timeBeforeSleep){
  Set<Machine> machines=new HashSet<Machine>();
  List<String> fsTracesFiles=Arrays.asList(tracesDir.list(fsTracesFilter));
  List<String> idlenessTracesFiles=Arrays.asList(tracesDir.list(idlenessTracesFilter));
  for (  String fsTraceFile : fsTracesFiles) {
    String machineName=fsTraceFile.split("String_Node_Str")[1];
    if (idlenessTracesFiles.contains("String_Node_Str" + machineName)) {
      machines.add(new Machine(aPlaceForEventsGeneratedBySimulation,machineName,timeBeforeSleep));
    }
  }
  return machines;
}
Program: 45087
Project: 45087
Buggy source:
/** 
 * It create all clients.
 * @param scheduler
 * @param herald
 * @param aggregator
 * @param machines2
 * @return
 */
private static Set<FileSystemClient> createClients(EventScheduler scheduler,Set<Machine> machines,MetadataServer herald){
  Set<FileSystemClient> newClients=new HashSet<FileSystemClient>();
  for (  Machine machine : machines) {
    newClients.add(new FileSystemClient(scheduler,machine,herald));
  }
  return newClients;
}

Fixed version (ground truth):
/** 
 * It create all clients.
 * @param aPlaceForEventsGeneratedBySimulation
 * @param herald
 * @param aggregator
 * @param machines2
 * @return
 */
private static Set<FileSystemClient> createClients(EventsGeneratedBySimulationQueue aPlaceForEventsGeneratedBySimulation,Set<Machine> machines,MetadataServer herald){
  Set<FileSystemClient> newClients=new HashSet<FileSystemClient>();
  for (  Machine machine : machines) {
    newClients.add(new FileSystemClient(aPlaceForEventsGeneratedBySimulation,machine,herald));
  }
  return newClients;
}
Program: 45088
Project: 45088
Buggy source:
public SleepEvent(Machine aHandler,Time aScheduledTime){
  super(EVENT_NAME,aHandler,aScheduledTime,null);
}

Fixed version (ground truth):
public SleepEvent(Machine aHandler,Time aScheduledTime,Time duration){
  super(EVENT_NAME,aHandler,aScheduledTime,duration);
}
Program: 45089
Project: 45089
Buggy source:
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime();
}

Fixed version (ground truth):
@Override public String toString(){
  return EVENT_NAME + "String_Node_Str" + getScheduledTime()+ "String_Node_Str"+ getDuration();
}
Program: 45090
Project: 45090
Buggy source:
/** 
 * @param aName
 * @param aHandler
 * @param scheduledTime
 */
public Event(String aName,EventHandler aHandler,Time scheduledTime,Time duration){
  myEventId=eventId++;
  name=aName;
  theTargetHandlerId=aHandler.getHandlerId();
  this.scheduledTime=scheduledTime;
  this.duration=duration;
}

Fixed version (ground truth):
public Event(String name,EventHandler handler,Time scheduledTime,Time duration){
  this.name=name;
  this.handler=handler;
  this.scheduledTime=scheduledTime;
  this.duration=duration;
}
Program: 45091
Project: 45091
Buggy source:
/** 
 */
private void schedule(){
  isActive=Boolean.valueOf(true);
  while (!eventsQueue.isEmpty() & isActive.booleanValue() & isEarlierThanEmulationEnd(now())) {
    Event aNextEvent=eventsQueue.peek();
    if (aNextEvent != null) {
      Time anEventTime=aNextEvent.getScheduledTime();
      if (anEventTime.isEarlierThan(now())) {
        throw new RuntimeException("String_Node_Str" + now() + "String_Node_Str"+ "String_Node_Str"+ anEventTime+ "String_Node_Str");
      }
      if (isEarlierThanEmulationEnd(anEventTime)) {
        now=anEventTime;
        processEvent(aNextEvent);
        notifyEventProcessed();
      }
 else {
        now=theEmulationEnd;
      }
    }
  }
  isActive=Boolean.valueOf(false);
}

Fixed version (ground truth):
/** 
 */
private void schedule(){
  isActive=Boolean.valueOf(true);
  while (!eventsQueue.isEmpty() & isActive.booleanValue() & isEarlierThanEmulationEnd(now())) {
    Event aNextEvent=eventsQueue.poll();
    if (aNextEvent != null) {
      Time anEventTime=aNextEvent.getScheduledTime();
      if (anEventTime.isEarlierThan(now())) {
        throw new RuntimeException("String_Node_Str" + now() + "String_Node_Str"+ "String_Node_Str"+ anEventTime+ "String_Node_Str");
      }
      if (isEarlierThanEmulationEnd(anEventTime)) {
        now=anEventTime;
        processEvent(aNextEvent);
        notifyEventProcessed();
      }
 else {
        now=theEmulationEnd;
      }
    }
  }
  isActive=Boolean.valueOf(false);
}
Program: 45093
Project: 45093
Buggy source:
/** 
 * @param aName
 * @param aHandler
 * @param aScheduledTime
 */
public JEEvent(String aName,JEEventHandler aHandler,JETime aScheduledTime){
  myEventId=eventId++;
  name=new String(aName);
  theTargetHandlerId=aHandler.getHandlerId();
  theScheduledTime=aScheduledTime;
  theParameterList=new Vector();
}

Fixed version (ground truth):
/** 
 * @param aName
 * @param aHandler
 * @param aScheduledTime
 */
public JEEvent(String aName,JEEventHandler aHandler,JETime aScheduledTime){
  myEventId=eventId++;
  name=aName;
  theTargetHandlerId=aHandler.getHandlerId();
  theScheduledTime=aScheduledTime;
  theParameterList=new Vector();
}
Program: 45094
Project: 45094
Buggy source:
/** 
 * @param scheduler
 */
public JEEventHandler(JEEventScheduler scheduler){
  if (theUniqueHandlerId != null) {
    theUniqueHandlerId=new Integer(theUniqueHandlerId.intValue() + 1);
  }
 else {
    theUniqueHandlerId=new Integer(1);
  }
  HandlerId=theUniqueHandlerId;
  parameterlist=new LinkedList();
  theUniqueEventScheduler=scheduler;
  theUniqueEventScheduler.register_handler(this);
}

Fixed version (ground truth):
/** 
 * @param scheduler
 */
public JEEventHandler(JEEventScheduler scheduler){
  if (theUniqueHandlerId != null) {
    theUniqueHandlerId=Integer.valueOf(theUniqueHandlerId.intValue() + 1);
  }
 else {
    theUniqueHandlerId=Integer.valueOf(1);
  }
  HandlerId=theUniqueHandlerId;
  parameterlist=new LinkedList();
  theUniqueEventScheduler=scheduler;
  theUniqueEventScheduler.register_handler(this);
}
Program: 45095
Project: 45095
Buggy source:
/** 
 */
private void schedule(){
  isActive=new Boolean(true);
  while (!EventList.isEmpty() & isActive.booleanValue() & isEarlierThanEmulationEnd(now())) {
    JEEvent aNextEvent=peek();
    if (aNextEvent != null) {
      JETime anEventTime=aNextEvent.getTheScheduledTime();
      if (anEventTime.isEarlierThan(now())) {
        throw new RuntimeException("String_Node_Str" + now() + "String_Node_Str"+ "String_Node_Str"+ anEventTime+ "String_Node_Str");
      }
      if (isEarlierThanEmulationEnd(anEventTime)) {
        now=anEventTime;
        processEvent(aNextEvent);
      }
 else {
        now=theEmulationEnd;
      }
    }
  }
  isActive=Boolean.valueOf(false);
}

Fixed version (ground truth):
/** 
 */
private void schedule(){
  isActive=Boolean.valueOf(true);
  while (!EventList.isEmpty() & isActive.booleanValue() & isEarlierThanEmulationEnd(now())) {
    JEEvent aNextEvent=peek();
    if (aNextEvent != null) {
      JETime anEventTime=aNextEvent.getTheScheduledTime();
      if (anEventTime.isEarlierThan(now())) {
        throw new RuntimeException("String_Node_Str" + now() + "String_Node_Str"+ "String_Node_Str"+ anEventTime+ "String_Node_Str");
      }
      if (isEarlierThanEmulationEnd(anEventTime)) {
        now=anEventTime;
        processEvent(aNextEvent);
      }
 else {
        now=theEmulationEnd;
      }
    }
  }
  isActive=Boolean.valueOf(false);
}
Program: 45096
Project: 45096
Buggy source:
/** 
 * @param emulationEnd
 */
public JEEventScheduler(JETime emulationEnd){
  EventList.setSize(10000);
  EventList.clear();
  HandlerList=new Vector<JEEventHandler>();
  HandlerList.setSize(100);
  HandlerList.clear();
  isActive=new Boolean(false);
  theEmulationEnd=emulationEnd;
}

Fixed version (ground truth):
/** 
 * @param emulationEnd
 */
public JEEventScheduler(JETime emulationEnd){
  EventList.setSize(10000);
  EventList.clear();
  HandlerList=new Vector<JEEventHandler>();
  HandlerList.setSize(100);
  HandlerList.clear();
  isActive=Boolean.valueOf(false);
  theEmulationEnd=emulationEnd;
}