nus-yam/ex-repair huggingface dataset:
Program: 587
Project: 587
Buggy source:
/** 
 * TODO: update javadocs This method triggers the execution of the rendering pipeline and, eventually, sends the output to the display or to a file, when grabbing a screenshot. In this particular implementation this method can be called once per frame, when rendering to a standard display, or twice, each time with a different rendering stage, when rendering to the OculusVR head mounted display. PerformanceMonitor.startActivity/endActivity statements are used in this method and in those it executes, to provide statistics regarding the ongoing rendering and its individual steps (i.e. rendering shadows, reflections, 2D filters...).
 * @param renderingStage "MONO" for standard rendering and "LEFT_EYE" or "RIGHT_EYE" for stereoscopic displays.
 */
@Override public void render(RenderingStage renderingStage){
  preRenderUpdate(renderingStage);
  renderPipelineTaskList.forEach(RenderPipelineTask::execute);
  playerCamera.updatePrevViewProjectionMatrix();
}

Fixed version (ground truth):
/** 
 * TODO: update javadocs This method triggers the execution of the rendering pipeline and, eventually, sends the output to the display or to a file, when grabbing a screenshot. In this particular implementation this method can be called once per frame, when rendering to a standard display, or twice, each time with a different rendering stage, when rendering to the OculusVR head mounted display. PerformanceMonitor.startActivity/endActivity statements are used in this method and in those it executes, to provide statistics regarding the ongoing rendering and its individual steps (i.e. rendering shadows, reflections, 2D filters...).
 * @param renderingStage "MONO" for standard rendering and "LEFT_EYE" or "RIGHT_EYE" for stereoscopic displays.
 */
@Override public void render(RenderingStage renderingStage){
  preRenderUpdate(renderingStage);
  glDisable(GL_CULL_FACE);
  renderPipelineTaskList.forEach(RenderPipelineTask::execute);
  LwjglGraphics.initOpenGLParams();
  playerCamera.updatePrevViewProjectionMatrix();
}
Program: 589
Project: 589
Buggy source:
private void invokeDelayedOperations(long currentWorldTime){
  List<EntityRef> operationsToInvoke=new LinkedList<>();
  Iterator<Long> scheduledOperationsIterator=delayedOperationsSortedByTime.keySet().iterator();
  long processedTime;
  while (scheduledOperationsIterator.hasNext()) {
    processedTime=scheduledOperationsIterator.next();
    if (processedTime > currentWorldTime) {
      break;
    }
    operationsToInvoke.addAll(delayedOperationsSortedByTime.get(processedTime));
    scheduledOperationsIterator.remove();
  }
  operationsToInvoke.stream().filter(EntityRef::exists).forEach(delayedEntity -> {
    final DelayedActionComponent delayedActions=delayedEntity.getComponent(DelayedActionComponent.class);
    if (delayedActions != null) {
      final Set<String> actionIds=delayedActions.removeActionsUpTo(currentWorldTime);
      saveOrRemoveComponent(delayedEntity,delayedActions);
      if (!delayedActions.isEmpty()) {
        delayedOperationsSortedByTime.put(delayedActions.getLowestWakeUp(),delayedEntity);
      }
      for (      String actionId : actionIds) {
        delayedEntity.send(new DelayedActionTriggeredEvent(actionId));
      }
    }
  }
);
}

Fixed version (ground truth):
private void invokeDelayedOperations(long currentWorldTime){
  List<EntityRef> operationsToInvoke=new LinkedList<>();
  Iterator<Long> scheduledOperationsIterator=delayedOperationsSortedByTime.keySet().iterator();
  long processedTime;
  while (scheduledOperationsIterator.hasNext()) {
    processedTime=scheduledOperationsIterator.next();
    if (processedTime > currentWorldTime) {
      break;
    }
    operationsToInvoke.addAll(delayedOperationsSortedByTime.get(processedTime));
    scheduledOperationsIterator.remove();
  }
  operationsToInvoke.stream().filter(EntityRef::exists).forEach(delayedEntity -> {
    final DelayedActionComponent delayedActions=delayedEntity.getComponent(DelayedActionComponent.class);
    if (delayedActions != null) {
      final Set<String> actionIds=delayedActions.removeActionsUpTo(currentWorldTime);
      saveOrRemoveComponent(delayedEntity,delayedActions);
      if (!delayedActions.isEmpty()) {
        delayedOperationsSortedByTime.put(delayedActions.getLowestWakeUp(),delayedEntity);
      }
      for (      String actionId : actionIds) {
        delayedEntity.send(new DelayedActionTriggeredEvent(actionId));
      }
    }
 else {
      logger.error("String_Node_Str" + "String_Node_Str",delayedEntity);
    }
  }
);
}
Program: 590
Project: 590
Buggy source:
private void invokePeriodicOperations(long currentWorldTime){
  List<EntityRef> operationsToInvoke=new LinkedList<>();
  Iterator<Long> scheduledOperationsIterator=periodicOperationsSortedByTime.keySet().iterator();
  long processedTime;
  while (scheduledOperationsIterator.hasNext()) {
    processedTime=scheduledOperationsIterator.next();
    if (processedTime > currentWorldTime) {
      break;
    }
    operationsToInvoke.addAll(periodicOperationsSortedByTime.get(processedTime));
    scheduledOperationsIterator.remove();
  }
  operationsToInvoke.stream().filter(EntityRef::exists).forEach(periodicEntity -> {
    final PeriodicActionComponent periodicActionComponent=periodicEntity.getComponent(PeriodicActionComponent.class);
    if (periodicActionComponent != null) {
      final Set<String> actionIds=periodicActionComponent.getTriggeredActionsAndReschedule(currentWorldTime);
      saveOrRemoveComponent(periodicEntity,periodicActionComponent);
      if (!periodicActionComponent.isEmpty()) {
        periodicOperationsSortedByTime.put(periodicActionComponent.getLowestWakeUp(),periodicEntity);
      }
      for (      String actionId : actionIds) {
        periodicEntity.send(new PeriodicActionTriggeredEvent(actionId));
      }
    }
  }
);
}

Fixed version (ground truth):
private void invokePeriodicOperations(long currentWorldTime){
  List<EntityRef> operationsToInvoke=new LinkedList<>();
  Iterator<Long> scheduledOperationsIterator=periodicOperationsSortedByTime.keySet().iterator();
  long processedTime;
  while (scheduledOperationsIterator.hasNext()) {
    processedTime=scheduledOperationsIterator.next();
    if (processedTime > currentWorldTime) {
      break;
    }
    operationsToInvoke.addAll(periodicOperationsSortedByTime.get(processedTime));
    scheduledOperationsIterator.remove();
  }
  operationsToInvoke.stream().filter(EntityRef::exists).forEach(periodicEntity -> {
    final PeriodicActionComponent periodicActionComponent=periodicEntity.getComponent(PeriodicActionComponent.class);
    if (periodicActionComponent != null) {
      final Set<String> actionIds=periodicActionComponent.getTriggeredActionsAndReschedule(currentWorldTime);
      saveOrRemoveComponent(periodicEntity,periodicActionComponent);
      if (!periodicActionComponent.isEmpty()) {
        periodicOperationsSortedByTime.put(periodicActionComponent.getLowestWakeUp(),periodicEntity);
      }
      for (      String actionId : actionIds) {
        periodicEntity.send(new PeriodicActionTriggeredEvent(actionId));
      }
    }
 else {
      logger.error("String_Node_Str" + "String_Node_Str",periodicEntity);
    }
  }
);
}
Program: 591
Project: 591
Buggy source:
@Override public void drawLine(int startX,int startY,int endX,int endY,Color color){
  Rect2i region=Rect2i.createFromMinAndMax(Math.min(startX,endX),Math.min(startY,endY),Math.max(startX,endX),Math.max(startY,endY));
  Rect2i absoluteRegion=relativeToAbsolute(region);
  Rect2i finalRegion=state.cropRegion.intersect(absoluteRegion);
  if (!finalRegion.isEmpty()) {
    int sx=finalRegion.minX();
    int sy=finalRegion.minY();
    int ex=finalRegion.maxX();
    int ey=finalRegion.maxY();
    if (state.drawOnTop) {
      drawOnTopOperations.add(new DrawLineOperation(sx,sy,ex,ey,color));
    }
 else {
      renderer.drawLine(sx,sy,ex,ey,color);
    }
  }
}

Fixed version (ground truth):
@Override public void drawLine(int startX,int startY,int endX,int endY,Color color){
  Rect2i region=Rect2i.createFromMinAndMax(Math.min(startX,endX),Math.min(startY,endY),Math.max(startX,endX),Math.max(startY,endY));
  Rect2i absoluteRegion=relativeToAbsolute(region);
  Rect2i finalRegion=state.cropRegion.intersect(absoluteRegion);
  if (!finalRegion.isEmpty()) {
    int sx=startX >= endX ? finalRegion.minX() : finalRegion.maxX();
    int sy=startY >= endY ? finalRegion.minY() : finalRegion.maxY();
    int ex=startX >= endX ? finalRegion.maxX() : finalRegion.minX();
    int ey=startY >= endY ? finalRegion.maxY() : finalRegion.minY();
    if (state.drawOnTop) {
      drawOnTopOperations.add(new DrawLineOperation(sx,sy,ex,ey,color));
    }
 else {
      renderer.drawLine(sx,sy,ex,ey,color);
    }
  }
}
Program: 592
Project: 592
Buggy source:
@Override public void drawLine(int startX,int startY,int endX,int endY,Color color){
  Rect2i region=Rect2i.createFromMinAndMax(Math.min(startX,endX),Math.min(startY,endY),Math.max(startX,endX),Math.max(startY,endY));
  Rect2i absoluteRegion=relativeToAbsolute(region);
  Rect2i finalRegion=state.cropRegion.intersect(absoluteRegion);
  if (!finalRegion.isEmpty()) {
    int sx=finalRegion.minX();
    int sy=finalRegion.minY();
    int ex=finalRegion.maxX();
    int ey=finalRegion.maxY();
    if (state.drawOnTop) {
      drawOnTopOperations.add(new DrawLineOperation(sx,sy,ex,ey,color));
    }
 else {
      renderer.drawLine(sx,sy,ex,ey,color);
    }
  }
}

Fixed version (ground truth):
@Override public void drawLine(int startX,int startY,int endX,int endY,Color color){
  Rect2i region=Rect2i.createFromMinAndMax(Math.min(startX,endX),Math.min(startY,endY),Math.max(startX,endX),Math.max(startY,endY));
  Rect2i absoluteRegion=relativeToAbsolute(region);
  Rect2i finalRegion=state.cropRegion.intersect(absoluteRegion);
  if (!finalRegion.isEmpty()) {
    int sx=startX >= endX ? finalRegion.minX() : finalRegion.maxX();
    int sy=startY >= endY ? finalRegion.minY() : finalRegion.maxY();
    int ex=startX >= endX ? finalRegion.maxX() : finalRegion.minX();
    int ey=startY >= endY ? finalRegion.maxY() : finalRegion.minY();
    if (state.drawOnTop) {
      drawOnTopOperations.add(new DrawLineOperation(sx,sy,ex,ey,color));
    }
 else {
      renderer.drawLine(sx,sy,ex,ey,color);
    }
  }
}
Program: 593
Project: 593
Buggy source:
/** 
 * Resets the editor based on the state of the autosave file.
 */
protected void loadAutosave(){
  if (!disableAutosave) {
    try (JsonReader reader=new JsonReader(new InputStreamReader(Files.newInputStream(getAutosaveFile())))){
      reader.setLenient(true);
      String autosaveString=new JsonParser().parse(reader).toString();
      JsonObject autosaveObject=new JsonParser().parse(autosaveString).getAsJsonObject();
      String selectedAsset=autosaveObject.get("String_Node_Str").getAsString();
      setSelectedAsset(selectedAsset);
      JsonTree editorContents=JsonTreeConverter.serialize(autosaveObject.get("String_Node_Str"));
      resetState(editorContents);
      setUnsavedChangesPresent(true);
    }
 catch (    NoSuchFileException ignored) {
    }
catch (    IOException e) {
      logger.warn("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Resets the editor based on the state of the autosave file.
 */
protected void loadAutosave(){
  if (!disableAutosave) {
    try (JsonReader reader=new JsonReader(new InputStreamReader(Files.newInputStream(getAutosaveFile())))){
      reader.setLenient(true);
      String autosaveString=new JsonParser().parse(reader).toString();
      JsonObject autosaveObject=new JsonParser().parse(autosaveString).getAsJsonObject();
      String selectedAsset=autosaveObject.get("String_Node_Str").getAsString();
      setSelectedAsset(selectedAsset);
      try {
        ResourceUrn urn=new ResourceUrn(selectedAsset);
        setSelectedAssetPath(urn);
      }
 catch (      InvalidUrnException ignored) {
      }
      JsonTree editorContents=JsonTreeConverter.serialize(autosaveObject.get("String_Node_Str"));
      resetState(editorContents);
      setUnsavedChangesPresent(true);
    }
 catch (    NoSuchFileException ignored) {
    }
catch (    IOException e) {
      logger.warn("String_Node_Str",e);
    }
  }
}
Program: 594
Project: 594
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void selectAsset(ResourceUrn urn){
  boolean isLoaded=assetManager.isLoaded(urn,UIElement.class);
  Optional<UIElement> asset=assetManager.getAsset(urn,UIElement.class);
  if (asset.isPresent()) {
    UIElement element=asset.get();
    if (!isLoaded) {
      asset.get().dispose();
    }
    AssetDataFile source=element.getSource();
    List<String> path=source.getPath();
    Name moduleName=new Name(path.get(0));
    if (moduleManager.getEnvironment().get(moduleName) instanceof PathModule) {
      path.add(source.getFilename());
      String[] pathArray=path.toArray(new String[path.size()]);
      String first=pathArray[0];
      String[] more=Arrays.copyOfRange(pathArray,1,pathArray.length);
      selectedAssetPath=moduleManager.getEnvironment().getFileSystem().getPath(first,more);
    }
    String content=null;
    try (JsonReader reader=new JsonReader(new InputStreamReader(source.openStream(),Charsets.UTF_8))){
      reader.setLenient(true);
      content=new JsonParser().parse(reader).toString();
    }
 catch (    IOException e) {
      logger.error(String.format("String_Node_Str",urn.toString()),e);
    }
    if (content != null) {
      JsonTree node=JsonTreeConverter.serialize(new JsonParser().parse(content));
      selectedAssetPending=urn.toString();
      resetState(node);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void selectAsset(ResourceUrn urn){
  boolean isLoaded=assetManager.isLoaded(urn,UIElement.class);
  Optional<UIElement> asset=assetManager.getAsset(urn,UIElement.class);
  if (asset.isPresent()) {
    UIElement element=asset.get();
    if (!isLoaded) {
      asset.get().dispose();
    }
    AssetDataFile source=element.getSource();
    String content=null;
    try (JsonReader reader=new JsonReader(new InputStreamReader(source.openStream(),Charsets.UTF_8))){
      reader.setLenient(true);
      content=new JsonParser().parse(reader).toString();
    }
 catch (    IOException e) {
      logger.error(String.format("String_Node_Str",urn.toString()),e);
    }
    if (content != null) {
      JsonTree node=JsonTreeConverter.serialize(new JsonParser().parse(content));
      selectedAssetPending=urn.toString();
      resetState(node);
    }
  }
}
Program: 595
Project: 595
Buggy source:
@Override protected void resetStateInternal(JsonTree node){
  getEditor().setTreeViewModel(node,true);
  resetPreviewWidget();
  getEditor().clearHistory();
  updateConfig();
  selectedAsset=selectedAssetPending;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void resetStateInternal(JsonTree node){
  getEditor().setTreeViewModel(node,true);
  resetPreviewWidget();
  getEditor().clearHistory();
  updateConfig();
  selectedAsset=selectedAssetPending;
  try {
    ResourceUrn urn=new ResourceUrn(selectedAsset);
    setSelectedAssetPath(urn);
  }
 catch (  InvalidUrnException ignored) {
  }
}
Program: 596
Project: 596
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void selectAsset(ResourceUrn urn){
  boolean isLoaded=assetManager.isLoaded(urn,UISkin.class);
  Optional<UISkin> asset=assetManager.getAsset(urn,UISkin.class);
  if (asset.isPresent()) {
    UISkin skin=asset.get();
    if (!isLoaded) {
      asset.get().dispose();
    }
    AssetDataFile source=skin.getSource();
    List<String> path=source.getPath();
    Name moduleName=new Name(path.get(0));
    if (moduleManager.getEnvironment().get(moduleName) instanceof PathModule) {
      path.add(source.getFilename());
      String[] pathArray=path.toArray(new String[path.size()]);
      String first=pathArray[0];
      String[] more=Arrays.copyOfRange(pathArray,1,pathArray.length);
      selectedAssetPath=moduleManager.getEnvironment().getFileSystem().getPath(first,more);
    }
    String content=null;
    try (JsonReader reader=new JsonReader(new InputStreamReader(source.openStream(),Charsets.UTF_8))){
      reader.setLenient(true);
      content=new JsonParser().parse(reader).toString();
    }
 catch (    IOException e) {
      logger.error(String.format("String_Node_Str",urn.toString()),e);
    }
    if (content != null) {
      JsonTree node=JsonTreeConverter.serialize(new JsonParser().parse(content));
      selectedAssetPending=urn.toString();
      resetState(node);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void selectAsset(ResourceUrn urn){
  boolean isLoaded=assetManager.isLoaded(urn,UISkin.class);
  Optional<UISkin> asset=assetManager.getAsset(urn,UISkin.class);
  if (asset.isPresent()) {
    UISkin skin=asset.get();
    if (!isLoaded) {
      asset.get().dispose();
    }
    AssetDataFile source=skin.getSource();
    String content=null;
    try (JsonReader reader=new JsonReader(new InputStreamReader(source.openStream(),Charsets.UTF_8))){
      reader.setLenient(true);
      content=new JsonParser().parse(reader).toString();
    }
 catch (    IOException e) {
      logger.error(String.format("String_Node_Str",urn.toString()),e);
    }
    if (content != null) {
      JsonTree node=JsonTreeConverter.serialize(new JsonParser().parse(content));
      selectedAssetPending=urn.toString();
      resetState(node);
    }
  }
}
Program: 597
Project: 597
Buggy source:
@Override protected void resetStateInternal(JsonTree node){
  getEditor().setTreeViewModel(node,true);
  resetPreviewWidget();
  getEditor().clearHistory();
  updateConfig();
  selectedAsset=selectedAssetPending;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void resetStateInternal(JsonTree node){
  getEditor().setTreeViewModel(node,true);
  resetPreviewWidget();
  getEditor().clearHistory();
  updateConfig();
  selectedAsset=selectedAssetPending;
  try {
    ResourceUrn urn=new ResourceUrn(selectedAsset);
    setSelectedAssetPath(urn);
  }
 catch (  InvalidUrnException ignored) {
  }
}
Program: 601
Project: 601
Buggy source:
@Override public List<Property<?>> getProperties(){
  List<Property<?>> result=Lists.newArrayList();
  GameState gameState=engine.getState();
  if (!(gameState instanceof StateIngame)) {
    return result;
  }
  StateIngame ingameState=(StateIngame)gameState;
  Context ingameContext=ingameState.getContext();
  BackdropProvider backdropProvider=ingameContext.get(BackdropProvider.class);
  if (backdropProvider != null) {
    result.addAll(new ReflectionProvider(backdropProvider,ingameContext).getProperties());
  }
  BackdropRenderer backdropRenderer=ingameContext.get(BackdropRenderer.class);
  if (backdropRenderer != null) {
    result.addAll(new ReflectionProvider(backdropRenderer,ingameContext).getProperties());
  }
  FrameBuffersManager renderingProcess=ingameContext.get(FrameBuffersManager.class);
  if (renderingProcess != null) {
    result.addAll(new ReflectionProvider(renderingProcess,ingameContext).getProperties());
  }
  return result;
}

Fixed version (ground truth):
@Override public List<Property<?>> getProperties(){
  List<Property<?>> result=Lists.newArrayList();
  GameState gameState=engine.getState();
  if (!(gameState instanceof StateIngame)) {
    return result;
  }
  StateIngame ingameState=(StateIngame)gameState;
  Context ingameContext=ingameState.getContext();
  BackdropProvider backdropProvider=ingameContext.get(BackdropProvider.class);
  if (backdropProvider != null) {
    result.addAll(new ReflectionProvider(backdropProvider,ingameContext).getProperties());
  }
  BackdropRenderer backdropRenderer=ingameContext.get(BackdropRenderer.class);
  if (backdropRenderer != null) {
    result.addAll(new ReflectionProvider(backdropRenderer,ingameContext).getProperties());
  }
  return result;
}
Program: 602
Project: 602
Buggy source:
/** 
 * If Ambient Occlusion is enabled in the render settings, this method generates and stores the necessary images into their own FBOs. The stored images are eventually combined with others. <p> For further information on Ambient Occlusion see: http://en.wikipedia.org/wiki/Ambient_occlusion
 */
@Override public void process(){
  if (renderingConfig.isSsao()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
    ssaoBlurredFBO=dynamicFBOsManager.get(SSAO_BLURRED_URN);
    ssaoFBO=dynamicFBOsManager.get(SSAO_URN);
    generateSSAO();
    generateBlurredSSAO();
    PerformanceMonitor.endActivity();
  }
}

Fixed version (ground truth):
/** 
 * If Ambient Occlusion is enabled in the render settings, this method generates and stores the necessary images into their own FBOs. The stored images are eventually combined with others. <p> For further information on Ambient Occlusion see: http://en.wikipedia.org/wiki/Ambient_occlusion
 */
@Override public void process(){
  if (renderingConfig.isSsao()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
    ssaoBlurredFBO=dynamicFBOsManager.get(SSAO_BLURRED_URN);
    ssaoFBO=dynamicFBOsManager.get(SSAO_URN);
    generateSSAO();
    generateBlurredSSAO();
    PerformanceMonitor.endActivity();
  }
}
Program: 603
Project: 603
Buggy source:
@Override public void initialise(){
  renderingConfig=config.getRendering();
  ssaoShader=worldRenderer.getMaterial("String_Node_Str");
  ssaoBlurredShader=worldRenderer.getMaterial("String_Node_Str");
  requireFBO(DefaultDynamicFBOs.ReadOnlyGBuffer.getConfig(),dynamicFBOsManager);
  requireFBO(new FBOConfig(SSAO_URN,1.0f,FBO.Type.DEFAULT),dynamicFBOsManager);
  requireFBO(new FBOConfig(SSAO_BLURRED_URN,1.0f,FBO.Type.DEFAULT),dynamicFBOsManager);
}

Fixed version (ground truth):
@Override public void initialise(){
  renderingConfig=config.getRendering();
  ssaoShader=worldRenderer.getMaterial("String_Node_Str");
  ssaoBlurredShader=worldRenderer.getMaterial("String_Node_Str");
  requireFBO(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getConfig(),dynamicFBOsManager);
  requireFBO(new FBOConfig(SSAO_URN,1.0f,FBO.Type.DEFAULT),dynamicFBOsManager);
  requireFBO(new FBOConfig(SSAO_BLURRED_URN,1.0f,FBO.Type.DEFAULT),dynamicFBOsManager);
}
Program: 604
Project: 604
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  initialClearing();
  sceneOpaque.bind();
  setRenderBufferMask(sceneOpaque,true,true,true);
  playerCamera.lookThroughNormalized();
  setRenderBufferMask(sceneOpaque,true,false,false);
  backdropRenderer.render(playerCamera);
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  initialClearing();
  sceneOpaque.bind();
  setRenderBufferMask(sceneOpaque,true,true,true);
  playerCamera.lookThroughNormalized();
  setRenderBufferMask(sceneOpaque,true,false,false);
  backdropRenderer.render(playerCamera);
  PerformanceMonitor.endActivity();
}
Program: 605
Project: 605
Buggy source:
/** 
 * If bloom is enabled via the rendering settings, this method generates the images needed for the bloom shader effect and stores them in their own frame buffers. <p> This effects renders adds fringes (or "feathers") of light to areas of intense brightness. This in turn give the impression of those areas partially overwhelming the camera or the eye. <p> For more information see: http://en.wikipedia.org/wiki/Bloom_(shader_effect)
 */
@Override public void process(){
  if (renderingConfig.isBloom()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    sceneBloom0=dynamicFBOsManager.get(BLOOM_0_URN);
    sceneBloom1=dynamicFBOsManager.get(BLOOM_1_URN);
    sceneBloom2=dynamicFBOsManager.get(BLOOM_2_URN);
    sceneHighPass=dynamicFBOsManager.get(HIGH_PASS_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
    generateHighPass();
    generateBloom(sceneBloom0);
    generateBloom(sceneBloom1);
    generateBloom(sceneBloom2);
    PerformanceMonitor.endActivity();
  }
}

Fixed version (ground truth):
/** 
 * If bloom is enabled via the rendering settings, this method generates the images needed for the bloom shader effect and stores them in their own frame buffers. <p> This effects renders adds fringes (or "feathers") of light to areas of intense brightness. This in turn give the impression of those areas partially overwhelming the camera or the eye. <p> For more information see: http://en.wikipedia.org/wiki/Bloom_(shader_effect)
 */
@Override public void process(){
  if (renderingConfig.isBloom()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    sceneBloom0=dynamicFBOsManager.get(BLOOM_0_URN);
    sceneBloom1=dynamicFBOsManager.get(BLOOM_1_URN);
    sceneBloom2=dynamicFBOsManager.get(BLOOM_2_URN);
    sceneHighPass=dynamicFBOsManager.get(HIGH_PASS_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
    generateHighPass();
    generateBloom(sceneBloom0);
    generateBloom(sceneBloom1);
    generateBloom(sceneBloom2);
    PerformanceMonitor.endActivity();
  }
}
Program: 606
Project: 606
Buggy source:
/** 
 * If blur is enabled through the rendering settings, this method generates the images used by the Blur effect when underwater and for the Depth of Field effect when above water. <p> For more information on blur: http://en.wikipedia.org/wiki/Defocus_aberration For more information on DoF: http://en.wikipedia.org/wiki/Depth_of_field
 */
@Override public void process(){
  if (renderingConfig.getBlurIntensity() != 0) {
    PerformanceMonitor.startActivity("String_Node_Str");
    sceneBlur0=dynamicFBOsManager.get(BLUR_0_URN);
    sceneBlur1=dynamicFBOsManager.get(BLUR_1_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
    sceneToneMapped=dynamicFBOsManager.get(TONE_MAPPED_URN);
    generateBlur(sceneBlur0);
    generateBlur(sceneBlur1);
    PerformanceMonitor.endActivity();
  }
}

Fixed version (ground truth):
/** 
 * If blur is enabled through the rendering settings, this method generates the images used by the Blur effect when underwater and for the Depth of Field effect when above water. <p> For more information on blur: http://en.wikipedia.org/wiki/Defocus_aberration For more information on DoF: http://en.wikipedia.org/wiki/Depth_of_field
 */
@Override public void process(){
  if (renderingConfig.getBlurIntensity() != 0) {
    PerformanceMonitor.startActivity("String_Node_Str");
    sceneBlur0=dynamicFBOsManager.get(BLUR_0_URN);
    sceneBlur1=dynamicFBOsManager.get(BLUR_1_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
    sceneToneMapped=dynamicFBOsManager.get(TONE_MAPPED_URN);
    generateBlur(sceneBlur0);
    generateBlur(sceneBlur1);
    PerformanceMonitor.endActivity();
  }
}
Program: 607
Project: 607
Buggy source:
@Override public void update(){
  FBO sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  sceneOpaque.attachDepthBufferTo(dynamicFBOsManager.get(REFRACTIVE_REFLECTIVE_URN));
}

Fixed version (ground truth):
@Override public void update(){
  FBO sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  sceneOpaque.attachDepthBufferTo(dynamicFBOsManager.get(REFRACTIVE_REFLECTIVE_URN));
}
Program: 608
Project: 608
Buggy source:
/** 
 * Part of the deferred lighting technique, this method applies lighting through screen-space calculations to the previously flat-lit world rendering stored in the primary FBO.   // TODO: rename sceneOpaque* FBOs to primaryA/B <p> See http://en.wikipedia.org/wiki/Deferred_shading as a starting point.
 */
private void applyLightBufferPass(){
  int texId=0;
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindTexture();
  lightBufferPass.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindDepthTexture();
  lightBufferPass.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindNormalsTexture();
  lightBufferPass.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindLightBufferTexture();
  lightBufferPass.setInt("String_Node_Str",texId,true);
  sceneOpaquePingPong=dynamicFBOsManager.get(DefaultDynamicFBOs.WriteOnlyGBuffer.getName());
  sceneReflectiveRefractive=dynamicFBOsManager.get(REFRACTIVE_REFLECTIVE_URN);
  sceneOpaquePingPong.bind();
  setRenderBufferMask(sceneOpaquePingPong,true,true,true);
  setViewportToSizeOf(sceneOpaquePingPong);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  dynamicFBOsManager.swap(DefaultDynamicFBOs.WriteOnlyGBuffer.getName(),DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  sceneOpaque.attachDepthBufferTo(sceneReflectiveRefractive);
}

Fixed version (ground truth):
/** 
 * Part of the deferred lighting technique, this method applies lighting through screen-space calculations to the previously flat-lit world rendering stored in the primary FBO.   // TODO: rename sceneOpaque* FBOs to primaryA/B <p> See http://en.wikipedia.org/wiki/Deferred_shading as a starting point.
 */
private void applyLightBufferPass(){
  int texId=0;
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindTexture();
  lightBufferPass.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindDepthTexture();
  lightBufferPass.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindNormalsTexture();
  lightBufferPass.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  sceneOpaque.bindLightBufferTexture();
  lightBufferPass.setInt("String_Node_Str",texId,true);
  sceneOpaquePingPong=dynamicFBOsManager.get(DefaultDynamicFBOs.WRITE_ONLY_GBUFFER.getName());
  sceneReflectiveRefractive=dynamicFBOsManager.get(REFRACTIVE_REFLECTIVE_URN);
  sceneOpaquePingPong.bind();
  setRenderBufferMask(sceneOpaquePingPong,true,true,true);
  setViewportToSizeOf(sceneOpaquePingPong);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  dynamicFBOsManager.swap(DefaultDynamicFBOs.WRITE_ONLY_GBUFFER.getName(),DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  sceneOpaque.attachDepthBufferTo(sceneReflectiveRefractive);
}
Program: 609
Project: 609
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  sceneOpaque.bind();
  Vector3f sunlightWorldPosition=new Vector3f(backdropProvider.getSunDirection(true));
  sunlightWorldPosition.scale(50000f);
  sunlightWorldPosition.add(playerCamera.getPosition());
  worldRenderer.renderLightComponent(mainDirectionalLight,sunlightWorldPosition,lightGeometryShader,false);
  glDisable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
  glEnable(GL_DEPTH_TEST);
  setRenderBufferMask(sceneOpaque,true,true,true);
  bindDisplay();
  applyLightBufferPass();
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  sceneOpaque.bind();
  Vector3f sunlightWorldPosition=new Vector3f(backdropProvider.getSunDirection(true));
  sunlightWorldPosition.scale(50000f);
  sunlightWorldPosition.add(playerCamera.getPosition());
  worldRenderer.renderLightComponent(mainDirectionalLight,sunlightWorldPosition,lightGeometryShader,false);
  glDisable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
  glEnable(GL_DEPTH_TEST);
  setRenderBufferMask(sceneOpaque,true,true,true);
  bindDisplay();
  applyLightBufferPass();
  PerformanceMonitor.endActivity();
}
Program: 610
Project: 610
Buggy source:
private void downSampleSceneInto1x1pixelsBuffer(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  scenePrePost=dynamicFBOsManager.get(SCENE_PRE_POST_URN);
  downSampler.enable();
  for (int i=4; i >= 0; i--) {
    downSampledFBO=downSampledScene[i];
    downSampler.setFloat("String_Node_Str",downSampledFBO.width(),true);
    downSampledFBO.bind();
    setViewportToSizeOf(downSampledFBO);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    if (i == 4) {
      scenePrePost.bindTexture();
    }
 else {
      downSampledScene[i + 1].bindTexture();
    }
    renderFullscreenQuad();
    bindDisplay();
  }
  setViewportToSizeOf(sceneOpaque);
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
private void downSampleSceneInto1x1pixelsBuffer(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  scenePrePost=dynamicFBOsManager.get(SCENE_PRE_POST_URN);
  downSampler.enable();
  for (int i=4; i >= 0; i--) {
    downSampledFBO=downSampledScene[i];
    downSampler.setFloat("String_Node_Str",downSampledFBO.width(),true);
    downSampledFBO.bind();
    setViewportToSizeOf(downSampledFBO);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    if (i == 4) {
      scenePrePost.bindTexture();
    }
 else {
      downSampledScene[i + 1].bindTexture();
    }
    renderFullscreenQuad();
    bindDisplay();
  }
  setViewportToSizeOf(sceneOpaque);
  PerformanceMonitor.endActivity();
}
Program: 612
Project: 612
Buggy source:
/** 
 * Adds chromatic aberration, light shafts, 1/8th resolution bloom, vignette onto the rendering achieved so far. Stores the result into its own buffer to be used at a later stage.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  scenePrePost=dynamicFBOsManager.get(SCENE_PRE_POST_URN);
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  initialPost.enable();
  scenePrePost.bind();
  setViewportToSizeOf(scenePrePost);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
/** 
 * Adds chromatic aberration, light shafts, 1/8th resolution bloom, vignette onto the rendering achieved so far. Stores the result into its own buffer to be used at a later stage.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  scenePrePost=dynamicFBOsManager.get(SCENE_PRE_POST_URN);
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  initialPost.enable();
  scenePrePost.bind();
  setViewportToSizeOf(scenePrePost);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  PerformanceMonitor.endActivity();
}
Program: 613
Project: 613
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  cleanupSceneOpaque();
  preRenderSetupLightGeometry();
  for (  EntityRef entity : entityManager.getEntitiesWith(LightComponent.class,LocationComponent.class)) {
    LocationComponent locationComponent=entity.getComponent(LocationComponent.class);
    LightComponent lightComponent=entity.getComponent(LightComponent.class);
    final Vector3f worldPosition=locationComponent.getWorldPosition();
    worldRenderer.renderLightComponent(lightComponent,worldPosition,lightGeometryShader,false);
  }
  postRenderCleanupLightGeometry();
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  cleanupSceneOpaque();
  preRenderSetupLightGeometry();
  for (  EntityRef entity : entityManager.getEntitiesWith(LightComponent.class,LocationComponent.class)) {
    LocationComponent locationComponent=entity.getComponent(LocationComponent.class);
    LightComponent lightComponent=entity.getComponent(LightComponent.class);
    final Vector3f worldPosition=locationComponent.getWorldPosition();
    worldRenderer.renderLightComponent(lightComponent,worldPosition,lightGeometryShader,false);
  }
  postRenderCleanupLightGeometry();
  PerformanceMonitor.endActivity();
}
Program: 614
Project: 614
Buggy source:
@Override public void process(){
  if (renderingConfig.isLightShafts()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    lightShaftsFBO=dynamicFBOsManager.get(LIGHT_SHAFTS_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
    lightShaftsShader.enable();
    lightShaftsFBO.bind();
    setViewportToSizeOf(lightShaftsFBO);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    renderFullscreenQuad();
    bindDisplay();
    setViewportToSizeOf(sceneOpaque);
    PerformanceMonitor.endActivity();
  }
}

Fixed version (ground truth):
@Override public void process(){
  if (renderingConfig.isLightShafts()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    lightShaftsFBO=dynamicFBOsManager.get(LIGHT_SHAFTS_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
    lightShaftsShader.enable();
    lightShaftsFBO.bind();
    setViewportToSizeOf(lightShaftsFBO);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    renderFullscreenQuad();
    bindDisplay();
    setViewportToSizeOf(sceneOpaque);
    PerformanceMonitor.endActivity();
  }
}
Program: 615
Project: 615
Buggy source:
/** 
 * Enabled by the "outline" option in the render settings, this method generates landscape/objects outlines and stores them into a buffer in its own FBO. The stored image is eventually combined with others. <p> The outlines visually separate a given object (including the landscape) or parts of it from sufficiently distant objects it overlaps. It is effectively a depth-based edge detection technique and internally uses a Sobel operator. <p> For further information see: http://en.wikipedia.org/wiki/Sobel_operator
 */
@Override public void process(){
  if (renderingConfig.isOutline()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    outlineFBO=dynamicFBOsManager.get(OUTLINE_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
    outline.enable();
    outlineFBO.bind();
    setViewportToSizeOf(outlineFBO);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    renderFullscreenQuad();
    bindDisplay();
    setViewportToSizeOf(sceneOpaque);
    PerformanceMonitor.endActivity();
  }
}

Fixed version (ground truth):
/** 
 * Enabled by the "outline" option in the render settings, this method generates landscape/objects outlines and stores them into a buffer in its own FBO. The stored image is eventually combined with others. <p> The outlines visually separate a given object (including the landscape) or parts of it from sufficiently distant objects it overlaps. It is effectively a depth-based edge detection technique and internally uses a Sobel operator. <p> For further information see: http://en.wikipedia.org/wiki/Sobel_operator
 */
@Override public void process(){
  if (renderingConfig.isOutline()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    outlineFBO=dynamicFBOsManager.get(OUTLINE_URN);
    sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
    outline.enable();
    outlineFBO.bind();
    setViewportToSizeOf(outlineFBO);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    renderFullscreenQuad();
    bindDisplay();
    setViewportToSizeOf(sceneOpaque);
    PerformanceMonitor.endActivity();
  }
}
Program: 616
Project: 616
Buggy source:
/** 
 * Adds outlines and ambient occlusion to the rendering obtained so far stored in the primary FBO. Stores the resulting output back into the primary buffer.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  prePostComposite.enable();
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  sceneOpaquePingPong=dynamicFBOsManager.get(DefaultDynamicFBOs.WriteOnlyGBuffer.getName());
  sceneReflectiveRefractive=dynamicFBOsManager.get(REFLECTIVE_REFRACTIVE_URN);
  sceneOpaquePingPong.bind();
  setViewportToSizeOf(sceneOpaquePingPong);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  dynamicFBOsManager.swap(DefaultDynamicFBOs.WriteOnlyGBuffer.getName(),DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  sceneOpaque.attachDepthBufferTo(sceneReflectiveRefractive);
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
/** 
 * Adds outlines and ambient occlusion to the rendering obtained so far stored in the primary FBO. Stores the resulting output back into the primary buffer.
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  prePostComposite.enable();
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  sceneOpaquePingPong=dynamicFBOsManager.get(DefaultDynamicFBOs.WRITE_ONLY_GBUFFER.getName());
  sceneReflectiveRefractive=dynamicFBOsManager.get(REFLECTIVE_REFRACTIVE_URN);
  sceneOpaquePingPong.bind();
  setViewportToSizeOf(sceneOpaquePingPong);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  dynamicFBOsManager.swap(DefaultDynamicFBOs.WRITE_ONLY_GBUFFER.getName(),DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  sceneOpaque.attachDepthBufferTo(sceneReflectiveRefractive);
  PerformanceMonitor.endActivity();
}
Program: 617
Project: 617
Buggy source:
/** 
 * Sets the state for the rendering of objects or portions of objects having some degree of transparency. <p> Generally speaking objects drawn with this state will have their color blended with the background color, depending on their opacity. I.e. a 25% opaque foreground object will provide 25% of its color while the background will provide the remaining 75%. The sum of the two RGBA vectors gets written onto the output buffer. <p> Important note: this method disables writing to the Depth Buffer. This is why filters relying on depth information (i.e. DoF) have problems with transparent objects: the depth of their pixels is found to be that of the background. This is an unresolved (unresolv-able?) issue that would only be reversed, not eliminated, by re-enabling writing to the Depth Buffer.
 */
private void preRenderSetupSimpleBlendMaterials(){
  dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName()).setRenderBufferMask(true,true,true);
  GL11.glEnable(GL_BLEND);
  GL11.glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
  GL11.glDepthMask(false);
}

Fixed version (ground truth):
/** 
 * Sets the state for the rendering of objects or portions of objects having some degree of transparency. <p> Generally speaking objects drawn with this state will have their color blended with the background color, depending on their opacity. I.e. a 25% opaque foreground object will provide 25% of its color while the background will provide the remaining 75%. The sum of the two RGBA vectors gets written onto the output buffer. <p> Important note: this method disables writing to the Depth Buffer. This is why filters relying on depth information (i.e. DoF) have problems with transparent objects: the depth of their pixels is found to be that of the background. This is an unresolved (unresolv-able?) issue that would only be reversed, not eliminated, by re-enabling writing to the Depth Buffer.
 */
private void preRenderSetupSimpleBlendMaterials(){
  dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName()).setRenderBufferMask(true,true,true);
  GL11.glEnable(GL_BLEND);
  GL11.glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
  GL11.glDepthMask(false);
}
Program: 618
Project: 618
Buggy source:
@Override public void initialise(){
  addDesiredStateChange(new BindFBO(DefaultDynamicFBOs.ReadOnlyGBuffer.getName(),dynamicFBOsManager));
}

Fixed version (ground truth):
@Override public void initialise(){
  addDesiredStateChange(new BindFBO(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName(),dynamicFBOsManager));
}
Program: 619
Project: 619
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  setRenderBufferMask(sceneOpaque,true,true,true);
  if (renderingConfig.isInscattering()) {
    sceneSkyBand0=dynamicFBOsManager.get(SKY_BAND_0_URN);
    sceneSkyBand1=dynamicFBOsManager.get(SKY_BAND_1_URN);
    generateSkyBand(sceneSkyBand0);
    generateSkyBand(sceneSkyBand1);
  }
  sceneOpaque.bind();
  playerCamera.lookThrough();
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  setRenderBufferMask(sceneOpaque,true,true,true);
  if (renderingConfig.isInscattering()) {
    sceneSkyBand0=dynamicFBOsManager.get(SKY_BAND_0_URN);
    sceneSkyBand1=dynamicFBOsManager.get(SKY_BAND_1_URN);
    generateSkyBand(sceneSkyBand0);
    generateSkyBand(sceneSkyBand1);
  }
  sceneOpaque.bind();
  playerCamera.lookThrough();
  PerformanceMonitor.endActivity();
}
Program: 620
Project: 620
Buggy source:
/** 
 * // TODO: write javadoc
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneToneMapped=dynamicFBOsManager.get(TONE_MAPPED_URN);
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  toneMapping.enable();
  sceneToneMapped.bind();
  setViewportToSizeOf(sceneToneMapped);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
/** 
 * // TODO: write javadoc
 */
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneToneMapped=dynamicFBOsManager.get(TONE_MAPPED_URN);
  sceneOpaque=dynamicFBOsManager.get(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  toneMapping.enable();
  sceneToneMapped.bind();
  setViewportToSizeOf(sceneToneMapped);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderFullscreenQuad();
  bindDisplay();
  setViewportToSizeOf(sceneOpaque);
  PerformanceMonitor.endActivity();
}
Program: 622
Project: 622
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(ReadOnlyGBuffer.getName()).dimensions().areDifferentFrom(fullScale)) {
    disposeAllFBOs();
    createFBOs();
  }
}

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(READ_ONLY_GBUFFER.getName()).dimensions().areDifferentFrom(fullScale)) {
    disposeAllFBOs();
    createFBOs();
  }
}