nus-yam/ex-repair huggingface dataset:
Program: 491
Project: 491
Buggy source:
public FirstPersonViewNode(Context context){
  componentSystemManager=context.get(ComponentSystemManager.class);
  worldRenderer=context.get(WorldRenderer.class);
  playerCamera=worldRenderer.getActiveCamera();
  wireframeStateChange=new SetWireframe(true);
  renderingDebugConfig=context.get(Config.class).getRendering().getDebug();
  new WireframeTrigger(renderingDebugConfig,this);
  requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden());
  renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN,this);
  addDesiredStateChange(new BindFBO(READONLY_GBUFFER,context.get(DisplayResolutionDependentFBOs.class)));
  addDesiredStateChange(new SetDepthFunction(GL_ALWAYS));
}

Fixed version (ground truth):
public FirstPersonViewNode(Context context){
  super(context);
  componentSystemManager=context.get(ComponentSystemManager.class);
  worldRenderer=context.get(WorldRenderer.class);
  playerCamera=worldRenderer.getActiveCamera();
  wireframeStateChange=new SetWireframe(true);
  renderingDebugConfig=context.get(Config.class).getRendering().getDebug();
  new WireframeTrigger(renderingDebugConfig,this);
  requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden());
  renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN,this);
  addDesiredStateChange(new BindFBO(READONLY_GBUFFER,context.get(DisplayResolutionDependentFBOs.class)));
  addDesiredStateChange(new SetDepthFunction(GL_ALWAYS));
}
Program: 492
Project: 492
Buggy source:
public HighPassNode(Context context){
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.BLOOM,this);
  requiresCondition(renderingConfig::isBloom);
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(HIGH_PASS_FBO_CONFIG,displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(HIGH_PASS_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(HIGH_PASS_FBO,displayResolutionDependentFBOs));
  highPass=getMaterial(HIGH_PASS_MATERIAL);
  addDesiredStateChange(new EnableMaterial(HIGH_PASS_MATERIAL));
  int textureSlot=0;
  addDesiredStateChange(new SetInputTextureFromFBO(textureSlot,READONLY_GBUFFER,ColorTexture,displayResolutionDependentFBOs,HIGH_PASS_MATERIAL,"String_Node_Str"));
}

Fixed version (ground truth):
public HighPassNode(Context context){
  super(context);
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.BLOOM,this);
  requiresCondition(renderingConfig::isBloom);
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(HIGH_PASS_FBO_CONFIG,displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(HIGH_PASS_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(HIGH_PASS_FBO,displayResolutionDependentFBOs));
  highPass=getMaterial(HIGH_PASS_MATERIAL);
  addDesiredStateChange(new EnableMaterial(HIGH_PASS_MATERIAL));
  int textureSlot=0;
  addDesiredStateChange(new SetInputTextureFromFBO(textureSlot,READONLY_GBUFFER,ColorTexture,displayResolutionDependentFBOs,HIGH_PASS_MATERIAL,"String_Node_Str"));
}
Program: 493
Project: 493
Buggy source:
public LightShaftsNode(Context context){
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.LIGHT_SHAFTS,this);
  requiresCondition(renderingConfig::isLightShafts);
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(LIGHT_SHAFTS_FBO,HALF_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(LIGHT_SHAFTS_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(LIGHT_SHAFTS_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new EnableMaterial(LIGHT_SHAFTS_MATERIAL));
}

Fixed version (ground truth):
public LightShaftsNode(Context context){
  super(context);
  RenderingConfig renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.LIGHT_SHAFTS,this);
  requiresCondition(renderingConfig::isLightShafts);
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(LIGHT_SHAFTS_FBO,HALF_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(LIGHT_SHAFTS_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(LIGHT_SHAFTS_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new EnableMaterial(LIGHT_SHAFTS_MATERIAL));
}
Program: 494
Project: 494
Buggy source:
public OutlineNode(Context context){
  renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.OUTLINE,this);
  requiresCondition(() -> renderingConfig.isOutline());
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(OUTLINE_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(OUTLINE_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new EnableMaterial(OUTLINE_MATERIAL));
}

Fixed version (ground truth):
public OutlineNode(Context context){
  super(context);
  renderingConfig=context.get(Config.class).getRendering();
  renderingConfig.subscribe(RenderingConfig.OUTLINE,this);
  requiresCondition(() -> renderingConfig.isOutline());
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(OUTLINE_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(OUTLINE_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new EnableMaterial(OUTLINE_MATERIAL));
}
Program: 495
Project: 495
Buggy source:
public ShadowMapNode(Context context){
  renderQueues=context.get(RenderQueuesHelper.class);
  backdropProvider=context.get(BackdropProvider.class);
  worldRenderer=context.get(WorldRenderer.class);
  this.playerCamera=worldRenderer.getActiveCamera();
  this.renderingConfig=context.get(Config.class).getRendering();
  context.get(RenderableWorld.class).setShadowMapCamera(shadowMapCamera);
  texelSize=1.0f / renderingConfig.getShadowMapResolution() * 2.0f;
  renderingConfig.subscribe(RenderingConfig.SHADOW_MAP_RESOLUTION,this);
  requiresCondition(() -> renderingConfig.isDynamicShadows());
  renderingConfig.subscribe(RenderingConfig.DYNAMIC_SHADOWS,this);
  ShadowMapResolutionDependentFBOs shadowMapResolutionDependentFBOs=context.get(ShadowMapResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(SHADOW_MAP_FBO,FBO.Type.NO_COLOR).useDepthBuffer(),shadowMapResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(SHADOW_MAP_FBO,shadowMapResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(SHADOW_MAP_FBO,shadowMapResolutionDependentFBOs));
  addDesiredStateChange(new EnableMaterial(SHADOW_MAP_MATERIAL));
}

Fixed version (ground truth):
public ShadowMapNode(Context context){
  super(context);
  renderQueues=context.get(RenderQueuesHelper.class);
  backdropProvider=context.get(BackdropProvider.class);
  worldRenderer=context.get(WorldRenderer.class);
  this.playerCamera=worldRenderer.getActiveCamera();
  this.renderingConfig=context.get(Config.class).getRendering();
  context.get(RenderableWorld.class).setShadowMapCamera(shadowMapCamera);
  texelSize=1.0f / renderingConfig.getShadowMapResolution() * 2.0f;
  renderingConfig.subscribe(RenderingConfig.SHADOW_MAP_RESOLUTION,this);
  requiresCondition(() -> renderingConfig.isDynamicShadows());
  renderingConfig.subscribe(RenderingConfig.DYNAMIC_SHADOWS,this);
  ShadowMapResolutionDependentFBOs shadowMapResolutionDependentFBOs=context.get(ShadowMapResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(SHADOW_MAP_FBO,FBO.Type.NO_COLOR).useDepthBuffer(),shadowMapResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(SHADOW_MAP_FBO,shadowMapResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(SHADOW_MAP_FBO,shadowMapResolutionDependentFBOs));
  addDesiredStateChange(new EnableMaterial(SHADOW_MAP_MATERIAL));
}
Program: 496
Project: 496
Buggy source:
/** 
 * Constructs an instance of this class. Internally requires the "engine:sceneReflected" buffer, stored in the (display) resolution-dependent FBO manager. This is a default, half-scale buffer inclusive of a depth buffer FBO. See FBOConfig and ScalingFactors for details on possible FBO configurations. This method also requests the material using the "chunk" shaders (vertex, fragment) to be enabled.
 */
public WorldReflectionNode(Context context){
  renderQueues=context.get(RenderQueuesHelper.class);
  worldRenderer=context.get(WorldRenderer.class);
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new ReflectedCamera(playerCamera));
  addDesiredStateChange(new LookThrough(playerCamera));
  renderingConfig=context.get(Config.class).getRendering();
  requiresCondition(() -> renderingConfig.isReflectiveWater());
  renderingConfig.subscribe(RenderingConfig.REFLECTIVE_WATER,this);
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(REFLECTED_FBO,HALF_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(REFLECTED_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(REFLECTED_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new EnableFaceCulling());
  addDesiredStateChange(new SetFacesToCull(GL_FRONT));
  addDesiredStateChange(new EnableMaterial(CHUNK_MATERIAL));
  chunkMaterial=getMaterial(CHUNK_MATERIAL);
}

Fixed version (ground truth):
/** 
 * Constructs an instance of this class. Internally requires the "engine:sceneReflected" buffer, stored in the (display) resolution-dependent FBO manager. This is a default, half-scale buffer inclusive of a depth buffer FBO. See FBOConfig and ScalingFactors for details on possible FBO configurations. This method also requests the material using the "chunk" shaders (vertex, fragment) to be enabled.
 */
public WorldReflectionNode(Context context){
  super(context);
  renderQueues=context.get(RenderQueuesHelper.class);
  worldRenderer=context.get(WorldRenderer.class);
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new ReflectedCamera(playerCamera));
  addDesiredStateChange(new LookThrough(playerCamera));
  renderingConfig=context.get(Config.class).getRendering();
  requiresCondition(() -> renderingConfig.isReflectiveWater());
  renderingConfig.subscribe(RenderingConfig.REFLECTIVE_WATER,this);
  DisplayResolutionDependentFBOs displayResolutionDependentFBOs=context.get(DisplayResolutionDependentFBOs.class);
  requiresFBO(new FBOConfig(REFLECTED_FBO,HALF_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(REFLECTED_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(REFLECTED_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new EnableFaceCulling());
  addDesiredStateChange(new SetFacesToCull(GL_FRONT));
  addDesiredStateChange(new EnableMaterial(CHUNK_MATERIAL));
  chunkMaterial=getMaterial(CHUNK_MATERIAL);
}
Program: 497
Project: 497
Buggy source:
@ReceiveEvent(components=LocationComponent.class,netFilter=RegisterMode.AUTHORITY) public void onAttackRequest(AttackRequest event,EntityRef character,CharacterComponent characterComponent){
  if (event.getItem().exists()) {
    if (!character.equals(event.getItem().getOwner())) {
      return;
    }
  }
  OnItemUseEvent onItemUseEvent=new OnItemUseEvent();
  character.send(onItemUseEvent);
  if (!onItemUseEvent.isConsumed()) {
    Vector3i position=targetSystem.getTargetBlockPosition();
    if (position == null) {
      return;
    }
    EntityRef targetEntity=blockRegistry.getBlockEntityAt(position);
    targetEntity.send(new AttackEvent(character,event.getItem()));
  }
}

Fixed version (ground truth):
@ReceiveEvent(components=LocationComponent.class,netFilter=RegisterMode.AUTHORITY) public void onAttackRequest(AttackRequest event,EntityRef character,CharacterComponent characterComponent){
  if (event.getItem().exists()) {
    if (!character.equals(event.getItem().getOwner())) {
      return;
    }
  }
  OnItemUseEvent onItemUseEvent=new OnItemUseEvent();
  character.send(onItemUseEvent);
  if (!onItemUseEvent.isConsumed()) {
    EntityRef targetEntity=targetSystem.getTarget();
    if (targetEntity.exists()) {
      targetEntity.send(new AttackEvent(character,event.getItem()));
      return;
    }
    Vector3i position=targetSystem.getTargetBlockPosition();
    if (position == null) {
      return;
    }
    EntityRef targetBlockEntity=blockRegistry.getBlockEntityAt(position);
    targetBlockEntity.send(new AttackEvent(character,event.getItem()));
  }
}
Program: 498
Project: 498
Buggy source:
public UpdateExposureNode(Context context){
  renderingConfig=context.get(Config.class).getRendering();
  downSampledScene=requiresFBO(DownSamplerForExposureNode.FBO_1X1_CONFIG,context.get(ImmutableFBOs.class));
  writeOnlyPBO=new PBO(1,1);
}

Fixed version (ground truth):
public UpdateExposureNode(Context context){
  backdropProvider=context.get(BackdropProvider.class);
  screenGrabber=context.get(ScreenGrabber.class);
  renderingConfig=context.get(Config.class).getRendering();
  downSampledScene=requiresFBO(DownSamplerForExposureNode.FBO_1X1_CONFIG,context.get(ImmutableFBOs.class));
  writeOnlyPBO=new PBO(1,1);
}
Program: 499
Project: 499
Buggy source:
private void processInput(EntityRef entity,CharacterMovementComponent characterMovementComponent){
  lookYaw=(lookYaw - lookYawDelta) % 360;
  lookYawDelta=0f;
  lookPitch=TeraMath.clamp(lookPitch + lookPitchDelta,-89,89);
  lookPitchDelta=0f;
  Vector3f relMove=new Vector3f(relativeMovement);
  relMove.y=0;
  Quat4f viewRotation;
switch (characterMovementComponent.mode) {
case WALKING:
    if (!config.getRendering().isVrSupport()) {
      viewRotation=new Quat4f(TeraMath.DEG_TO_RAD * lookYaw,0,0);
      playerCamera.setOrientation(viewRotation);
    }
  playerCamera.getOrientation().rotate(relMove,relMove);
break;
case CLIMBING:
relMove.y+=relativeMovement.y;
break;
default :
if (!config.getRendering().isVrSupport()) {
viewRotation=new Quat4f(TeraMath.DEG_TO_RAD * lookYaw,TeraMath.DEG_TO_RAD * lookPitch,0);
playerCamera.setOrientation(viewRotation);
}
playerCamera.getOrientation().rotate(relMove,relMove);
relMove.y+=relativeMovement.y;
break;
}
entity.send(new CharacterMoveInputEvent(inputSequenceNumber++,lookPitch,lookYaw,relMove,run,jump,time.getGameDeltaInMs()));
jump=false;
}

Fixed version (ground truth):
private void processInput(EntityRef entity,CharacterMovementComponent characterMovementComponent){
  lookYaw=(lookYaw - lookYawDelta) % 360;
  lookYawDelta=0f;
  lookPitch=TeraMath.clamp(lookPitch + lookPitchDelta,-89,89);
  lookPitchDelta=0f;
  Vector3f relMove=new Vector3f(relativeMovement);
  relMove.y=0;
  Quat4f viewRotation;
switch (characterMovementComponent.mode) {
case WALKING:
    if (!config.getRendering().isVrSupport()) {
      viewRotation=new Quat4f(TeraMath.DEG_TO_RAD * lookYaw,0,0);
      playerCamera.setOrientation(viewRotation);
    }
  playerCamera.getOrientation().rotate(relMove,relMove);
break;
case CLIMBING:
relMove.y+=relativeMovement.y;
break;
default :
if (!config.getRendering().isVrSupport()) {
viewRotation=new Quat4f(TeraMath.DEG_TO_RAD * lookYaw,TeraMath.DEG_TO_RAD * lookPitch,0);
playerCamera.setOrientation(viewRotation);
}
playerCamera.getOrientation().rotate(relMove,relMove);
relMove.y+=relativeMovement.y;
break;
}
if (!Float.isNaN(relMove.getX()) && !Float.isNaN(relMove.getY()) && !Float.isNaN(relMove.getZ())) {
entity.send(new CharacterMoveInputEvent(inputSequenceNumber++,lookPitch,lookYaw,relMove,run,jump,time.getGameDeltaInMs()));
}
jump=false;
}
Program: 500
Project: 500
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneFinalFbo.bindTexture();
  renderFullscreenQuad();
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneFinalFbo.bindTexture();
  glViewport(0,0,displayWidth,displayHeight);
  renderFullscreenQuad();
  PerformanceMonitor.endActivity();
}
Program: 501
Project: 501
Buggy source:
@Override public void update(){
  sceneFinalFbo=displayResolutionDependentFBOs.get(FINAL_BUFFER);
}

Fixed version (ground truth):
@Override public void update(){
  sceneFinalFbo=displayResolutionDependentFBOs.get(FINAL_BUFFER);
  displayWidth=Display.getWidth();
  displayHeight=Display.getHeight();
}
Program: 502
Project: 502
Buggy source:
/** 
 * Renders the world's semi-transparent blocks, i.e. tree foliage and terrain plants. Does not render fully opaque blocks, i.e. the typical landscape blocks. Takes advantage of the two methods - WorldRenderer.increaseTrianglesCount(int) - WorldRenderer.increaseNotReadyChunkCount(int) to publish some statistics over its own activity.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  final Vector3f cameraPosition=playerCamera.getPosition();
  int numberOfRenderedTriangles=0;
  int numberOfChunksThatAreNotReadyYet=0;
  sceneOpaqueFbo.bind();
  chunkShader.setFloat("String_Node_Str",0.0f,true);
  chunkShader.activateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT);
  while (renderQueues.chunksAlphaReject.size() > 0) {
    RenderableChunk chunk=renderQueues.chunksAlphaReject.poll();
    if (chunk.hasMesh()) {
      final ChunkMesh chunkMesh=chunk.getMesh();
      final Vector3f chunkPosition=chunk.getPosition().toVector3f();
      chunkMesh.updateMaterial(chunkShader,chunkPosition,chunk.isAnimated());
      numberOfRenderedTriangles+=chunkMesh.render(ALPHA_REJECT,chunkPosition,cameraPosition);
    }
 else {
      numberOfChunksThatAreNotReadyYet++;
    }
  }
  chunkShader.deactivateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT);
  worldRenderer.increaseTrianglesCount(numberOfRenderedTriangles);
  worldRenderer.increaseNotReadyChunkCount(numberOfChunksThatAreNotReadyYet);
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
/** 
 * Renders the world's semi-transparent blocks, i.e. tree foliage and terrain plants. Does not render fully opaque blocks, i.e. the typical landscape blocks. Takes advantage of the two methods - WorldRenderer.increaseTrianglesCount(int) - WorldRenderer.increaseNotReadyChunkCount(int) to publish some statistics over its own activity.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  final Vector3f cameraPosition=playerCamera.getPosition();
  int numberOfRenderedTriangles=0;
  int numberOfChunksThatAreNotReadyYet=0;
  readOnlyGBufferFBO.bind();
  chunkShader.setFloat("String_Node_Str",0.0f,true);
  chunkShader.activateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT);
  while (renderQueues.chunksAlphaReject.size() > 0) {
    RenderableChunk chunk=renderQueues.chunksAlphaReject.poll();
    if (chunk.hasMesh()) {
      final ChunkMesh chunkMesh=chunk.getMesh();
      final Vector3f chunkPosition=chunk.getPosition().toVector3f();
      chunkMesh.updateMaterial(chunkShader,chunkPosition,chunk.isAnimated());
      numberOfRenderedTriangles+=chunkMesh.render(ALPHA_REJECT,chunkPosition,cameraPosition);
    }
 else {
      numberOfChunksThatAreNotReadyYet++;
    }
  }
  chunkShader.deactivateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT);
  worldRenderer.increaseTrianglesCount(numberOfRenderedTriangles);
  worldRenderer.increaseNotReadyChunkCount(numberOfChunksThatAreNotReadyYet);
  PerformanceMonitor.endActivity();
}
Program: 503
Project: 503
Buggy source:
/** 
 * Initialises the node. -Must- be called once after instantiation.
 */
@Override public void initialise(){
  wireframeStateChange=new SetWireframe(true);
  renderingDebugConfig=config.getRendering().getDebug();
  new WireframeTrigger(renderingDebugConfig,this);
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new LookThrough(playerCamera));
  addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER,displayResolutionDependentFBOs));
  sceneOpaqueFbo=displayResolutionDependentFBOs.get(READONLY_GBUFFER);
  addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString()));
  chunkShader=getMaterial(CHUNK_SHADER);
}

Fixed version (ground truth):
/** 
 * Initialises the node. -Must- be called once after instantiation.
 */
@Override public void initialise(){
  wireframeStateChange=new SetWireframe(true);
  renderingDebugConfig=config.getRendering().getDebug();
  new WireframeTrigger(renderingDebugConfig,this);
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new LookThrough(playerCamera));
  addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER,displayResolutionDependentFBOs));
  update();
  addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString()));
  chunkShader=getMaterial(CHUNK_SHADER);
  displayResolutionDependentFBOs.subscribe(this);
}
Program: 504
Project: 504
Buggy source:
/** 
 * This method must be called once shortly after instantiation to fully initialize the node and make it ready for rendering.
 */
@Override public void initialise(){
  RenderingConfig renderingConfig=config.getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_MATERIAL.toString()));
  ssaoMaterial=getMaterial(SSAO_MATERIAL);
  requiresFBO(new FBOConfig(SSAO_FBO,FULL_SCALE,FBO.Type.DEFAULT),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(SSAO_FBO,displayResolutionDependentFBOs));
  addDesiredStateChange(new SetViewportToSizeOf(SSAO_FBO,displayResolutionDependentFBOs));
  displayResolutionDependentFBOs.subscribe(this);
  update();
}

Fixed version (ground truth):
/** 
 * This method must be called once shortly after instantiation to fully initialize the node and make it ready for rendering.
 */
@Override public void initialise(){
  RenderingConfig renderingConfig=config.getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_MATERIAL.toString()));
  ssaoMaterial=getMaterial(SSAO_MATERIAL);
  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: 505
Project: 505
Buggy source:
/** 
 * Renders the backdrop of the scene - in this implementation: the skysphere.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaqueFbo.bind();
  sceneOpaqueFbo.setRenderBufferMask(true,false,false);
  glCallList(skySphere);
  sceneOpaqueFbo.setRenderBufferMask(true,true,true);
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
/** 
 * Renders the backdrop of the scene - in this implementation: the skysphere.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  readOnlyGBufferFBO.bind();
  readOnlyGBufferFBO.setRenderBufferMask(true,false,false);
  glCallList(skySphere);
  readOnlyGBufferFBO.setRenderBufferMask(true,true,true);
  PerformanceMonitor.endActivity();
}
Program: 506
Project: 506
Buggy source:
/** 
 * This method must be called once shortly after instantiation to fully initialize the node and make it ready for rendering.
 */
@Override public void initialise(){
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new LookThroughNormalized(playerCamera));
  initSkysphere(playerCamera.getzFar() < RADIUS ? playerCamera.getzFar() : RADIUS);
  wireframeStateChange=new SetWireframe(true);
  RenderingDebugConfig renderingDebugConfig=config.getRendering().getDebug();
  new WireframeTrigger(renderingDebugConfig,this);
  addDesiredStateChange(new SetViewportToSizeOf(WRITEONLY_GBUFFER,displayResolutionDependentFBOs));
  sceneOpaqueFbo=displayResolutionDependentFBOs.get(READONLY_GBUFFER);
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
  addDesiredStateChange(new DisableDepthWriting());
  addDesiredStateChange(new EnableFaceCulling());
  addDesiredStateChange(new SetFacesToCull(GL_FRONT));
}

Fixed version (ground truth):
/** 
 * This method must be called once shortly after instantiation to fully initialize the node and make it ready for rendering.
 */
@Override public void initialise(){
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new LookThroughNormalized(playerCamera));
  initSkysphere(playerCamera.getzFar() < RADIUS ? playerCamera.getzFar() : RADIUS);
  wireframeStateChange=new SetWireframe(true);
  RenderingDebugConfig renderingDebugConfig=config.getRendering().getDebug();
  new WireframeTrigger(renderingDebugConfig,this);
  addDesiredStateChange(new SetViewportToSizeOf(WRITEONLY_GBUFFER,displayResolutionDependentFBOs));
  update();
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
  addDesiredStateChange(new DisableDepthWriting());
  addDesiredStateChange(new EnableFaceCulling());
  addDesiredStateChange(new SetFacesToCull(GL_FRONT));
  displayResolutionDependentFBOs.subscribe(this);
}
Program: 507
Project: 507
Buggy source:
/** 
 * Performs the blur.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str" + performanceMonitorLabel);
  blurMaterial.setFloat("String_Node_Str",blurRadius,true);
  blurMaterial.setFloat2("String_Node_Str",1.0f / outputFBO.width(),1.0f / outputFBO.height(),true);
  inputFBO.bindTexture();
  renderFullscreenQuad();
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
/** 
 * Performs the blur.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str" + performanceMonitorLabel);
  blurMaterial.setFloat("String_Node_Str",blurRadius,true);
  blurMaterial.setFloat2("String_Node_Str",1.0f / outputFbo.width(),1.0f / outputFbo.height(),true);
  inputFbo.bindTexture();
  renderFullscreenQuad();
  PerformanceMonitor.endActivity();
}
Program: 508
Project: 508
Buggy source:
@Override public void update(){
  inputFBO=fboManager.get(inputFBOConfig.getName());
  outputFBO=fboManager.get(outputFBOConfig.getName());
}

Fixed version (ground truth):
@Override public void update(){
  inputFbo=fboManager.get(inputFboUrn);
  outputFbo=fboManager.get(outputFboUrn);
}
Program: 509
Project: 509
Buggy source:
/** 
 * Initializes the BlurNode instance.
 * @param inputConfig an FBOConfig instance describing the input FBO, to be retrieved from the FBO manager
 * @param outputConfig an FBOConfig instance describing the output FBO, to be retrieved from the FBO manager
 * @param anfboManager the FBO manager from which to retrieve -both- FBOs.
 * @param aRadius the blur radius: higher values cause higher blur. The shader's default is 16.0f.
 * @param aLabel a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public void initialise(FBOConfig inputConfig,FBOConfig outputConfig,BaseFBOsManager anfboManager,float aRadius,String aLabel){
  this.inputFBOConfig=inputConfig;
  this.outputFBOConfig=outputConfig;
  this.fboManager=anfboManager;
  requiresFBO(inputFBOConfig,fboManager);
  requiresFBO(outputFBOConfig,fboManager);
  addDesiredStateChange(new BindFBO(outputFBOConfig.getName(),fboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFBOConfig.getName(),fboManager));
  inputFBO=fboManager.get(inputFBOConfig.getName());
  outputFBO=fboManager.get(outputFBOConfig.getName());
  fboManager.subscribe(this);
  setupConditions();
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
  this.blurMaterial=getMaterial(new ResourceUrn("String_Node_Str"));
  this.blurRadius=aRadius;
  this.performanceMonitorLabel=aLabel;
}

Fixed version (ground truth):
/** 
 * Initializes the 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 aRadius the blur radius: higher values cause higher blur. The shader's default is 16.0f.
 * @param aLabel a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public void initialise(FBOConfig inputFboConfig,FBOConfig outputFboConfig,BaseFBOsManager fboManager,float aRadius,String aLabel){
  this.fboManager=fboManager;
  this.blurRadius=aRadius;
  this.performanceMonitorLabel=aLabel;
  this.inputFboUrn=inputFboConfig.getName();
  this.outputFboUrn=outputFboConfig.getName();
  inputFbo=requiresFBO(inputFboConfig,fboManager);
  outputFbo=requiresFBO(outputFboConfig,fboManager);
  addDesiredStateChange(new BindFBO(outputFboUrn,fboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn,fboManager));
  setupConditions();
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
  this.blurMaterial=getMaterial(new ResourceUrn("String_Node_Str"));
  fboManager.subscribe(this);
}
Program: 510
Project: 510
Buggy source:
/** 
 * This method must be called once shortly after instantiation to fully initialize the node and make it ready for rendering.
 */
@Override public void initialise(){
  RenderingConfig renderingConfig=config.getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_BLURRED_MATERIAL.toString()));
  ssaoBlurredMaterial=getMaterial(SSAO_BLURRED_MATERIAL);
  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));
  addDesiredStateChange(new SetInputTextureFromFBO(TEXTURE_SLOT_0,SSAO_FBO,ColorTexture,displayResolutionDependentFBOs,SSAO_BLURRED_MATERIAL,"String_Node_Str"));
  displayResolutionDependentFBOs.subscribe(this);
  update();
}

Fixed version (ground truth):
/** 
 * This method must be called once shortly after instantiation to fully initialize the node and make it ready for rendering.
 */
@Override public void initialise(){
  RenderingConfig renderingConfig=config.getRendering();
  renderingConfig.subscribe(RenderingConfig.SSAO,this);
  requiresCondition(renderingConfig::isSsao);
  addDesiredStateChange(new EnableMaterial(SSAO_BLURRED_MATERIAL.toString()));
  ssaoBlurredMaterial=getMaterial(SSAO_BLURRED_MATERIAL);
  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();
  addDesiredStateChange(new SetInputTextureFromFBO(TEXTURE_SLOT_0,SSAO_FBO,ColorTexture,displayResolutionDependentFBOs,SSAO_BLURRED_MATERIAL,"String_Node_Str"));
  displayResolutionDependentFBOs.subscribe(this);
}
Program: 511
Project: 511
Buggy source:
private void renderFinalStereoImage(RenderingStage renderingStage){
switch (renderingStage) {
case LEFT_EYE:
    vrProvider.updateState();
  leftEye.bind();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
renderFullscreenQuad();
break;
case RIGHT_EYE:
rightEye.bind();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
renderFullscreenQuad();
vrProvider.submitFrame();
GL11.glFinish();
break;
}
}

Fixed version (ground truth):
private void renderFinalStereoImage(RenderingStage renderingStage){
switch (renderingStage) {
case LEFT_EYE:
    vrProvider.updateState();
  leftEyeFbo.bind();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
renderFullscreenQuad();
break;
case RIGHT_EYE:
rightEyeFbo.bind();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
renderFullscreenQuad();
vrProvider.submitFrame();
GL11.glFinish();
break;
}
}
Program: 512
Project: 512
Buggy source:
/** 
 * Perform the initialization of this node. Specifically, initialize the vrProvider and pass the frame buffer information for the vrProvider to use.
 */
@Override public void initialise(){
  sceneFinalFbo=displayResolutionDependentFBOs.get(FINAL_BUFFER);
  renderingConfig=config.getRendering();
  requiresCondition(() -> (renderingConfig.isVrSupport() && vrProvider.isInitialized()));
  leftEye=requiresFBO(new FBOConfig(LEFT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  rightEye=requiresFBO(new FBOConfig(RIGHT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  if (vrProvider != null) {
    vrProvider.texType[0].handle=leftEye.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=rightEye.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("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Perform the initialization of this node. Specifically, initialize the vrProvider and pass the frame buffer information for the vrProvider to use.
 */
@Override public void initialise(){
  sceneFinalFbo=displayResolutionDependentFBOs.get(FINAL_BUFFER);
  renderingConfig=config.getRendering();
  requiresCondition(() -> (renderingConfig.isVrSupport() && vrProvider.isInitialized()));
  leftEyeFbo=requiresFBO(new FBOConfig(LEFT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  rightEyeFbo=requiresFBO(new FBOConfig(RIGHT_EYE_FBO,FULL_SCALE,FBO.Type.DEFAULT).useDepthBuffer(),displayResolutionDependentFBOs);
  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("String_Node_Str"));
  displayResolutionDependentFBOs.subscribe(this);
}
Program: 513
Project: 513
Buggy source:
@Override public void initialise(){
  sceneFinalFbo=displayResolutionDependentFBOs.get(FINAL_BUFFER);
  requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE);
  addDesiredStateChange(new BindFBO(DEFAULT_FRAME_BUFFER_URN,displayResolutionDependentFBOs));
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void initialise(){
  requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE);
  addDesiredStateChange(new BindFBO(DEFAULT_FRAME_BUFFER_URN,displayResolutionDependentFBOs));
  update();
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
  displayResolutionDependentFBOs.subscribe(this);
}
Program: 514
Project: 514
Buggy source:
/** 
 * Initializes the 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 aRadius the blur radius: higher values cause higher blur. The shader's default is 16.0f.
 * @param aLabel a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public void initialise(FBOConfig inputFboConfig,FBOConfig outputFboConfig,BaseFBOsManager fboManager,float aRadius,String aLabel){
  this.fboManager=fboManager;
  this.blurRadius=aRadius;
  this.performanceMonitorLabel=aLabel;
  this.inputFboUrn=inputFboConfig.getName();
  this.outputFboUrn=outputFboConfig.getName();
  requiresFBO(inputFboConfig,fboManager);
  requiresFBO(outputFboConfig,fboManager);
  addDesiredStateChange(new BindFBO(outputFboUrn,fboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn,fboManager));
  update();
  fboManager.subscribe(this);
  setupConditions();
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
  this.blurMaterial=getMaterial(new ResourceUrn("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Initializes the 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 aRadius the blur radius: higher values cause higher blur. The shader's default is 16.0f.
 * @param aLabel a String to label the instance's entry in output generated by the PerformanceMonitor
 */
public void initialise(FBOConfig inputFboConfig,FBOConfig outputFboConfig,BaseFBOsManager fboManager,float aRadius,String aLabel){
  this.fboManager=fboManager;
  this.blurRadius=aRadius;
  this.performanceMonitorLabel=aLabel;
  this.inputFboUrn=inputFboConfig.getName();
  this.outputFboUrn=outputFboConfig.getName();
  setupConditions();
  requiresFBO(inputFboConfig,fboManager);
  requiresFBO(outputFboConfig,fboManager);
  addDesiredStateChange(new BindFBO(outputFboUrn,fboManager));
  addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn,fboManager));
  update();
  fboManager.subscribe(this);
  addDesiredStateChange(new EnableMaterial("String_Node_Str"));
  this.blurMaterial=getMaterial(new ResourceUrn("String_Node_Str"));
}
Program: 515
Project: 515
Buggy source:
private short getNextId(){
  if (nextId > MAX_ID) {
    return UNKNOWN_ID;
  }
  return (short)nextId++;
}

Fixed version (ground truth):
private short getNextId(){
  if (nextId.get() > MAX_ID) {
    return UNKNOWN_ID;
  }
  return (short)nextId.getAndIncrement();
}
Program: 516
Project: 516
Buggy source:
public void initialise(List<String> registeredBlockFamilies,Map<String,Short> knownBlockMappings){
  if (knownBlockMappings.size() >= MAX_ID) {
    nextId=UNKNOWN_ID;
  }
 else   if (knownBlockMappings.size() > 0) {
    nextId=(short)knownBlockMappings.size();
  }
  registeredBlockInfo.set(new RegisteredState());
  for (  String rawFamilyUri : registeredBlockFamilies) {
    try {
      BlockUri familyUri=new BlockUri(rawFamilyUri);
      Optional<BlockFamily> family=loadFamily(familyUri);
      if (family.isPresent()) {
        for (        Block block : family.get().getBlocks()) {
          Short id=knownBlockMappings.get(block.getURI().toString());
          if (id != null) {
            block.setId(id);
          }
 else {
            logger.error("String_Node_Str",block.getURI(),family.get().getURI());
            if (generateNewIds) {
              block.setId(getNextId());
            }
 else {
              block.setId(UNKNOWN_ID);
            }
          }
        }
        registerFamily(family.get());
      }
    }
 catch (    BlockUriParseException e) {
      logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void initialise(List<String> registeredBlockFamilies,Map<String,Short> knownBlockMappings){
  if (knownBlockMappings.size() >= MAX_ID) {
    nextId.set(UNKNOWN_ID);
  }
 else   if (knownBlockMappings.size() > 0) {
    nextId.set(knownBlockMappings.values().stream().max(Short::compareTo).orElse((short)0) + 1);
  }
  registeredBlockInfo.set(new RegisteredState());
  for (  String rawFamilyUri : registeredBlockFamilies) {
    try {
      BlockUri familyUri=new BlockUri(rawFamilyUri);
      Optional<BlockFamily> family=loadFamily(familyUri);
      if (family.isPresent()) {
        for (        Block block : family.get().getBlocks()) {
          Short id=knownBlockMappings.get(block.getURI().toString());
          if (id != null) {
            block.setId(id);
          }
 else {
            logger.error("String_Node_Str",block.getURI(),family.get().getURI());
            if (generateNewIds) {
              block.setId(getNextId());
            }
 else {
              block.setId(UNKNOWN_ID);
            }
          }
        }
        registerFamily(family.get());
      }
    }
 catch (    BlockUriParseException e) {
      logger.error("String_Node_Str",e);
    }
  }
}
Program: 517
Project: 517
Buggy source:
@Override public void update(){
  sceneOpaqueFbo.attachDepthBufferTo(refractiveReflectiveFbo);
}

Fixed version (ground truth):
@Override public void update(){
  sceneOpaqueFbo=displayResolutionDependentFBOs.get(READONLY_GBUFFER);
  refractiveReflectiveFbo=displayResolutionDependentFBOs.get(REFRACTIVE_REFLECTIVE);
  sceneOpaqueFbo.attachDepthBufferTo(refractiveReflectiveFbo);
}
Program: 518
Project: 518
Buggy source:
/** 
 * Initialises the node. -Must- be called once after instantiation.
 */
@Override public void initialise(){
  sceneOpaqueFbo=displayResolutionDependentFBOs.get(READONLY_GBUFFER);
  refractiveReflectiveFbo=displayResolutionDependentFBOs.get(REFRACTIVE_REFLECTIVE);
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new LookThrough(playerCamera));
  requiresFBO(new FBOConfig(REFRACTIVE_REFLECTIVE,FULL_SCALE,FBO.Type.HDR).useNormalBuffer(),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(REFRACTIVE_REFLECTIVE,displayResolutionDependentFBOs));
  displayResolutionDependentFBOs.subscribe(this);
  addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString()));
  chunkShader=getMaterial(CHUNK_SHADER);
}

Fixed version (ground truth):
/** 
 * Initialises the node. -Must- be called once after instantiation.
 */
@Override public void initialise(){
  playerCamera=worldRenderer.getActiveCamera();
  addDesiredStateChange(new LookThrough(playerCamera));
  requiresFBO(new FBOConfig(REFRACTIVE_REFLECTIVE,FULL_SCALE,FBO.Type.HDR).useNormalBuffer(),displayResolutionDependentFBOs);
  addDesiredStateChange(new BindFBO(REFRACTIVE_REFLECTIVE,displayResolutionDependentFBOs));
  sceneOpaqueFbo=displayResolutionDependentFBOs.get(READONLY_GBUFFER);
  refractiveReflectiveFbo=displayResolutionDependentFBOs.get(REFRACTIVE_REFLECTIVE);
  addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString()));
  chunkShader=getMaterial(CHUNK_SHADER);
  displayResolutionDependentFBOs.subscribe(this);
}
Program: 520
Project: 520
Buggy source:
public DisplayResolutionDependentFBOs(Context context){
  renderingConfig=context.get(Config.class).getRendering();
  screenGrabber=context.get(ScreenGrabber.class);
  updateFullScale();
  generateDefaultFBOs();
}

Fixed version (ground truth):
public DisplayResolutionDependentFBOs(Context context){
  renderingConfig=context.get(Config.class).getRendering();
  screenGrabber=context.get(ScreenGrabber.class);
  updateFullScale();
  generateDefaultFBOs();
  this.context=context;
}
Program: 521
Project: 521
Buggy source:
/** 
 * Invoked before real-rendering starts TODO: how about completely removing this, and make Display observable and this FBM as an observer
 */
public void update(){
  updateFullScale();
  if (get(new ResourceUrn("String_Node_Str")).dimensions().areDifferentFrom(fullScale)) {
    disposeAllFBOs();
    createFBOs();
    notifySubscribers();
  }
}

Fixed version (ground truth):
/** 
 * Invoked before real-rendering starts TODO: how about completely removing this, and make Display observable and this FBM as an observer
 */
public void update(){
  updateFullScale();
  if (get(new ResourceUrn("String_Node_Str")).dimensions().areDifferentFrom(fullScale)) {
    disposeAllFBOs();
    createFBOs();
    notifySubscribers();
    WorldRendererImpl worldRendererImpl=((WorldRendererImpl)context.get(WorldRenderer.class));
    worldRendererImpl.initRenderGraph();
  }
}
Program: 523
Project: 523
Buggy source:
private void handleController0(){
  if (switchedUp(ControllerListener.BUTTON_TRIGGER)) {
    addAction(ControllerId.ZERO,ButtonState.UP);
  }
 else   if (switchedDown(ControllerListener.BUTTON_TRIGGER)) {
    addAction(ControllerId.ZERO,ButtonState.DOWN);
  }
 else   if (switchedUp(ControllerListener.BUTTON_GRIP)) {
    addAction(ControllerId.ONE,ButtonState.UP);
  }
 else   if (switchedDown(ControllerListener.BUTTON_GRIP)) {
    addAction(ControllerId.ONE,ButtonState.DOWN);
  }
 else   if (switchedUp(ControllerListener.BUTTON_APP_MENU)) {
    addAction(ControllerId.TWO,ButtonState.UP);
  }
 else   if (switchedDown(ControllerListener.BUTTON_APP_MENU)) {
    addAction(ControllerId.TWO,ButtonState.DOWN);
  }
 else   if (switchedDown(ControllerListener.BUTTON_TOUCHPAD)) {
    addAction(ControllerId.X_AXIS,ButtonState.DOWN,-cachedStateAfter.rAxis[0].x);
    addAction(ControllerId.Y_AXIS,ButtonState.DOWN,cachedStateAfter.rAxis[0].y);
  }
 else   if (switchedUp(ControllerListener.BUTTON_TOUCHPAD)) {
    addAction(ControllerId.X_AXIS,ButtonState.UP,0.0f);
    addAction(ControllerId.Y_AXIS,ButtonState.UP,0.0f);
  }
}

Fixed version (ground truth):
private void handleController0(){
  if (switchedUp(ControllerListener.BUTTON_TRIGGER)) {
    addButtonAction(ControllerId.ZERO,ButtonState.UP);
  }
 else   if (switchedDown(ControllerListener.BUTTON_TRIGGER)) {
    addButtonAction(ControllerId.ZERO,ButtonState.DOWN);
  }
 else   if (switchedUp(ControllerListener.BUTTON_GRIP)) {
    addButtonAction(ControllerId.ONE,ButtonState.UP);
  }
 else   if (switchedDown(ControllerListener.BUTTON_GRIP)) {
    addButtonAction(ControllerId.ONE,ButtonState.DOWN);
  }
 else   if (switchedUp(ControllerListener.BUTTON_APP_MENU)) {
    addButtonAction(ControllerId.TWO,ButtonState.UP);
  }
 else   if (switchedDown(ControllerListener.BUTTON_APP_MENU)) {
    addButtonAction(ControllerId.TWO,ButtonState.DOWN);
  }
 else   if (switchedDown(ControllerListener.BUTTON_TOUCHPAD)) {
    addAxisAction(ControllerId.X_AXIS,ButtonState.DOWN,-cachedStateAfter.rAxis[0].x);
    addAxisAction(ControllerId.Y_AXIS,ButtonState.DOWN,cachedStateAfter.rAxis[0].y);
  }
 else   if (switchedUp(ControllerListener.BUTTON_TOUCHPAD)) {
    addAxisAction(ControllerId.X_AXIS,ButtonState.UP,0.0f);
    addAxisAction(ControllerId.Y_AXIS,ButtonState.UP,0.0f);
  }
}