nus-yam/ex-repair huggingface dataset:
Program: 349
Project: 349
Buggy source:
@Override public void send(EntityRef entity,Event event,Component component){
  if (Thread.currentThread() != mainThread) {
    pendingEvents.offer(new PendingEvent(entity,event,component));
  }
 else {
    if (RecordAndReplayStatus.getCurrentStatus() == RecordAndReplayStatus.RECORDING) {
      eventCatcher.addEvent(new PendingEvent(entity,event,component));
    }
    SetMultimap<Class<? extends Component>,EventHandlerInfo> handlers=componentSpecificHandlers.get(event.getClass());
    if (handlers != null) {
      List<EventHandlerInfo> eventHandlers=Lists.newArrayList(handlers.get(component.getClass()));
      Collections.sort(eventHandlers,priorityComparator);
      for (      EventHandlerInfo eventHandler : eventHandlers) {
        if (eventHandler.isValidFor(entity)) {
          eventHandler.invoke(entity,event);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void send(EntityRef entity,Event event,Component component){
  if (Thread.currentThread() != mainThread) {
    pendingEvents.offer(new PendingEvent(entity,event,component));
  }
 else {
    if (RecordAndReplayStatus.getCurrentStatus() == RecordAndReplayStatus.RECORDING) {
      eventCatcher.addEvent(new PendingEvent(entity,event,component));
    }
    SetMultimap<Class<? extends Component>,EventHandlerInfo> handlers=componentSpecificHandlers.get(event.getClass());
    if (handlers != null) {
      List<EventHandlerInfo> eventHandlers=Lists.newArrayList(handlers.get(component.getClass()));
      eventHandlers.sort(priorityComparator);
      for (      EventHandlerInfo eventHandler : eventHandlers) {
        if (eventHandler.isValidFor(entity)) {
          eventHandler.invoke(entity,event);
        }
      }
    }
  }
}
Program: 350
Project: 350
Buggy source:
protected void setKey(Input newInput,char newKeyChar){
  this.input=newInput;
  this.keyChar=newKeyChar;
}

Fixed version (ground truth):
void setKey(Input newInput,char newKeyChar){
  this.input=newInput;
  this.keyChar=newKeyChar;
}
Program: 351
Project: 351
Buggy source:
public String getMouseButtonName(){
  return button.getName();
}

Fixed version (ground truth):
private String getMouseButtonName(){
  return button.getName();
}
Program: 352
Project: 352
Buggy source:
@Before public void setup(){
  ContextImpl context=new ContextImpl();
  CoreRegistry.setContext(context);
  ReflectFactory reflectFactory=new ReflectionReflectFactory();
  CopyStrategyLibrary copyStrategies=new CopyStrategyLibrary(reflectFactory);
  TypeSerializationLibrary serializationLibrary=new TypeSerializationLibrary(reflectFactory,copyStrategies);
  EntitySystemLibrary entitySystemLibrary=new EntitySystemLibrary(context,serializationLibrary);
  compLibrary=entitySystemLibrary.getComponentLibrary();
  entityManager=new PojoEntityManager();
  entityManager.setComponentLibrary(entitySystemLibrary.getComponentLibrary());
  entityManager.setPrefabManager(new PojoPrefabManager(context));
  NetworkSystem networkSystem=mock(NetworkSystem.class);
  when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
  eventSystem=new EventSystemImpl(entitySystemLibrary.getEventLibrary(),networkSystem);
  entityManager.setEventSystem(eventSystem);
  entity=entityManager.create();
}

Fixed version (ground truth):
@Before public void setup(){
  ContextImpl context=new ContextImpl();
  CoreRegistry.setContext(context);
  ReflectFactory reflectFactory=new ReflectionReflectFactory();
  CopyStrategyLibrary copyStrategies=new CopyStrategyLibrary(reflectFactory);
  TypeSerializationLibrary serializationLibrary=new TypeSerializationLibrary(reflectFactory,copyStrategies);
  EntitySystemLibrary entitySystemLibrary=new EntitySystemLibrary(context,serializationLibrary);
  compLibrary=entitySystemLibrary.getComponentLibrary();
  entityManager=new PojoEntityManager();
  entityManager.setComponentLibrary(entitySystemLibrary.getComponentLibrary());
  entityManager.setPrefabManager(new PojoPrefabManager(context));
  NetworkSystem networkSystem=mock(NetworkSystem.class);
  when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
  EventCatcher eventCatcher=new EventCatcher();
  eventSystem=new EventSystemImpl(entitySystemLibrary.getEventLibrary(),networkSystem,eventCatcher);
  entityManager.setEventSystem(eventSystem);
  entity=entityManager.create();
}
Program: 355
Project: 355
Buggy source:
public Path getSavePath(String title){
  return getSavesPath().resolve(title.replaceAll("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public Path getSavePath(String title){
  return getSavesPath().resolve(title.replaceAll(REGEX,"String_Node_Str"));
}
Program: 356
Project: 356
Buggy source:
public Path getRecordingPath(String title){
  return getRecordingsPath().resolve(title.replaceAll("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public Path getRecordingPath(String title){
  return getRecordingsPath().resolve(title.replaceAll(REGEX,"String_Node_Str"));
}
Program: 357
Project: 357
Buggy source:
public EventSystemImpl(EventLibrary eventLibrary,NetworkSystem networkSystem){
  this.mainThread=Thread.currentThread();
  this.eventLibrary=eventLibrary;
  this.networkSystem=networkSystem;
  this.eventCatcher=new EventCatcher();
}

Fixed version (ground truth):
public EventSystemImpl(EventLibrary eventLibrary,NetworkSystem networkSystem,EventCatcher eventCatcher){
  this.mainThread=Thread.currentThread();
  this.eventLibrary=eventLibrary;
  this.networkSystem=networkSystem;
  this.eventCatcher=eventCatcher;
  this.eventCatcher.startTimer();
}
Program: 358
Project: 358
Buggy source:
public void setClientEntity(EntityRef entity){
  EntityRefIdMap.add("String_Node_Str",entity.getId());
  this.clientEntity=entity;
  ClientComponent clientComp=entity.getComponent(ClientComponent.class);
  if (clientComp != null) {
    clientComp.local=true;
    entity.saveComponent(clientComp);
  }
}

Fixed version (ground truth):
public void setClientEntity(EntityRef entity){
  EntityIdMap.add("String_Node_Str",entity.getId());
  this.clientEntity=entity;
  ClientComponent clientComp=entity.getComponent(ClientComponent.class);
  if (clientComp != null) {
    clientComp.local=true;
    entity.saveComponent(clientComp);
  }
}
Program: 359
Project: 359
Buggy source:
@Override public void run(){
  if (RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.REPLAY_FINISHED || RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.REPLAYING) {
    if (RecordAndReplayUtils.isShutdownRequested()) {
      RecordAndReplayUtils.setRecordAndReplayStatus(RecordAndReplayStatus.NOT_ACTIVATED);
    }
    return;
  }
  try {
    if (Files.exists(storagePathProvider.getUnmergedChangesPath())) {
      throw new IOException("String_Node_Str");
    }
    saveTransactionHelper.cleanupSaveTransactionDirectory();
    applyDeltaToPrivateEntityManager();
    prepareChunksPlayersAndGlobalStore();
    createSaveTransactionDirectory();
    writePlayerStores();
    writeGlobalStore();
    writeChunkStores();
    saveGameManifest();
    perpareChangesForMerge();
    mergeChanges();
    result=SaveTransactionResult.createSuccessResult();
    logger.info("String_Node_Str");
    if (RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.RECORDING) {
      if (RecordAndReplayUtils.isShutdownRequested()) {
        RecordAndReplaySerializer.serializeRecordAndReplayData();
        RecordAndReplayUtils.setRecordAndReplayStatus(RecordAndReplayStatus.NOT_ACTIVATED);
        RecordAndReplayUtils.reset();
      }
 else {
        String recordingPath=PathManager.getInstance().getRecordingPath(RecordAndReplayUtils.getGameTitle()).toString();
        RecordAndReplaySerializer.serializeRecordedEvents(recordingPath);
      }
    }
  }
 catch (  IOException|RuntimeException t) {
    logger.error("String_Node_Str",t);
    result=SaveTransactionResult.createFailureResult(t);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (isReplay()) {
    return;
  }
  try {
    if (Files.exists(storagePathProvider.getUnmergedChangesPath())) {
      throw new IOException("String_Node_Str");
    }
    saveTransactionHelper.cleanupSaveTransactionDirectory();
    applyDeltaToPrivateEntityManager();
    prepareChunksPlayersAndGlobalStore();
    createSaveTransactionDirectory();
    writePlayerStores();
    writeGlobalStore();
    writeChunkStores();
    saveGameManifest();
    perpareChangesForMerge();
    mergeChanges();
    result=SaveTransactionResult.createSuccessResult();
    logger.info("String_Node_Str");
    saveRecordingData();
  }
 catch (  IOException|RuntimeException t) {
    logger.error("String_Node_Str",t);
    result=SaveTransactionResult.createFailureResult(t);
  }
}
Program: 360
Project: 360
Buggy source:
public TypeHandler<?> getTypeHandlerFromClass(Class c){
  return this.typeHandlers.get(c);
}

Fixed version (ground truth):
public TypeHandler<?> getTypeHandlerFromClass(Class<?> c){
  return this.typeHandlers.get(c);
}
Program: 361
Project: 361
Buggy source:
public EventCatcher(){
  this.startTime=System.currentTimeMillis();
  this.eventCounter=0;
}

Fixed version (ground truth):
public EventCatcher(){
}
Program: 362
Project: 362
Buggy source:
@Override public void process(){
  if (RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.REPLAYING && !this.loadedRecordedEvents) {
    fillRecordedEvents();
    this.loadedRecordedEvents=true;
    logger.info("String_Node_Str");
    startTime=System.currentTimeMillis();
  }
  if (RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.REPLAYING) {
    processRecordedEvents(10);
    if (this.recordedEvents.isEmpty()) {
      if (RecordAndReplayUtils.getFileCount() <= RecordAndReplayUtils.getFileAmount()) {
        String recordingPath=PathManager.getInstance().getRecordingPath(RecordAndReplayUtils.getGameTitle()).toString();
        RecordAndReplaySerializer.deserializeRecordedEvents(recordingPath);
        fillRecordedEvents();
      }
 else {
        RecordAndReplayUtils.reset();
        RecordAndReplayUtils.setRecordAndReplayStatus(RecordAndReplayStatus.REPLAY_FINISHED);
      }
    }
  }
  for (PendingEvent event=pendingEvents.poll(); event != null; event=pendingEvents.poll()) {
    if (event.getComponent() != null) {
      originalSend(event.getEntity(),event.getEvent(),event.getComponent());
    }
 else {
      originalSend(event.getEntity(),event.getEvent());
    }
  }
}

Fixed version (ground truth):
@Override public void process(){
  if (RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.REPLAYING && !this.loadedRecordedEvents) {
    fillRecordedEvents();
    this.loadedRecordedEvents=true;
    logger.info("String_Node_Str");
    startTime=System.currentTimeMillis();
  }
  if (RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.REPLAYING) {
    processRecordedEvents(10);
    if (this.recordedEvents.isEmpty()) {
      if (RecordAndReplayUtils.getFileCount() <= RecordAndReplayUtils.getFileAmount()) {
        String recordingPath=PathManager.getInstance().getRecordingPath(RecordAndReplayUtils.getGameTitle()).toString();
        RecordAndReplaySerializer.deserializeRecordedEvents(recordingPath);
        fillRecordedEvents();
      }
 else {
        RecordAndReplayUtils.reset();
        RecordedEventStore.popEvents();
        RecordAndReplayUtils.setRecordAndReplayStatus(RecordAndReplayStatus.REPLAY_FINISHED);
      }
    }
  }
  for (PendingEvent event=pendingEvents.poll(); event != null; event=pendingEvents.poll()) {
    if (event.getComponent() != null) {
      originalSend(event.getEntity(),event.getEvent(),event.getComponent());
    }
 else {
      originalSend(event.getEntity(),event.getEvent());
    }
  }
}
Program: 364
Project: 364
Buggy source:
@Override public void initialise(){
  setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation());
  final UILabel saveGamePath=find("String_Node_Str",UILabel.class);
  if (saveGamePath != null) {
    Path savePath=PathManager.getInstance().getSavesPath();
    saveGamePath.setText(translationSystem.translate("String_Node_Str") + savePath.toAbsolutePath().toString());
  }
  final UIList<GameInfo> gameList=find("String_Node_Str",UIList.class);
  refreshList(gameList);
  gameList.subscribeSelection((widget,item) -> {
    find("String_Node_Str",UIButton.class).setEnabled(item != null);
    updateDescription(item);
  }
);
  worldGenerator=find("String_Node_Str",UILabel.class);
  moduleNames=find("String_Node_Str",UILabel.class);
  gameList.select(0);
  gameList.subscribe((widget,item) -> loadGame(item));
  WidgetUtil.trySubscribe(this,"String_Node_Str",button -> {
    GameInfo gameInfo=gameList.getSelection();
    if (gameInfo != null) {
      loadGame(gameInfo);
    }
  }
);
  WidgetUtil.trySubscribe(this,"String_Node_Str",button -> {
    RecordAndReplayUtils.setRecordAndReplayStatus(RecordAndReplayStatus.NOT_ACTIVATED);
    triggerBackAnimation();
  }
);
}

Fixed version (ground truth):
@Override public void initialise(){
  setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation());
  final UILabel saveGamePath=find("String_Node_Str",UILabel.class);
  if (saveGamePath != null) {
    Path savePath=PathManager.getInstance().getSavesPath();
    saveGamePath.setText(translationSystem.translate("String_Node_Str") + savePath.toAbsolutePath().toString());
  }
  gameList=find("String_Node_Str",UIList.class);
  refreshGameList();
  gameList.subscribeSelection((widget,item) -> {
    find("String_Node_Str",UIButton.class).setEnabled(item != null);
    updateDescription(item);
  }
);
  worldGenerator=find("String_Node_Str",UILabel.class);
  moduleNames=find("String_Node_Str",UILabel.class);
  gameList.select(0);
  gameList.subscribe((widget,item) -> loadGame(item));
  WidgetUtil.trySubscribe(this,"String_Node_Str",button -> {
    GameInfo gameInfo=gameList.getSelection();
    if (gameInfo != null) {
      loadGame(gameInfo);
    }
  }
);
  WidgetUtil.trySubscribe(this,"String_Node_Str",button -> {
    RecordAndReplayUtils.setRecordAndReplayStatus(RecordAndReplayStatus.NOT_ACTIVATED);
    triggerBackAnimation();
  }
);
}
Program: 365
Project: 365
Buggy source:
/** 
 * Check if the event is selected to be replayed. If they are, they are only processed through replay and sending them normally won't have any effect. Example: Since MouseWheelEvent is selected to replay, during the replay process if the player moves the mouse wheel, the MouseWheelEvents generated won't be processed, but the ones on the recorded events list will.
 * @param event event to be checked
 * @return if the event is selected to replay
 */
private boolean isSelectedToReplayEvent(Event event){
  if (event instanceof PlaySoundEvent || event instanceof BindableButton || event instanceof KeyEvent|| event instanceof BindAxisEvent|| event instanceof CharacterMoveInputEvent|| event instanceof MouseButtonEvent|| event instanceof MouseWheelEvent) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check if the event is selected to be replayed. If they are, they are only processed through replay and sending them normally won't have any effect. Example: Since MouseWheelEvent is selected to replay, during the replay process if the player moves the mouse wheel, the MouseWheelEvents generated won't be processed, but the ones on the recorded events list will.
 * @param event event to be checked
 * @return if the event is selected to replay
 */
private boolean isSelectedToReplayEvent(Event event){
  if (event instanceof PlaySoundEvent || event instanceof BindableButton || event instanceof KeyEvent|| event instanceof BindAxisEvent|| event instanceof CharacterMoveInputEvent|| event instanceof MouseButtonEvent|| event instanceof MouseWheelEvent|| event instanceof MouseAxisEvent) {
    return true;
  }
  return false;
}
Program: 366
Project: 366
Buggy source:
void serializeRecordedEvents(List<RecordedEvent> events,String filePath){
  try {
    JsonWriter writer=new JsonWriter(new FileWriter(filePath));
    writer.beginObject();
    writer.name("String_Node_Str");
    writer.beginArray();
    for (    RecordedEvent event : events) {
      writer.beginObject();
      writer.name("String_Node_Str").value(event.getEntityRefId());
      writer.name("String_Node_Str").value(event.getTimestamp());
      writer.name("String_Node_Str").value(event.getPosition());
      writer.name("String_Node_Str").value(event.getEvent().getClass().toString());
      writer.name("String_Node_Str");
      writer.beginObject();
      writeSpecificEventData(writer,event.getEvent());
      writer.endObject();
      writer.endObject();
    }
    writer.endArray();
    writer.endObject();
    writer.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
void serializeRecordedEvents(List<RecordedEvent> events,String filePath){
  try {
    JsonWriter writer=new JsonWriter(new FileWriter(filePath));
    writer.beginObject();
    writer.name("String_Node_Str");
    writer.beginArray();
    for (    RecordedEvent event : events) {
      writer.beginObject();
      writer.name("String_Node_Str").value(event.getEntityRefId());
      writer.name("String_Node_Str").value(event.getTimestamp());
      writer.name("String_Node_Str").value(event.getPosition());
      writer.name("String_Node_Str").value(event.getEvent().getClass().toString());
      writer.name("String_Node_Str");
      writer.beginObject();
      writeSpecificEventData(writer,event.getEvent());
      writer.endObject();
      writer.endObject();
    }
    writer.endArray();
    writer.endObject();
    writer.close();
  }
 catch (  Exception e) {
    logger.error(e.getMessage());
  }
}
Program: 368
Project: 368
Buggy source:
public void refreshGameList(){
  gameList.setList(GameProvider.getSavedGames());
}

Fixed version (ground truth):
void refreshGameList(){
  gameList.setList(GameProvider.getSavedGames());
  gameList.setSelection(null);
}
Program: 369
Project: 369
Buggy source:
@Override public void disconnect(){
  if (clientEntity.exists()) {
    EntityRef clientInfoEntity=clientEntity.getComponent(ClientComponent.class).clientInfo;
    ClientInfoComponent clientInfoComp=clientInfoEntity.getComponent(ClientInfoComponent.class);
    clientInfoComp.client=EntityRef.NULL;
    clientInfoEntity.saveComponent(clientInfoComp);
    clientEntity.destroy();
  }
}

Fixed version (ground truth):
@Override public void disconnect(){
  EntityRef clientInfoEntity=clientEntity.getComponent(ClientComponent.class).clientInfo;
  ClientInfoComponent clientInfoComp=clientInfoEntity.getComponent(ClientInfoComponent.class);
  clientInfoComp.client=EntityRef.NULL;
  clientInfoEntity.saveComponent(clientInfoComp);
  clientEntity.destroy();
}
Program: 370
Project: 370
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e){
  if (joinStatus.getStatus() == JoinStatus.Status.FAILED) {
    return;
  }
  scheduleTimeout(ctx.getChannel());
  NetData.NetMessage message=(NetData.NetMessage)e.getMessage();
synchronized (joinStatus) {
    timeoutPoint=System.currentTimeMillis() + timeoutThreshold;
    if (message.hasServerInfo()) {
      receivedServerInfo(ctx,message.getServerInfo());
    }
 else     if (message.hasModuleDataHeader()) {
      receiveModuleStart(ctx,message.getModuleDataHeader());
    }
 else     if (message.hasModuleData()) {
      receiveModule(ctx,message.getModuleData());
    }
 else     if (message.hasJoinComplete()) {
      if (missingModules.size() > 0) {
        logger.error("String_Node_Str");
      }
      completeJoin(ctx,message.getJoinComplete());
    }
 else {
      logger.error("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e){
  if (joinStatus.getStatus() == JoinStatus.Status.FAILED) {
    return;
  }
  scheduleTimeout(ctx.getChannel());
  NetData.NetMessage message=(NetData.NetMessage)e.getMessage();
  String errorMessage=message.getServerInfo().getErrorMessage();
  if (errorMessage != null && !errorMessage.isEmpty()) {
synchronized (joinStatus) {
      joinStatus.setErrorMessage(errorMessage);
      ctx.getChannel().close();
      return;
    }
  }
synchronized (joinStatus) {
    timeoutPoint=System.currentTimeMillis() + timeoutThreshold;
    if (message.hasServerInfo()) {
      receivedServerInfo(ctx,message.getServerInfo());
    }
 else     if (message.hasModuleDataHeader()) {
      receiveModuleStart(ctx,message.getModuleDataHeader());
    }
 else     if (message.hasModuleData()) {
      receiveModule(ctx,message.getModuleData());
    }
 else     if (message.hasJoinComplete()) {
      if (missingModules.size() > 0) {
        logger.error("String_Node_Str");
      }
      completeJoin(ctx,message.getJoinComplete());
    }
 else {
      logger.error("String_Node_Str");
    }
  }
}
Program: 371
Project: 371
Buggy source:
private void processNewClient(NetClient client){
  client.connected(entityManager,entitySerializer,eventSerializer,eventLibrary);
  ServerConnectListManager serverConnectListManager=ServerConnectListManager.getInstance();
  if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) {
    errorMessage=serverConnectListManager.getErrorMessage(client.getId());
    client.send(NetData.NetMessage.newBuilder().setServerInfo(getServerInfoMessage()).build());
    forceDisconnect(client);
    System.out.println("String_Node_Str");
    errorMessage=null;
    return;
  }
  client.send(NetData.NetMessage.newBuilder().setJoinComplete(NetData.JoinCompleteMessage.newBuilder().setClientId(client.getEntity().getComponent(NetworkComponent.class).getNetworkId())).build());
  clientList.add(client);
  netClientList.add(client);
  clientPlayerLookup.put(client.getEntity(),client);
  connectClient(client);
  logger.info("String_Node_Str",client.getEntity());
  for (  EntityRef netEntity : entityManager.getEntitiesWith(NetworkComponent.class)) {
    NetworkComponent netComp=netEntity.getComponent(NetworkComponent.class);
    if (netComp.getNetworkId() != NULL_NET_ID) {
switch (netComp.replicateMode) {
case OWNER:
        if (client.equals(getOwner(netEntity))) {
          client.setNetInitial(netComp.getNetworkId());
        }
      break;
default :
    client.setNetInitial(netComp.getNetworkId());
  break;
}
}
}
}

Fixed version (ground truth):
private void processNewClient(NetClient client){
  client.connected(entityManager,entitySerializer,eventSerializer,eventLibrary);
  ServerConnectListManager serverConnectListManager=ServerConnectListManager.getInstance();
  if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) {
    errorMessage=serverConnectListManager.getErrorMessage(client.getId());
    client.send(NetData.NetMessage.newBuilder().setServerInfo(getServerInfoMessage()).build());
    forceDisconnect(client);
    errorMessage=null;
    kicked=false;
    return;
  }
  client.send(NetData.NetMessage.newBuilder().setJoinComplete(NetData.JoinCompleteMessage.newBuilder().setClientId(client.getEntity().getComponent(NetworkComponent.class).getNetworkId())).build());
  clientList.add(client);
  netClientList.add(client);
  clientPlayerLookup.put(client.getEntity(),client);
  connectClient(client);
  logger.info("String_Node_Str",client.getEntity());
  for (  EntityRef netEntity : entityManager.getEntitiesWith(NetworkComponent.class)) {
    NetworkComponent netComp=netEntity.getComponent(NetworkComponent.class);
    if (netComp.getNetworkId() != NULL_NET_ID) {
switch (netComp.replicateMode) {
case OWNER:
        if (client.equals(getOwner(netEntity))) {
          client.setNetInitial(netComp.getNetworkId());
        }
      break;
default :
    client.setNetInitial(netComp.getNetworkId());
  break;
}
}
}
}
Program: 372
Project: 372
Buggy source:
private void processRemovedClient(Client client){
  if (client instanceof NetClient) {
    NetClient netClient=(NetClient)client;
    netClientList.remove(netClient);
  }
  clientList.remove(client);
  clientPlayerLookup.remove(client.getEntity());
  logger.info("String_Node_Str" + client.getName());
  storageManager.deactivatePlayer(client);
  client.getEntity().send(new DisconnectedEvent());
  client.disconnect();
}

Fixed version (ground truth):
private void processRemovedClient(Client client){
  if (client instanceof NetClient) {
    ServerConnectListManager serverConnectListManager=ServerConnectListManager.getInstance();
    if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) {
      return;
    }
    NetClient netClient=(NetClient)client;
    netClientList.remove(netClient);
  }
  clientList.remove(client);
  clientPlayerLookup.remove(client.getEntity());
  logger.info("String_Node_Str" + client.getName());
  storageManager.deactivatePlayer(client);
  client.getEntity().send(new DisconnectedEvent());
  client.disconnect();
}
Program: 373
Project: 373
Buggy source:
@Override public void deactivatePlayer(Client client){
  if (client.getEntity().exists()) {
    EntityRef character=client.getEntity().getComponent(ClientComponent.class).character;
    PlayerStoreBuilder playerStoreBuilder=createPlayerStore(client,character);
    EntityData.PlayerStore playerStore=playerStoreBuilder.build(getEntityManager());
    deactivateOrDestroyEntityRecursive(character);
    unloadedAndUnsavedPlayerMap.put(client.getId(),playerStore);
  }
}

Fixed version (ground truth):
@Override public void deactivatePlayer(Client client){
  EntityRef character=client.getEntity().getComponent(ClientComponent.class).character;
  PlayerStoreBuilder playerStoreBuilder=createPlayerStore(client,character);
  EntityData.PlayerStore playerStore=playerStoreBuilder.build(getEntityManager());
  deactivateOrDestroyEntityRecursive(character);
  unloadedAndUnsavedPlayerMap.put(client.getId(),playerStore);
}
Program: 374
Project: 374
Buggy source:
@Before public void setup() throws Exception {
  super.setup();
  ModuleManager moduleManager=ModuleManagerFactory.create();
  context.put(ModuleManager.class,moduleManager);
  EngineTime mockTime=mock(EngineTime.class);
  networkSystem=new NetworkSystemImpl(mockTime,context);
  networkSystem.setContext(context);
  context.put(NetworkSystem.class,networkSystem);
  EntitySystemSetupUtil.addReflectionBasedLibraries(context);
  EntitySystemSetupUtil.addEntityManagementRelatedClasses(context);
  entityManager=(PojoEntityManager)context.get(EntityManager.class);
  context.put(ComponentSystemManager.class,new ComponentSystemManager(context));
  entityManager.clear();
  client=mock(NetClient.class);
  NetworkComponent clientNetComp=new NetworkComponent();
  clientNetComp.replicateMode=NetworkComponent.ReplicateMode.OWNER;
  clientEntity=entityManager.create(clientNetComp);
  when(client.getEntity()).thenReturn(clientEntity);
  when(client.getId()).thenReturn("String_Node_Str");
  networkSystem.mockHost();
  networkSystem.connectToEntitySystem(entityManager,context.get(EventLibrary.class),mock(BlockEntityRegistry.class));
  networkSystem.registerNetworkEntity(clientEntity);
  context.put(ServerConnectListManager.class,new ServerConnectListManager());
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  super.setup();
  ModuleManager moduleManager=ModuleManagerFactory.create();
  context.put(ModuleManager.class,moduleManager);
  EngineTime mockTime=mock(EngineTime.class);
  networkSystem=new NetworkSystemImpl(mockTime,context);
  networkSystem.setContext(context);
  context.put(NetworkSystem.class,networkSystem);
  EntitySystemSetupUtil.addReflectionBasedLibraries(context);
  EntitySystemSetupUtil.addEntityManagementRelatedClasses(context);
  entityManager=(PojoEntityManager)context.get(EntityManager.class);
  context.put(ComponentSystemManager.class,new ComponentSystemManager(context));
  entityManager.clear();
  client=mock(NetClient.class);
  NetworkComponent clientNetComp=new NetworkComponent();
  clientNetComp.replicateMode=NetworkComponent.ReplicateMode.OWNER;
  clientEntity=entityManager.create(clientNetComp);
  when(client.getEntity()).thenReturn(clientEntity);
  when(client.getId()).thenReturn("String_Node_Str");
  networkSystem.mockHost();
  networkSystem.connectToEntitySystem(entityManager,context.get(EventLibrary.class),mock(BlockEntityRegistry.class));
  networkSystem.registerNetworkEntity(clientEntity);
  context.put(ServerConnectListManager.class,new ServerConnectListManager(context));
}
Program: 375
Project: 375
Buggy source:
@Override public void postInitialise(Context rootContext){
  rootContext.put(ServerConnectListManager.class,new ServerConnectListManager());
}

Fixed version (ground truth):
@Override public void postInitialise(Context rootContext){
  rootContext.put(ServerConnectListManager.class,new ServerConnectListManager(rootContext));
}
Program: 376
Project: 376
Buggy source:
private void processNewClient(NetClient client){
  ServerConnectListManager serverConnectListManager=context.get(ServerConnectListManager.class);
  if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) {
    errorMessage=serverConnectListManager.getErrorMessage(client.getId());
    client.send(NetData.NetMessage.newBuilder().setServerInfo(getServerInfoMessage()).build());
    forceDisconnect(client);
    errorMessage=null;
    kicked=false;
    return;
  }
  client.connected(entityManager,entitySerializer,eventSerializer,eventLibrary);
  client.send(NetData.NetMessage.newBuilder().setJoinComplete(NetData.JoinCompleteMessage.newBuilder().setClientId(client.getEntity().getComponent(NetworkComponent.class).getNetworkId())).build());
  clientList.add(client);
  netClientList.add(client);
  clientPlayerLookup.put(client.getEntity(),client);
  connectClient(client);
  logger.info("String_Node_Str",client.getEntity());
  for (  EntityRef netEntity : entityManager.getEntitiesWith(NetworkComponent.class)) {
    NetworkComponent netComp=netEntity.getComponent(NetworkComponent.class);
    if (netComp.getNetworkId() != NULL_NET_ID) {
switch (netComp.replicateMode) {
case OWNER:
        if (client.equals(getOwner(netEntity))) {
          client.setNetInitial(netComp.getNetworkId());
        }
      break;
default :
    client.setNetInitial(netComp.getNetworkId());
  break;
}
}
}
}

Fixed version (ground truth):
private void processNewClient(NetClient client){
  ServerConnectListManager serverConnectListManager=context.get(ServerConnectListManager.class);
  if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) {
    String errorMessage=serverConnectListManager.getErrorMessage(client.getId());
    client.send(NetData.NetMessage.newBuilder().setServerInfo(getServerInfoMessage(errorMessage)).build());
    forceDisconnect(client);
    kicked=false;
    return;
  }
  client.connected(entityManager,entitySerializer,eventSerializer,eventLibrary);
  client.send(NetData.NetMessage.newBuilder().setJoinComplete(NetData.JoinCompleteMessage.newBuilder().setClientId(client.getEntity().getComponent(NetworkComponent.class).getNetworkId())).build());
  clientList.add(client);
  netClientList.add(client);
  clientPlayerLookup.put(client.getEntity(),client);
  connectClient(client);
  logger.info("String_Node_Str",client.getEntity());
  for (  EntityRef netEntity : entityManager.getEntitiesWith(NetworkComponent.class)) {
    NetworkComponent netComp=netEntity.getComponent(NetworkComponent.class);
    if (netComp.getNetworkId() != NULL_NET_ID) {
switch (netComp.replicateMode) {
case OWNER:
        if (client.equals(getOwner(netEntity))) {
          client.setNetInitial(netComp.getNetworkId());
        }
      break;
default :
    client.setNetInitial(netComp.getNetworkId());
  break;
}
}
}
}
Program: 378
Project: 378
Buggy source:
public ServerConnectListManager(){
  blacklistPath=PathManager.getInstance().getHomePath().resolve("String_Node_Str");
  whitelistPath=PathManager.getInstance().getHomePath().resolve("String_Node_Str");
  loadLists();
}

Fixed version (ground truth):
public ServerConnectListManager(Context context){
  blacklistPath=PathManager.getInstance().getHomePath().resolve("String_Node_Str");
  whitelistPath=PathManager.getInstance().getHomePath().resolve("String_Node_Str");
  this.context=context;
  loadLists();
}
Program: 379
Project: 379
Buggy source:
public void addToBlacklist(String clientID){
  blacklistedIDs.add(clientID);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void addToBlacklist(String clientID){
  blacklistedIDs.add(clientID);
  saveLists();
}
Program: 380
Project: 380
Buggy source:
public void addToWhitelist(String clientID){
  whitelistedIDs.add(clientID);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void addToWhitelist(String clientID){
  whitelistedIDs.add(clientID);
  saveLists();
}
Program: 381
Project: 381
Buggy source:
public void removeFromBlacklist(String clientID){
  blacklistedIDs.remove(clientID);
}

Fixed version (ground truth):
public void removeFromBlacklist(String clientID){
  blacklistedIDs.remove(clientID);
  saveLists();
}
Program: 382
Project: 382
Buggy source:
public void removeFromWhitelist(String clientID){
  whitelistedIDs.remove(clientID);
}

Fixed version (ground truth):
public void removeFromWhitelist(String clientID){
  whitelistedIDs.remove(clientID);
  saveLists();
}
Program: 383
Project: 383
Buggy source:
private void loadLists(){
  try {
    if (!Files.exists(blacklistPath)) {
      Files.createFile(blacklistPath);
    }
    if (!Files.exists(whitelistPath)) {
      Files.createFile(whitelistPath);
    }
    blacklistedIDs=gson.fromJson(Files.newBufferedReader(blacklistPath),Set.class);
    whitelistedIDs=gson.fromJson(Files.newBufferedReader(whitelistPath),Set.class);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void loadLists(){
  try {
    createFiles();
    blacklistedIDs=gson.fromJson(Files.newBufferedReader(blacklistPath),Set.class);
    whitelistedIDs=gson.fromJson(Files.newBufferedReader(whitelistPath),Set.class);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
  }
}
Program: 384
Project: 384
Buggy source:
public String getErrorMessage(String clientID){
  if (isClientBlacklisted(clientID)) {
    return "String_Node_Str";
  }
  if (!isClientWhitelisted(clientID)) {
    return "String_Node_Str";
  }
  return null;
}

Fixed version (ground truth):
public String getErrorMessage(String clientID){
  TranslationSystem translationSystem=context.get(TranslationSystem.class);
  if (isClientBlacklisted(clientID)) {
    return translationSystem.translate("String_Node_Str");
  }
  if (!isClientWhitelisted(clientID)) {
    return translationSystem.translate("String_Node_Str");
  }
  return null;
}
Program: 385
Project: 385
Buggy source:
@ReceiveEvent(components={BlockItemComponent.class}) public void onPlaceBlock(OnBlockItemPlaced event,EntityRef entity){
  BlockComponent blockComponent=event.getPlacedBlock().getComponent(BlockComponent.class);
  if (blockComponent == null)   return;
  Vector3i targetBlock=blockComponent.getPosition();
  processUpdateForBlockLocation(targetBlock);
}

Fixed version (ground truth):
@ReceiveEvent(components={BlockItemComponent.class}) public void onPlaceBlock(OnBlockItemPlaced event,EntityRef entity){
  BlockComponent blockComponent=event.getPlacedBlock().getComponent(BlockComponent.class);
  if (blockComponent == null) {
    return;
  }
  Vector3i targetBlock=blockComponent.getPosition();
  processUpdateForBlockLocation(targetBlock);
}
Program: 386
Project: 386
Buggy source:
/** 
 * Create a family based on the type and instantiate from the the family definition of the block and builder
 * @param blockFamily
 * @param blockFamilyDefinition
 * @param blockBuilderHelper
 * @param shape
 * @return new BlockFamily
 */
public static BlockFamily createFamily(Class<? extends AbstractBlockFamily> blockFamily,BlockFamilyDefinition blockFamilyDefinition,BlockShape shape,BlockBuilderHelper blockBuilderHelper){
  try {
    SimpleClassFactory simpleClassFactory=new SimpleClassFactory(new ParameterProvider(){
      @Override public <T>Optional<T> get(      Class<T> type){
        if (type.isAssignableFrom(BlockBuilderHelper.class)) {
          return Optional.ofNullable((T)blockBuilderHelper);
        }
 else         if (type.isAssignableFrom(BlockFamilyDefinition.class)) {
          return Optional.ofNullable((T)blockFamilyDefinition);
        }
 else         if (type.isAssignableFrom(BlockShape.class)) {
          return Optional.ofNullable((T)shape);
        }
        return Optional.empty();
      }
    }
);
    BlockFamily result=simpleClassFactory.instantiateClass(blockFamily).get();
    InjectionHelper.inject(result);
    if (result.getURI() == null)     throw new Exception("String_Node_Str");
    return result;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",blockFamily,e);
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Create a family based on the type and instantiate from the the family definition of the block and builder
 * @param blockFamily
 * @param blockFamilyDefinition
 * @param blockBuilderHelper
 * @param shape
 * @return new BlockFamily
 */
public static BlockFamily createFamily(Class<? extends AbstractBlockFamily> blockFamily,BlockFamilyDefinition blockFamilyDefinition,BlockShape shape,BlockBuilderHelper blockBuilderHelper){
  try {
    SimpleClassFactory simpleClassFactory=new SimpleClassFactory(new ParameterProvider(){
      @Override public <T>Optional<T> get(      Class<T> type){
        if (type.isAssignableFrom(BlockBuilderHelper.class)) {
          return Optional.ofNullable((T)blockBuilderHelper);
        }
 else         if (type.isAssignableFrom(BlockFamilyDefinition.class)) {
          return Optional.ofNullable((T)blockFamilyDefinition);
        }
 else         if (type.isAssignableFrom(BlockShape.class)) {
          return Optional.ofNullable((T)shape);
        }
        return Optional.empty();
      }
    }
);
    BlockFamily result=simpleClassFactory.instantiateClass(blockFamily).get();
    InjectionHelper.inject(result);
    if (result.getURI() == null)     throw new Exception("String_Node_Str");
    return result;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",blockFamily,e);
  }
  return null;
}
Program: 387
Project: 387
Buggy source:
@Override public Block getBlockFor(BlockUri blockUri){
  if (block == null) {
    if (getURI().equals(blockUri.getFamilyUri())) {
      try {
        Side side=Side.valueOf(blockUri.getIdentifier().toString().toUpperCase(Locale.ENGLISH));
        return blocks.get(side);
      }
 catch (      IllegalArgumentException e) {
        logger.error("String_Node_Str",blockUri,e);
        return null;
      }
    }
  }
  return block;
}

Fixed version (ground truth):
@Override public Block getBlockFor(BlockUri blockUri){
  if (block == null && getURI().equals(blockUri.getFamilyUri())) {
    try {
      Side side=Side.valueOf(blockUri.getIdentifier().toString().toUpperCase(Locale.ENGLISH));
      return blocks.get(side);
    }
 catch (    IllegalArgumentException e) {
      logger.error("String_Node_Str",blockUri,e);
      return null;
    }
  }
  return block;
}
Program: 388
Project: 388
Buggy source:
public BlockFamilyDefinitionFormat(AssetManager assetManager,BlockFamilyRegistry blockFamilyRegistry){
  super("String_Node_Str");
  this.assetManager=assetManager;
  this.blockFamilyRegistry=blockFamilyRegistry;
  gson=new GsonBuilder().registerTypeAdapterFactory(new CaseInsensitiveEnumTypeAdapterFactory()).registerTypeAdapterFactory(new AssetTypeAdapterFactory(assetManager)).registerTypeAdapter(BlockFamilyDefinitionData.class,new BlockFamilyDefinitionDataHandler()).registerTypeAdapter(Vector3f.class,new Vector3fTypeAdapter()).registerTypeAdapter(Vector4f.class,new Vector4fTypeAdapter()).registerTypeAdapter(Class.class,new BlockFamilyHandler(blockFamilyRegistry)).create();
}

Fixed version (ground truth):
public BlockFamilyDefinitionFormat(AssetManager assetManager,BlockFamilyRegistry blockFamilyRegistry){
  super("String_Node_Str");
  this.assetManager=assetManager;
  gson=new GsonBuilder().registerTypeAdapterFactory(new CaseInsensitiveEnumTypeAdapterFactory()).registerTypeAdapterFactory(new AssetTypeAdapterFactory(assetManager)).registerTypeAdapter(BlockFamilyDefinitionData.class,new BlockFamilyDefinitionDataHandler()).registerTypeAdapter(Vector3f.class,new Vector3fTypeAdapter()).registerTypeAdapter(Vector4f.class,new Vector4fTypeAdapter()).registerTypeAdapter(Class.class,new BlockFamilyHandler(blockFamilyRegistry)).create();
}
Program: 389
Project: 389
Buggy source:
@Test public void testCommandLinePattern(){
  String[] testCommands={"String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < testCommands.length; i++) {
    testCommands[i]="String_Node_Str" + testCommands[i];
  }
  compareStringsToPattern(testCommands,MD5Patterns.commandLinePattern);
}

Fixed version (ground truth):
@Test public void testCommandLinePattern(){
  String[] testCommands={"String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < testCommands.length; i++) {
    testCommands[i]="String_Node_Str" + testCommands[i];
  }
  compareStringsToPattern(testCommands,MD5Patterns.COMMAND_LINE_PATTERN);
}
Program: 390
Project: 390
Buggy source:
private MD5 parse(InputStream stream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(stream,Charsets.UTF_8));
  MD5 md5=new MD5();
  String line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.version=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  Matcher commandlineMatch=Pattern.compile(MD5Patterns.commandLinePattern).matcher(line);
  if (commandlineMatch.matches()) {
    md5.commandline=commandlineMatch.group(1);
  }
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numFrames=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numJoints=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.frameRate=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numAnimatedComponents=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readHierarchy(reader,md5);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readBounds(reader,md5);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readBaseFrames(reader,md5);
  readFrames(reader,md5);
  return md5;
}

Fixed version (ground truth):
private MD5 parse(InputStream stream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(stream,Charsets.UTF_8));
  MD5 md5=new MD5();
  String line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.version=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  Matcher commandlineMatch=Pattern.compile(MD5Patterns.COMMAND_LINE_PATTERN).matcher(line);
  if (commandlineMatch.matches()) {
    md5.commandline=commandlineMatch.group(1);
  }
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numFrames=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numJoints=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.frameRate=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numAnimatedComponents=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readHierarchy(reader,md5);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readBounds(reader,md5);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readBaseFrames(reader,md5);
  readFrames(reader,md5);
  return md5;
}
Program: 391
Project: 391
Buggy source:
private MD5 parse(InputStream stream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(stream,Charsets.UTF_8));
  MD5 md5=new MD5();
  String line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.version=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  Matcher commandlineMatch=Pattern.compile(MD5Patterns.commandLinePattern).matcher(line);
  if (commandlineMatch.matches()) {
    md5.commandline=commandlineMatch.group(1);
  }
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numJoints=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numMeshes=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readJoints(reader,md5);
  md5.meshes=new MD5Mesh[md5.numMeshes];
  for (int i=0; i < md5.numMeshes; ++i) {
    MD5ParserCommon.readToLine(reader,"String_Node_Str");
    md5.meshes[i]=readMesh(reader);
  }
  return md5;
}

Fixed version (ground truth):
private MD5 parse(InputStream stream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(stream,Charsets.UTF_8));
  MD5 md5=new MD5();
  String line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.version=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  Matcher commandlineMatch=Pattern.compile(MD5Patterns.COMMAND_LINE_PATTERN).matcher(line);
  if (commandlineMatch.matches()) {
    md5.commandline=commandlineMatch.group(1);
  }
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numJoints=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numMeshes=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readJoints(reader,md5);
  md5.meshes=new MD5Mesh[md5.numMeshes];
  for (int i=0; i < md5.numMeshes; ++i) {
    MD5ParserCommon.readToLine(reader,"String_Node_Str");
    md5.meshes[i]=readMesh(reader);
  }
  return md5;
}
Program: 392
Project: 392
Buggy source:
@ReceiveEvent(components=ClientComponent.class) public void onTogglePause(PauseButton event,EntityRef entity){
  if (event.getState() == ButtonState.DOWN) {
    nuiManager.toggleScreen("String_Node_Str");
    event.consume();
  }
  if (getPlayerCount() == 1) {
    if (!time.isPaused()) {
      time.setPaused(true);
    }
 else {
      time.setPaused(false);
    }
  }
}

Fixed version (ground truth):
@ReceiveEvent(components=ClientComponent.class) public void onTogglePause(PauseButton event,EntityRef entity){
  if (event.getState() == ButtonState.DOWN) {
    nuiManager.toggleScreen("String_Node_Str");
    event.consume();
  }
  if ((event.getState() == ButtonState.DOWN) || (event.getState() == ButtonState.UP)) {
    if (getPlayerCount() == 1) {
      if (!time.isPaused()) {
        time.setPaused(true);
      }
 else {
        time.setPaused(false);
      }
    }
  }
}