nus-yam/ex-repair huggingface dataset:
Program: 458
Project: 458
Buggy source:
private void advancedModuleFilter(){
  Iterator<ModuleSelectionInfo> iter=sortedModules.iterator();
  while (iter.hasNext()) {
    ModuleSelectionInfo m=iter.next();
    Module module=(m.getOnlineVersion() == null) ? m.getLatestVersion() : m.getOnlineVersion();
    if (selectModulesConfig.isLibraryChecked() && !StandardModuleExtension.isLibraryModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isAssetplayChecked() && !StandardModuleExtension.isAssetplayModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isWorldChecked() && !StandardModuleExtension.isWorldModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isGameplayChecked() && !StandardModuleExtension.isGameplayModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isSpecialChecked() && !StandardModuleExtension.isSpecialModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isAugmentationChecked() && !StandardModuleExtension.isAugmentationModule(module)) {
      iter.remove();
    }
  }
}

Fixed version (ground truth):
private void advancedModuleFilter(){
  Iterator<ModuleSelectionInfo> iter=sortedModules.iterator();
  while (iter.hasNext()) {
    ModuleSelectionInfo m=iter.next();
    Module module;
    if (m.isPresent()) {
      module=moduleManager.getRegistry().getLatestModuleVersion(m.getMetadata().getId());
    }
 else {
      module=(m.getOnlineVersion() == null) ? m.getLatestVersion() : m.getOnlineVersion();
    }
    if (selectModulesConfig.isLibraryChecked() && !StandardModuleExtension.isLibraryModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isAssetplayChecked() && !StandardModuleExtension.isAssetplayModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isWorldChecked() && !StandardModuleExtension.isWorldModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isGameplayChecked() && !StandardModuleExtension.isGameplayModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isSpecialChecked() && !StandardModuleExtension.isSpecialModule(module)) {
      iter.remove();
      continue;
    }
    if (selectModulesConfig.isAugmentationChecked() && !StandardModuleExtension.isAugmentationModule(module)) {
      iter.remove();
    }
  }
}
Program: 459
Project: 459
Buggy source:
public boolean onKeyEvent(NUIKeyEvent event){
  if (event.isDown() && event.getKey() == Keyboard.Key.R) {
    refresh();
  }
  return false;
}

Fixed version (ground truth):
public boolean onKeyEvent(NUIKeyEvent event){
  if (event.isDown() && event.getKey() == Keyboard.Key.ESCAPE) {
    if (isEscapeToCloseAllowed()) {
      triggerBackAnimation();
      return true;
    }
  }
  if (event.isDown() && event.getKey() == Keyboard.Key.R) {
    refresh();
  }
  return false;
}
Program: 460
Project: 460
Buggy source:
@Override public void postInitialise(Context rootContext){
  metrics.initialise(rootContext);
  addTelemetryLogstashAppender(rootContext);
}

Fixed version (ground truth):
@Override public void postInitialise(Context rootContext){
  metrics.initialise(rootContext);
  addTelemetryLogstashAppender(rootContext);
  setTelemetryDestinationIfEnable(rootContext);
}
Program: 461
Project: 461
Buggy source:
private void addTelemetryLogstashAppender(Context rootContext){
  LoggerContext lc=(LoggerContext)LoggerFactory.getILoggerFactory();
  TelemetryLogstashAppender telemetryLogstashAppender=new TelemetryLogstashAppender(rootContext);
  lc.getLogger(Logger.ROOT_LOGGER_NAME).addAppender(telemetryLogstashAppender);
}

Fixed version (ground truth):
private void addTelemetryLogstashAppender(Context rootContext){
  LoggerContext lc=(LoggerContext)LoggerFactory.getILoggerFactory();
  TelemetryLogstashAppender telemetryLogstashAppender=new TelemetryLogstashAppender(rootContext);
  lc.getLogger(Logger.ROOT_LOGGER_NAME).addAppender(telemetryLogstashAppender);
  Config config=rootContext.get(Config.class);
  if (config.getTelemetryConfig().isErrorReportingEnabled()) {
    String errorReportingDestination=config.getTelemetryConfig().getErrorReportingDestination();
    if (errorReportingDestination != null) {
      telemetryLogstashAppender.addDestination(errorReportingDestination);
      telemetryLogstashAppender.start();
    }
  }
}
Program: 462
Project: 462
Buggy source:
@Override public void preInitialise(Context rootContext){
  context=rootContext;
  metrics=new Metrics();
  rootContext.put(Metrics.class,metrics);
  emitter=TelemetryEmitter.builder().build();
  rootContext.put(Emitter.class,emitter);
}

Fixed version (ground truth):
@Override public void preInitialise(Context rootContext){
  metrics=new Metrics();
  rootContext.put(Metrics.class,metrics);
  emitter=TelemetryEmitter.builder().build();
  rootContext.put(Emitter.class,emitter);
}
Program: 463
Project: 463
Buggy source:
private void pushAddServerPopupAndStartLogBackAppender(){
  AddServerPopup addServerPopup=nuiManager.pushScreen(AddServerPopup.ASSET_URI,AddServerPopup.class);
  addServerPopup.removeTip();
  ServerInfo serverInfo=new ServerInfo("String_Node_Str",TelemetryLogstashAppender.DEFAULT_LOGSTASH_HOST,TelemetryLogstashAppender.DEFAULT_LOGSTASH_PORT);
  serverInfo.setOwner(TelemetryLogstashAppender.DEFAULT_LOGSTASH_OWNER);
  addServerPopup.setServerInfo(serverInfo);
  addServerPopup.onSuccess((item) -> {
    StringBuilder destinationLogstash=new StringBuilder();
    destinationLogstash.append(item.getAddress());
    destinationLogstash.append("String_Node_Str");
    destinationLogstash.append(item.getPort());
    TelemetryLogstashAppender telemetryLogstashAppender=TelemetryUtils.fetchTelemetryLogstashAppender();
    telemetryLogstashAppender.addDestination(destinationLogstash.toString());
    telemetryLogstashAppender.start();
  }
);
  addServerPopup.onCancel((button) -> {
    config.getTelemetryConfig().setErrorReportingEnabled(false);
  }
);
}

Fixed version (ground truth):
private void pushAddServerPopupAndStartLogBackAppender(){
  AddServerPopup addServerPopup=nuiManager.pushScreen(AddServerPopup.ASSET_URI,AddServerPopup.class);
  addServerPopup.removeTip();
  ServerInfo serverInfo=new ServerInfo("String_Node_Str",TelemetryLogstashAppender.DEFAULT_LOGSTASH_HOST,TelemetryLogstashAppender.DEFAULT_LOGSTASH_PORT);
  serverInfo.setOwner(TelemetryLogstashAppender.DEFAULT_LOGSTASH_OWNER);
  addServerPopup.setServerInfo(serverInfo);
  addServerPopup.onSuccess((item) -> {
    StringBuilder destinationLogstash=new StringBuilder();
    destinationLogstash.append(item.getAddress());
    destinationLogstash.append("String_Node_Str");
    destinationLogstash.append(item.getPort());
    TelemetryLogstashAppender telemetryLogstashAppender=TelemetryUtils.fetchTelemetryLogstashAppender();
    telemetryLogstashAppender.addDestination(destinationLogstash.toString());
    telemetryLogstashAppender.start();
    config.getTelemetryConfig().setErrorReportingDestination(destinationLogstash.toString());
  }
);
  addServerPopup.onCancel((button) -> {
    config.getTelemetryConfig().setErrorReportingEnabled(false);
  }
);
}
Program: 464
Project: 464
Buggy source:
private void pushAddServerPopupAndStartEmitter(){
  AddServerPopup addServerPopup=nuiManager.pushScreen(AddServerPopup.ASSET_URI,AddServerPopup.class);
  addServerPopup.removeTip();
  ServerInfo serverInfo=new ServerInfo("String_Node_Str",TelemetryEmitter.DEFAULT_COLLECTOR_HOST,TelemetryEmitter.DEFAULT_COLLECTOR_PORT);
  serverInfo.setOwner(TelemetryEmitter.DEFAULT_COLLECTOR_OWNER);
  addServerPopup.setServerInfo(serverInfo);
  addServerPopup.onSuccess((item) -> {
    TelemetryEmitter telemetryEmitter=(TelemetryEmitter)emitter;
    Optional<URL> optionalURL=item.getURL("String_Node_Str");
    if (optionalURL.isPresent()) {
      telemetryEmitter.changeUrl(optionalURL.get());
    }
  }
);
  addServerPopup.onCancel((button) -> {
    config.getTelemetryConfig().setTelemetryEnabled(false);
  }
);
}

Fixed version (ground truth):
private void pushAddServerPopupAndStartEmitter(){
  AddServerPopup addServerPopup=nuiManager.pushScreen(AddServerPopup.ASSET_URI,AddServerPopup.class);
  addServerPopup.removeTip();
  ServerInfo serverInfo=new ServerInfo("String_Node_Str",TelemetryEmitter.DEFAULT_COLLECTOR_HOST,TelemetryEmitter.DEFAULT_COLLECTOR_PORT);
  serverInfo.setOwner(TelemetryEmitter.DEFAULT_COLLECTOR_OWNER);
  addServerPopup.setServerInfo(serverInfo);
  addServerPopup.onSuccess((item) -> {
    TelemetryEmitter telemetryEmitter=(TelemetryEmitter)emitter;
    Optional<URL> optionalURL=item.getURL("String_Node_Str");
    if (optionalURL.isPresent()) {
      telemetryEmitter.changeUrl(optionalURL.get());
      config.getTelemetryConfig().setTelemetryDestination(optionalURL.get().toString());
    }
  }
);
  addServerPopup.onCancel((button) -> {
    config.getTelemetryConfig().setTelemetryEnabled(false);
  }
);
}
Program: 465
Project: 465
Buggy source:
/** 
 * track a metric.
 * @param emitter Emitter sending telemetry to the server.
 * @param nameSpace The name the class tracking this metric.
 * @param metric The new metric.
 */
public static void trackMetric(Emitter emitter,String nameSpace,Unstructured metric){
  Tracker tracker=new Tracker.TrackerBuilder(emitter,nameSpace,TelemetryParams.APP_ID_TERASOLOGY).platform(TelemetryParams.PLATFORM_DESKTOP).build();
  tracker.track(metric);
}

Fixed version (ground truth):
/** 
 * track a metric.
 * @param emitter Emitter sending telemetry to the server.
 * @param nameSpace The name the class tracking this metric.
 * @param metric The new metric.
 */
public static void trackMetric(Emitter emitter,String nameSpace,Unstructured metric){
  Subject subject=new Subject.SubjectBuilder().userId(TelemetryParams.userId).build();
  Tracker tracker=new Tracker.TrackerBuilder(emitter,nameSpace,TelemetryParams.APP_ID_TERASOLOGY).subject(subject).platform(TelemetryParams.PLATFORM_DESKTOP).build();
  tracker.track(metric);
}
Program: 466
Project: 466
Buggy source:
private void setDefaultEncoder(){
  LoggingEventCompositeJsonEncoder loggingEventCompositeJsonEncoder=new LoggingEventCompositeJsonEncoder();
  JsonProviders jsonProviders=new JsonProviders();
  jsonProviders.addProvider(new LoggingEventFormattedTimestampJsonProvider());
  jsonProviders.addProvider(new LogstashVersionJsonProvider());
  jsonProviders.addProvider(new MdcJsonProvider());
  jsonProviders.addProvider(new MessageJsonProvider());
  jsonProviders.addProvider(new LogLevelJsonProvider());
  jsonProviders.addProvider(new LoggerNameJsonProvider());
  jsonProviders.addProvider(new ThreadNameJsonProvider());
  jsonProviders.addProvider(new SystemContextJsonProvider());
  jsonProviders.addProvider(new ModulesJsonProvider());
  StackTraceJsonProvider stackTraceJsonProvider=new StackTraceJsonProvider();
  ShortenedThrowableConverter shortenedThrowableConverter=new ShortenedThrowableConverter();
  shortenedThrowableConverter.setMaxDepthPerThrowable(30);
  shortenedThrowableConverter.setMaxLength(2046);
  shortenedThrowableConverter.setShortenedClassNameLength(20);
  shortenedThrowableConverter.setRootCauseFirst(true);
  stackTraceJsonProvider.setThrowableConverter(shortenedThrowableConverter);
  jsonProviders.addProvider(stackTraceJsonProvider);
  loggingEventCompositeJsonEncoder.setProviders(jsonProviders);
  this.setEncoder(loggingEventCompositeJsonEncoder);
}

Fixed version (ground truth):
private void setDefaultEncoder(){
  LoggingEventCompositeJsonEncoder loggingEventCompositeJsonEncoder=new LoggingEventCompositeJsonEncoder();
  JsonProviders jsonProviders=new JsonProviders();
  jsonProviders.addProvider(new LoggingEventFormattedTimestampJsonProvider());
  jsonProviders.addProvider(new LogstashVersionJsonProvider());
  jsonProviders.addProvider(new MdcJsonProvider());
  jsonProviders.addProvider(new MessageJsonProvider());
  jsonProviders.addProvider(new LogLevelJsonProvider());
  jsonProviders.addProvider(new LoggerNameJsonProvider());
  jsonProviders.addProvider(new ThreadNameJsonProvider());
  jsonProviders.addProvider(new SystemContextJsonProvider());
  jsonProviders.addProvider(new ModulesJsonProvider());
  jsonProviders.addProvider(new UserIdJsonProvider());
  StackTraceJsonProvider stackTraceJsonProvider=new StackTraceJsonProvider();
  ShortenedThrowableConverter shortenedThrowableConverter=new ShortenedThrowableConverter();
  shortenedThrowableConverter.setMaxDepthPerThrowable(30);
  shortenedThrowableConverter.setMaxLength(2046);
  shortenedThrowableConverter.setShortenedClassNameLength(20);
  shortenedThrowableConverter.setRootCauseFirst(true);
  stackTraceJsonProvider.setThrowableConverter(shortenedThrowableConverter);
  jsonProviders.addProvider(stackTraceJsonProvider);
  loggingEventCompositeJsonEncoder.setProviders(jsonProviders);
  this.setEncoder(loggingEventCompositeJsonEncoder);
}
Program: 467
Project: 467
Buggy source:
@Override public void update(float delta){
  super.update(delta);
  if (needsUpdate) {
    if (metaDownloader.isDone()) {
      needsUpdate=false;
    }
    updateModuleInformation();
  }
}

Fixed version (ground truth):
@Override public void update(float delta){
  super.update(delta);
  if (selectModulesConfig.isChecked()) {
    return;
  }
  if (needsUpdate) {
    if (metaDownloader.isDone()) {
      needsUpdate=false;
    }
    updateModuleInformation();
  }
}
Program: 469
Project: 469
Buggy source:
@ReceiveEvent(components={DoorComponent.class,BlockRegionComponent.class,LocationComponent.class}) public void closeDoor(CloseDoorEvent event,EntityRef entity,DoorComponent door){
  Side newSide=door.closedSide;
  BlockRegionComponent regionComp=entity.getComponent(BlockRegionComponent.class);
  Block bottomBlock=door.bottomBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.min(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.min(),bottomBlock);
  Block topBlock=door.topBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.max(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.max(),topBlock);
  if (door.closeSound != null) {
    entity.send(new PlaySoundEvent(door.closeSound,1f));
  }
  door.isOpen=false;
  entity.saveComponent(door);
}

Fixed version (ground truth):
@ReceiveEvent public void closeDoor(CloseDoorEvent event,EntityRef player){
  EntityRef entity=event.getDoorEntity();
  DoorComponent door=entity.getComponent(DoorComponent.class);
  Side newSide=door.closedSide;
  BlockRegionComponent regionComp=entity.getComponent(BlockRegionComponent.class);
  Block bottomBlock=door.bottomBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.min(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.min(),bottomBlock);
  Block topBlock=door.topBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.max(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.max(),topBlock);
  if (door.closeSound != null) {
    entity.send(new PlaySoundEvent(door.closeSound,1f));
  }
  door.isOpen=false;
  entity.saveComponent(door);
}
Program: 470
Project: 470
Buggy source:
@ReceiveEvent(components={DoorComponent.class,BlockRegionComponent.class,LocationComponent.class}) public void onFrob(ActivateEvent event,EntityRef entity){
  DoorComponent door=entity.getComponent(DoorComponent.class);
  if (door.isOpen) {
    entity.send(new CloseDoorEvent(event.getInstigator()));
  }
 else {
    entity.send(new CloseDoorEvent(event.getInstigator()));
  }
}

Fixed version (ground truth):
@ReceiveEvent(components={DoorComponent.class,BlockRegionComponent.class,LocationComponent.class}) public void onFrob(ActivateEvent event,EntityRef entity){
  DoorComponent door=entity.getComponent(DoorComponent.class);
  if (door.isOpen) {
    event.getInstigator().send(new CloseDoorEvent(entity));
  }
 else {
    event.getInstigator().send(new OpenDoorEvent(entity));
  }
}
Program: 471
Project: 471
Buggy source:
@ReceiveEvent(components={DoorComponent.class,BlockRegionComponent.class,LocationComponent.class}) public void openDoor(OpenDoorEvent event,EntityRef entity,DoorComponent door){
  Side newSide=door.openSide;
  BlockRegionComponent regionComp=entity.getComponent(BlockRegionComponent.class);
  Block bottomBlock=door.bottomBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.min(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.min(),bottomBlock);
  Block topBlock=door.topBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.max(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.max(),topBlock);
  if (door.openSide != null) {
    entity.send(new PlaySoundEvent(door.openSound,1f));
  }
  door.isOpen=true;
}

Fixed version (ground truth):
@ReceiveEvent public void openDoor(OpenDoorEvent event,EntityRef player){
  EntityRef entity=event.getDoorEntity();
  DoorComponent door=entity.getComponent(DoorComponent.class);
  Side newSide=door.openSide;
  BlockRegionComponent regionComp=entity.getComponent(BlockRegionComponent.class);
  Block bottomBlock=door.bottomBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.min(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.min(),bottomBlock);
  Block topBlock=door.topBlockFamily.getBlockForPlacement(worldProvider,blockEntityRegistry,regionComp.region.max(),newSide,Side.TOP);
  worldProvider.setBlock(regionComp.region.max(),topBlock);
  if (door.openSound != null) {
    entity.send(new PlaySoundEvent(door.openSound,1f));
  }
  door.isOpen=true;
}
Program: 472
Project: 472
Buggy source:
public OpenDoorEvent(EntityRef instigator){
  this.instigator=instigator;
}

Fixed version (ground truth):
public OpenDoorEvent(EntityRef doorEntity){
  this.doorEntity=doorEntity;
}
Program: 473
Project: 473
Buggy source:
@Command(shortDescription="String_Node_Str",runOnServer=true,requiredPermission=PermissionManager.CHEAT_PERMISSION) public String playerEyeHeight(@Sender EntityRef client,@CommandParam("String_Node_Str") float amount){
  ClientComponent clientComp=client.getComponent(ClientComponent.class);
  try {
    GazeMountPointComponent gazeMountPointComponent=clientComp.character.getComponent(GazeMountPointComponent.class);
    if (gazeMountPointComponent != null) {
      float prevHeight=gazeMountPointComponent.translate.y;
      Location.removeChild(client,gazeMountPointComponent.gazeEntity);
      gazeMountPointComponent.translate.y=amount;
      Location.attachChild(client,gazeMountPointComponent.gazeEntity,gazeMountPointComponent.translate,new Quat4f(Quat4f.IDENTITY));
      return "String_Node_Str" + amount + "String_Node_Str"+ prevHeight+ "String_Node_Str";
    }
    return "String_Node_Str";
  }
 catch (  NullPointerException e) {
    e.printStackTrace();
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Command(shortDescription="String_Node_Str",runOnServer=true,requiredPermission=PermissionManager.CHEAT_PERMISSION) public String playerEyeHeight(@Sender EntityRef client,@CommandParam("String_Node_Str") float amount){
  ClientComponent clientComp=client.getComponent(ClientComponent.class);
  try {
    GazeMountPointComponent gazeMountPointComponent=clientComp.character.getComponent(GazeMountPointComponent.class);
    if (gazeMountPointComponent != null) {
      float prevHeight=gazeMountPointComponent.translate.y;
      gazeMountPointComponent.translate.y=amount;
      clientComp.character.saveComponent(gazeMountPointComponent);
      return "String_Node_Str" + amount + "String_Node_Str"+ prevHeight+ "String_Node_Str";
    }
    return "String_Node_Str";
  }
 catch (  NullPointerException e) {
    e.printStackTrace();
    return "String_Node_Str";
  }
}
Program: 474
Project: 474
Buggy source:
@ReceiveEvent public void beforeDestroy(BeforeDestroyEvent event,EntityRef entity,CharacterComponent character){
  if (character.controller.exists()) {
    event.consume();
  }
  DeathEvent deathEvent=new DeathEvent();
  deathEvent.damageTypeName=getDamageTypeName(event.getDamageType());
  deathEvent.instigatorName=getInstigatorName(event.getInstigator());
  character.controller.send(deathEvent);
}

Fixed version (ground truth):
@ReceiveEvent public void beforeDestroy(BeforeDestroyEvent event,EntityRef entity,CharacterComponent character,AliveCharacterComponent aliveCharacterComponent){
  if (entity.hasComponent(PlayerCharacterComponent.class)) {
    event.consume();
  }
  DeathEvent deathEvent=new DeathEvent();
  deathEvent.damageTypeName=getDamageTypeName(event.getDamageType());
  deathEvent.instigatorName=getInstigatorName(event.getInstigator());
  character.controller.send(deathEvent);
  entity.removeComponent(AliveCharacterComponent.class);
}
Program: 475
Project: 475
Buggy source:
@ReceiveEvent(components={CharacterMovementComponent.class,LocationComponent.class}) public void onPlayerInput(CharacterMoveInputEvent input,EntityRef entity){
  if (predictedState == null) {
    predictedState=createInitialState(entity);
    authoritiveState=predictedState;
    playerStates.remove(entity);
  }
  inputs.add(input);
  CharacterStateEvent newState=stepState(input,predictedState,entity);
  predictedState=newState;
  characterMovementSystemUtility.setToState(entity,newState);
}

Fixed version (ground truth):
@ReceiveEvent(components={CharacterMovementComponent.class,LocationComponent.class,AliveCharacterComponent.class}) public void onPlayerInput(CharacterMoveInputEvent input,EntityRef entity){
  if (predictedState == null) {
    predictedState=createInitialState(entity);
    authoritiveState=predictedState;
    playerStates.remove(entity);
  }
  inputs.add(input);
  CharacterStateEvent newState=stepState(input,predictedState,entity);
  predictedState=newState;
  characterMovementSystemUtility.setToState(entity,newState);
}
Program: 476
Project: 476
Buggy source:
@ReceiveEvent(components={CharacterMovementComponent.class,LocationComponent.class}) public void onCharacterStateReceived(CharacterStateEvent state,EntityRef entity){
  if (entity.equals(localPlayer.getCharacterEntity())) {
    logger.trace("String_Node_Str",state.getSequenceNumber(),inputs.size());
    playerStates.remove(entity);
    authoritiveState=state;
    Iterator<CharacterMoveInputEvent> inputIterator=inputs.iterator();
    CharacterStateEvent newState=authoritiveState;
    while (inputIterator.hasNext()) {
      CharacterMoveInputEvent input=inputIterator.next();
      if (input.getSequenceNumber() <= state.getSequenceNumber()) {
        inputIterator.remove();
      }
 else {
        newState=stepState(input,newState,entity);
      }
    }
    logger.trace("String_Node_Str",inputs.size());
    characterMovementSystemUtility.setToState(entity,newState);
    predictedState=newState;
  }
 else {
    playerStates.get(entity).add(state);
  }
}

Fixed version (ground truth):
@ReceiveEvent(components={CharacterMovementComponent.class,LocationComponent.class,AliveCharacterComponent.class}) public void onCharacterStateReceived(CharacterStateEvent state,EntityRef entity){
  if (entity.equals(localPlayer.getCharacterEntity())) {
    logger.trace("String_Node_Str",state.getSequenceNumber(),inputs.size());
    playerStates.remove(entity);
    authoritiveState=state;
    Iterator<CharacterMoveInputEvent> inputIterator=inputs.iterator();
    CharacterStateEvent newState=authoritiveState;
    while (inputIterator.hasNext()) {
      CharacterMoveInputEvent input=inputIterator.next();
      if (input.getSequenceNumber() <= state.getSequenceNumber()) {
        inputIterator.remove();
      }
 else {
        newState=stepState(input,newState,entity);
      }
    }
    logger.trace("String_Node_Str",inputs.size());
    characterMovementSystemUtility.setToState(entity,newState);
    predictedState=newState;
  }
 else {
    playerStates.get(entity).add(state);
  }
}
Program: 477
Project: 477
Buggy source:
@ReceiveEvent(components={CharacterMovementComponent.class,LocationComponent.class}) public void onPlayerInput(CharacterMoveInputEvent input,EntityRef entity){
  CharacterCollider characterCollider=physics.getCharacterCollider(entity);
  if (characterCollider.isPending()) {
    logger.debug("String_Node_Str");
    return;
  }
  CircularBuffer<CharacterStateEvent> stateBuffer=characterStates.get(entity);
  CharacterStateEvent lastState=stateBuffer.getLast();
  if (input.getDelta() + lastState.getTime() < time.getGameTimeInMs() + MAX_INPUT_OVERFLOW) {
    CharacterStateEvent newState=stepState(input,lastState,entity);
    stateBuffer.add(newState);
    characterMovementSystemUtility.setToState(entity,newState);
    lastInputEvent.put(entity,input);
  }
 else {
    logger.warn("String_Node_Str",entity);
  }
}

Fixed version (ground truth):
@ReceiveEvent(components={CharacterMovementComponent.class,LocationComponent.class,AliveCharacterComponent.class}) public void onPlayerInput(CharacterMoveInputEvent input,EntityRef entity){
  CharacterCollider characterCollider=physics.getCharacterCollider(entity);
  if (characterCollider.isPending()) {
    logger.debug("String_Node_Str");
    return;
  }
  CircularBuffer<CharacterStateEvent> stateBuffer=characterStates.get(entity);
  CharacterStateEvent lastState=stateBuffer.getLast();
  if (input.getDelta() + lastState.getTime() < time.getGameTimeInMs() + MAX_INPUT_OVERFLOW) {
    CharacterStateEvent newState=stepState(input,lastState,entity);
    stateBuffer.add(newState);
    characterMovementSystemUtility.setToState(entity,newState);
    lastInputEvent.put(entity,input);
  }
 else {
    logger.warn("String_Node_Str",entity);
  }
}
Program: 478
Project: 478
Buggy source:
private void respawnPlayer(EntityRef clientEntity){
  ClientComponent client=clientEntity.getComponent(ClientComponent.class);
  EntityRef playerCharacter=client.character;
  LocationComponent location=clientEntity.getComponent(LocationComponent.class);
  PlayerFactory playerFactory=new PlayerFactory(entityManager,worldProvider);
  Vector3f spawnPosition=playerFactory.findSpawnPositionFromLocationComponent(location);
  location.setWorldPosition(spawnPosition);
  clientEntity.saveComponent(location);
  logger.debug("String_Node_Str",spawnPosition);
  Client clientListener=networkSystem.getOwner(clientEntity);
  Vector3i distance=clientListener.getViewDistance().getChunkDistance();
  updateRelevanceEntity(clientEntity,distance);
  playerCharacter.send(new OnPlayerRespawnedEvent());
}

Fixed version (ground truth):
private void respawnPlayer(EntityRef clientEntity){
  ClientComponent client=clientEntity.getComponent(ClientComponent.class);
  EntityRef playerCharacter=client.character;
  LocationComponent location=clientEntity.getComponent(LocationComponent.class);
  PlayerFactory playerFactory=new PlayerFactory(entityManager,worldProvider);
  Vector3f spawnPosition=playerFactory.findSpawnPositionFromLocationComponent(location);
  location.setWorldPosition(spawnPosition);
  clientEntity.saveComponent(location);
  playerCharacter.send(new CharacterTeleportEvent(spawnPosition));
  logger.debug("String_Node_Str",spawnPosition);
  Client clientListener=networkSystem.getOwner(clientEntity);
  Vector3i distance=clientListener.getViewDistance().getChunkDistance();
  updateRelevanceEntity(clientEntity,distance);
  playerCharacter.send(new OnPlayerRespawnedEvent());
}
Program: 479
Project: 479
Buggy source:
private void respawnPlayer(EntityRef clientEntity){
  ClientComponent client=clientEntity.getComponent(ClientComponent.class);
  EntityRef playerCharacter=client.character;
  LocationComponent location=clientEntity.getComponent(LocationComponent.class);
  PlayerFactory playerFactory=new PlayerFactory(entityManager,worldProvider);
  Vector3f spawnPosition=playerFactory.findSpawnPositionFromLocationComponent(location);
  location.setWorldPosition(spawnPosition);
  clientEntity.saveComponent(location);
  logger.debug("String_Node_Str",spawnPosition);
  Client clientListener=networkSystem.getOwner(clientEntity);
  Vector3i distance=clientListener.getViewDistance().getChunkDistance();
  updateRelevanceEntity(clientEntity,distance);
  playerCharacter.send(new OnPlayerSpawnedEvent());
}

Fixed version (ground truth):
private void respawnPlayer(EntityRef clientEntity){
  ClientComponent client=clientEntity.getComponent(ClientComponent.class);
  EntityRef playerCharacter=client.character;
  LocationComponent location=clientEntity.getComponent(LocationComponent.class);
  PlayerFactory playerFactory=new PlayerFactory(entityManager,worldProvider);
  Vector3f spawnPosition=playerFactory.findSpawnPositionFromLocationComponent(location);
  location.setWorldPosition(spawnPosition);
  clientEntity.saveComponent(location);
  logger.debug("String_Node_Str",spawnPosition);
  Client clientListener=networkSystem.getOwner(clientEntity);
  Vector3i distance=clientListener.getViewDistance().getChunkDistance();
  updateRelevanceEntity(clientEntity,distance);
  playerCharacter.send(new OnPlayerRespawnedEvent());
}
Program: 481
Project: 481
Buggy source:
@Override public void initialise(){
  overlay=nuiManager.addOverlay(MINICHAT_UI,MiniChatOverlay.class);
  console.subscribe((  Message message) -> {
    if (!nuiManager.isOpen("String_Node_Str")) {
      overlay.setVisible(true);
    }
  }
);
  overlay.setVisible(true);
}

Fixed version (ground truth):
@Override public void initialise(){
  overlay=nuiManager.addOverlay(MINICHAT_UI,MiniChatOverlay.class);
  console.subscribe((  Message message) -> {
    if (!nuiManager.isOpen("String_Node_Str")) {
      overlay.setVisible(true);
    }
  }
);
}
Program: 482
Project: 482
Buggy source:
@Override public void onDraw(Canvas canvas){
  Rect2i clearButtonRegion=Rect2i.createFromMinAndSize(0,0,30,canvas.size().y);
  if (text.get() == null) {
    text.set("String_Node_Str");
  }
  lastFont=canvas.getCurrentStyle().getFont();
  lastWidth=canvas.size().x - clearButtonRegion.size().x;
  if (isEnabled()) {
    canvas.addInteractionRegion(interactionListener,Rect2i.createFromMinAndMax(0,0,canvas.size().x,canvas.size().y));
    canvas.addInteractionRegion(clearInteractionListener,Rect2i.createFromMinAndMax(canvas.size().x,0,canvas.size().x + clearButtonRegion.size().x,canvas.size().y));
  }
  correctCursor();
  int widthForDraw=(multiline) ? canvas.size().x - clearButtonRegion.size().x : lastFont.getWidth(getText());
  try (SubRegion ignored=canvas.subRegion(canvas.getRegion(),true);SubRegion ignored2=canvas.subRegion(Rect2i.createFromMinAndSize(-offset,0,widthForDraw + 1,Integer.MAX_VALUE),false)){
    canvas.drawText(text.get(),canvas.getRegion());
    if (isFocused()) {
      if (hasSelection()) {
        drawSelection(canvas);
      }
 else {
        drawCursor(canvas);
      }
    }
  }
 }

Fixed version (ground truth):
@Override public void onDraw(Canvas canvas){
  Rect2i clearButtonRegion=Rect2i.createFromMinAndSize(0,0,30,canvas.size().y);
  lastWidth=canvas.size().x - clearButtonRegion.size().x;
  if (isEnabled()) {
    canvas.addInteractionRegion(interactionListener,Rect2i.createFromMinAndMax(0,0,canvas.size().x,canvas.size().y));
    canvas.addInteractionRegion(clearInteractionListener,Rect2i.createFromMinAndMax(canvas.size().x,0,canvas.size().x + clearButtonRegion.size().x,canvas.size().y));
  }
  drawAll(canvas,canvas.size().x - clearButtonRegion.size().x);
}
Program: 483
Project: 483
Buggy source:
/** 
 * Handles how the widget is drawn.
 * @param canvas The canvas on which the widget resides.
 */
@Override public void onDraw(Canvas canvas){
  if (text.get() == null) {
    text.set("String_Node_Str");
  }
  if (text.get().equals("String_Node_Str")) {
    text.set(hintText);
    isShowingHintText=true;
  }
  if (isShowingHintText) {
    setCursorPosition(0);
    if (!text.get().equals(hintText) && text.get().endsWith(hintText)) {
      text.set(text.get().substring(0,text.get().length() - hintText.length()));
      setCursorPosition(text.get().length());
      isShowingHintText=false;
    }
  }
  lastFont=canvas.getCurrentStyle().getFont();
  lastWidth=canvas.size().x;
  if (isEnabled()) {
    canvas.addInteractionRegion(interactionListener,canvas.getRegion());
  }
  correctCursor();
  int widthForDraw=(multiline) ? canvas.size().x : lastFont.getWidth(getText());
  try (SubRegion ignored=canvas.subRegion(canvas.getRegion(),true);SubRegion ignored2=canvas.subRegion(Rect2i.createFromMinAndSize(-offset,0,widthForDraw + 1,Integer.MAX_VALUE),false)){
    if (isShowingHintText && !readOnly) {
      canvas.drawTextRaw(text.get(),lastFont,canvas.getCurrentStyle().getHintTextColor(),canvas.getRegion());
    }
 else {
      canvas.drawText(text.get(),canvas.getRegion());
    }
    if (isFocused()) {
      if (hasSelection()) {
        drawSelection(canvas);
      }
 else {
        drawCursor(canvas);
      }
    }
  }
 }

Fixed version (ground truth):
/** 
 * Handles how the widget is drawn.
 * @param canvas The canvas on which the widget resides.
 */
@Override public void onDraw(Canvas canvas){
  lastWidth=canvas.size().x;
  if (isEnabled()) {
    canvas.addInteractionRegion(interactionListener,canvas.getRegion());
  }
  drawAll(canvas,canvas.size().x);
}
Program: 484
Project: 484
Buggy source:
/** 
 * Returns true if an input has already been bound to another key
 * @param newInput The input to check if it has been bound already
 * @return True if newInput has been bound. False otherwise.
 */
public boolean isBound(Input newInput){
  return data.containsValue(newInput);
}

Fixed version (ground truth):
/** 
 * Returns true if an input has already been bound to another key
 * @param newInput The input to check if it has been bound already
 * @return True if newInput has been bound. False otherwise.
 */
public boolean isBound(Input newInput){
  return newInput != null && data.containsValue(newInput);
}
Program: 485
Project: 485
Buggy source:
public AmbientOcclusionNode(Context context){
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_MATERIAL));
  ssaoMaterial=getMaterial(SSAO_MATERIAL);
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(SSAO_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(SSAO_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(SSAO_FBO,displayResolutionDependentFBOs));
  update();
  displayResolutionDependentFBOs.subscribe(this);
}

Fixed version (ground truth):
public AmbientOcclusionNode(Context context){
  super(context);
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_MATERIAL));
  ssaoMaterial=getMaterial(SSAO_MATERIAL);
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(SSAO_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(SSAO_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(SSAO_FBO,displayResolutionDependentFBOs));
  update();
  displayResolutionDependentFBOs.subscribe(this);
}
Program: 486
Project: 486
Buggy source:
/** 
 * Constructs a BlurNode instance.
 * @param inputFboConfig an FBOConfig instance describing the input FBO, to be retrieved from the FBO manager
 * @param outputFboConfig an FBOConfig instance describing the output FBO, to be retrieved from the FBO manager
 * @param fboManager the FBO manager from which to retrieve -both- FBOs.
 * @param blurRadius the blur radius: higher values cause higher blur. The shader's default is 16.0f.
 * @param label a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public BlurNode(Context context,FBOConfig inputFboConfig,FBOConfig outputFboConfig,BaseFBOsManager fboManager,float blurRadius,String label){
  this.fboManager=fboManager;
  this.blurRadius=blurRadius;
  this.label=label;
  this.inputFboUrn=inputFboConfig.getName();
  this.outputFboUrn=outputFboConfig.getName();
  setupConditions(context);
  requiresFBO(inputFboConfig,fboManager);
  requiresFBO(outputFboConfig,fboManager);
  addDesiredStateChange(new BindFBO(outputFboUrn,fboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn,fboManager));
  update();
  fboManager.subscribe(this);
  addDesiredStateChange(new EnableMaterial(BLUR_MATERIAL));
  this.blurMaterial=getMaterial(BLUR_MATERIAL);
}

Fixed version (ground truth):
/** 
 * Constructs a BlurNode instance.
 * @param inputFboConfig an FBOConfig instance describing the input FBO, to be retrieved from the FBO manager
 * @param outputFboConfig an FBOConfig instance describing the output FBO, to be retrieved from the FBO manager
 * @param fboManager the FBO manager from which to retrieve -both- FBOs.
 * @param blurRadius the blur radius: higher values cause higher blur. The shader's default is 16.0f.
 * @param label a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public BlurNode(Context context,FBOConfig inputFboConfig,FBOConfig outputFboConfig,BaseFBOsManager fboManager,float blurRadius,String label){
  super(context);
  this.fboManager=fboManager;
  this.blurRadius=blurRadius;
  this.label=label;
  this.inputFboUrn=inputFboConfig.getName();
  this.outputFboUrn=outputFboConfig.getName();
  setupConditions(context);
  requiresFBO(inputFboConfig,fboManager);
  requiresFBO(outputFboConfig,fboManager);
  addDesiredStateChange(new BindFBO(outputFboUrn,fboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn,fboManager));
  update();
  fboManager.subscribe(this);
  addDesiredStateChange(new EnableMaterial(BLUR_MATERIAL));
  this.blurMaterial=getMaterial(BLUR_MATERIAL);
}
Program: 487
Project: 487
Buggy source:
public BlurredAmbientOcclusionNode(Context context){
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_BLURRED_MATERIAL));
  ssaoBlurredMaterial=getMaterial(SSAO_BLURRED_MATERIAL);
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(SSAO_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  requiresFBO(new FBOConfig(SSAO_BLURRED_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(SSAO_BLURRED_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(SSAO_BLURRED_FBO,displayResolutionDependentFBOs));
  update();
  displayResolutionDependentFBOs.subscribe(this);
  addDesiredStateChange(new SetInputTextureFromFBO(TEXTURE_SLOT_0,SSAO_FBO,ColorTexture,displayResolutionDependentFBOs,SSAO_BLURRED_MATERIAL,"String_Node_Str"));
}

Fixed version (ground truth):
public BlurredAmbientOcclusionNode(Context context){
  super(context);
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_BLURRED_MATERIAL));
  ssaoBlurredMaterial=getMaterial(SSAO_BLURRED_MATERIAL);
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(SSAO_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  requiresFBO(new FBOConfig(SSAO_BLURRED_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(SSAO_BLURRED_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(SSAO_BLURRED_FBO,displayResolutionDependentFBOs));
  update();
  displayResolutionDependentFBOs.subscribe(this);
  addDesiredStateChange(new SetInputTextureFromFBO(TEXTURE_SLOT_0,SSAO_FBO,ColorTexture,displayResolutionDependentFBOs,SSAO_BLURRED_MATERIAL,"String_Node_Str"));
}
Program: 488
Project: 488
Buggy source:
/** 
 * Constructs an instance of this node. Specifically, initialize the vrProvider and pass the frame buffer information for the vrProvider to use.
 */
public CopyImageToHMDNode(Context context){
  worldRenderer=context.get(WorldRenderer.class);
  vrProvider=context.get(OpenVRProvider.class);
  requiresCondition(() -> (context.get(Config.class).getRendering().isVrSupport() && vrProvider.isInitialized()));
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(LEFT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  requiresFBO(new FBOConfig(RIGHT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  update();
  displayResolutionDependentFBOs.subscribe(this);
  if (vrProvider != null) {
    vrProvider.texType[0].handle=leftEyeFbo.colorBufferTextureId;
    vrProvider.texType[0].eColorSpace=JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma;
    vrProvider.texType[0].eType=JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL;
    vrProvider.texType[0].write();
    vrProvider.texType[1].handle=rightEyeFbo.colorBufferTextureId;
    vrProvider.texType[1].eColorSpace=JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma;
    vrProvider.texType[1].eType=JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL;
    vrProvider.texType[1].write();
  }
  addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL));
}

Fixed version (ground truth):
/** 
 * Constructs an instance of this node. Specifically, initialize the vrProvider and pass the frame buffer information for the vrProvider to use.
 */
public CopyImageToHMDNode(Context context){
  super(context);
  worldRenderer=context.get(WorldRenderer.class);
  vrProvider=context.get(OpenVRProvider.class);
  requiresCondition(() -> (context.get(Config.class).getRendering().isVrSupport() && vrProvider.isInitialized()));
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(LEFT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  requiresFBO(new FBOConfig(RIGHT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  update();
  displayResolutionDependentFBOs.subscribe(this);
  if (vrProvider != null) {
    vrProvider.texType[0].handle=leftEyeFbo.colorBufferTextureId;
    vrProvider.texType[0].eColorSpace=JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma;
    vrProvider.texType[0].eType=JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL;
    vrProvider.texType[0].write();
    vrProvider.texType[1].handle=rightEyeFbo.colorBufferTextureId;
    vrProvider.texType[1].eColorSpace=JOpenVRLibrary.EColorSpace.EColorSpace_ColorSpace_Gamma;
    vrProvider.texType[1].eType=JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL;
    vrProvider.texType[1].write();
  }
  addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL));
}
Program: 489
Project: 489
Buggy source:
public CopyImageToScreenNode(Context context){
  WorldRenderer worldRenderer=context.get(WorldRenderer.class);
  requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE);
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  addDesiredStateChange(new BindFBO(DEFAULT_FBO,displayResolutionDependentFBOs));
  update();
  displayResolutionDependentFBOs.subscribe(this);
  addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL));
}

Fixed version (ground truth):
public CopyImageToScreenNode(Context context){
  super(context);
  WorldRenderer worldRenderer=context.get(WorldRenderer.class);
  requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE);
  displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  addDesiredStateChange(new BindFBO(DEFAULT_FBO,displayResolutionDependentFBOs));
  update();
  displayResolutionDependentFBOs.subscribe(this);
  addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL));
}
Program: 490
Project: 490
Buggy source:
/** 
 * Constructs the DownSamplerNode instance.
 * @param inputFboConfig an FBOConfig instance describing the input FBO, to be retrieved from the FBO manager
 * @param inputFboManager the FBO manager from which to retrieve the input FBO
 * @param outputFboConfig an FBOConfig instance describing the output FBO, to be retrieved from the FBO manager
 * @param outputFboManager the FBO manager from which to retrieve the output FBO
 * @param label a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public DownSamplerNode(Context context,FBOConfig inputFboConfig,BaseFBOsManager inputFboManager,FBOConfig outputFboConfig,BaseFBOsManager outputFboManager,String label){
  this.outputFboManager=outputFboManager;
  this.outputFboUrn=outputFboConfig.getName();
  requiresFBO(inputFboConfig,inputFboManager);
  requiresFBO(outputFboConfig,outputFboManager);
  addDesiredStateChange(new BindFBO(outputFboUrn,outputFboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn,outputFboManager));
  addDesiredStateChange(new SetInputTextureFromFBO(SLOT_0,inputFboConfig.getName(),ColorTexture,inputFboManager,DOWN_SAMPLER_MATERIAL,TEXTURE_NAME));
  update();
  outputFboManager.subscribe(this);
  setupConditions(context);
  addDesiredStateChange(new EnableMaterial(DOWN_SAMPLER_MATERIAL));
  downSampler=getMaterial(DOWN_SAMPLER_MATERIAL);
  this.label=label;
}

Fixed version (ground truth):
/** 
 * Constructs the DownSamplerNode instance.
 * @param inputFboConfig an FBOConfig instance describing the input FBO, to be retrieved from the FBO manager
 * @param inputFboManager the FBO manager from which to retrieve the input FBO
 * @param outputFboConfig an FBOConfig instance describing the output FBO, to be retrieved from the FBO manager
 * @param outputFboManager the FBO manager from which to retrieve the output FBO
 * @param label a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public DownSamplerNode(Context context,FBOConfig inputFboConfig,BaseFBOsManager inputFboManager,FBOConfig outputFboConfig,BaseFBOsManager outputFboManager,String label){
  super(context);
  this.outputFboManager=outputFboManager;
  this.outputFboUrn=outputFboConfig.getName();
  requiresFBO(inputFboConfig,inputFboManager);
  requiresFBO(outputFboConfig,outputFboManager);
  addDesiredStateChange(new BindFBO(outputFboUrn,outputFboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn,outputFboManager));
  addDesiredStateChange(new SetInputTextureFromFBO(SLOT_0,inputFboConfig.getName(),ColorTexture,inputFboManager,DOWN_SAMPLER_MATERIAL,TEXTURE_NAME));
  update();
  outputFboManager.subscribe(this);
  setupConditions(context);
  addDesiredStateChange(new EnableMaterial(DOWN_SAMPLER_MATERIAL));
  downSampler=getMaterial(DOWN_SAMPLER_MATERIAL);
  this.label=label;
}