nus-yam/ex-repair huggingface dataset:
Program: 690
Project: 690
Buggy source:
/** 
 * Sets the state for the rendering of the reflective/refractive features of the scene. <p> At this stage this is the surface of water bodies, reflecting the sky and (if enabled) the surrounding landscape, and refracting the underwater scenery. <p> If the isHeadUnderWater argument is set to True, the state is further modified to accommodate the rendering of the water surface from an underwater point of view.
 * @param isHeadUnderWater Set to True if the point of view is underwater, to render the water surface correctly.
 */
private void preRenderSetupSceneReflectiveRefractive(boolean isHeadUnderWater){
  FBO sceneReflectiveRefractive=frameBuffersManager.getFBO("String_Node_Str");
  sceneReflectiveRefractive.bind();
  if (isHeadUnderWater) {
    GL11.glDisable(GL11.GL_CULL_FACE);
  }
}

Fixed version (ground truth):
/** 
 * Sets the state for the rendering of the reflective/refractive features of the scene. <p> At this stage this is the surface of water bodies, reflecting the sky and (if enabled) the surrounding landscape, and refracting the underwater scenery. <p> If the isHeadUnderWater argument is set to True, the state is further modified to accommodate the rendering of the water surface from an underwater point of view.
 * @param isHeadUnderWater Set to True if the point of view is underwater, to render the water surface correctly.
 */
private void preRenderSetupSceneReflectiveRefractive(boolean isHeadUnderWater){
  sceneReflectiveRefractive=frameBuffersManager.getFBO("String_Node_Str");
  sceneReflectiveRefractive.bind();
  if (isHeadUnderWater) {
    GL11.glDisable(GL11.GL_CULL_FACE);
  }
}
Program: 691
Project: 691
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  boolean isHeadUnderWater=worldRenderer.isHeadUnderWater();
  preRenderSetupSceneReflectiveRefractive(isHeadUnderWater);
  worldRenderer.renderChunks(renderQueues.chunksAlphaBlend,ChunkMesh.RenderPhase.REFRACTIVE,playerCamera,WorldRendererImpl.ChunkRenderMode.DEFAULT);
  postRenderCleanupSceneReflectiveRefractive(isHeadUnderWater);
  PerformanceMonitor.endActivity();
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  boolean isHeadUnderWater=worldRenderer.isHeadUnderWater();
  preRenderSetupSceneReflectiveRefractive(isHeadUnderWater);
  worldRenderer.renderChunks(renderQueues.chunksAlphaBlend,ChunkMesh.RenderPhase.REFRACTIVE,playerCamera,WorldRendererImpl.ChunkRenderMode.DEFAULT);
  postRenderCleanupSceneReflectiveRefractive(isHeadUnderWater);
  PerformanceMonitor.endActivity();
}
Program: 692
Project: 692
Buggy source:
@Override public void process(){
  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.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: 693
Project: 693
Buggy source:
@Override public void process(){
  if (!renderingDebugConfig.isFirstPersonElementsHidden()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    enableWireframeIf(renderingDebugConfig.isWireframe());
    GL11.glPushMatrix();
    GL11.glLoadIdentity();
    GL11.glDepthFunc(GL11.GL_ALWAYS);
    playerCamera.updateMatrices(90f);
    playerCamera.loadProjectionMatrix();
    for (    RenderSystem renderer : componentSystemManager.iterateRenderSubscribers()) {
      renderer.renderFirstPerson();
    }
    playerCamera.updateMatrices();
    playerCamera.loadProjectionMatrix();
    GL11.glDepthFunc(GL_LEQUAL);
    GL11.glPopMatrix();
    PerformanceMonitor.endActivity();
  }
}

Fixed version (ground truth):
@Override public void process(){
  if (!renderingDebugConfig.isFirstPersonElementsHidden()) {
    PerformanceMonitor.startActivity("String_Node_Str");
    enableWireframeIf(renderingDebugConfig.isWireframe());
    GL11.glPushMatrix();
    GL11.glLoadIdentity();
    GL11.glDepthFunc(GL11.GL_ALWAYS);
    playerCamera.updateMatrices(90f);
    playerCamera.loadProjectionMatrix();
    for (    RenderSystem renderer : componentSystemManager.iterateRenderSubscribers()) {
      renderer.renderFirstPerson();
    }
    playerCamera.updateMatrices();
    playerCamera.loadProjectionMatrix();
    GL11.glDepthFunc(GL_LEQUAL);
    GL11.glPopMatrix();
    disableWireframeIf(renderingDebugConfig.isWireframe());
    PerformanceMonitor.endActivity();
  }
}
Program: 694
Project: 694
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=frameBuffersManager.getFBO("String_Node_Str");
  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();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  sceneOpaque=frameBuffersManager.getFBO("String_Node_Str");
  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: 695
Project: 695
Buggy source:
@Override public void initialise(){
  lightGeometryShader=worldRenderer.getMaterial("String_Node_Str");
  playerCamera=worldRenderer.getActiveCamera();
}

Fixed version (ground truth):
@Override public void initialise(){
  lightGeometryShader=worldRenderer.getMaterial("String_Node_Str");
}
Program: 696
Project: 696
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  enableWireframeIf(renderingDebugConfig.isWireframe());
  PerformanceMonitor.startActivity("String_Node_Str");
  for (  RenderSystem renderer : componentSystemManager.iterateRenderSubscribers()) {
    renderer.renderOpaque();
  }
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  enableWireframeIf(renderingDebugConfig.isWireframe());
  for (  RenderSystem renderer : componentSystemManager.iterateRenderSubscribers()) {
    renderer.renderOpaque();
  }
  disableWireframeIf(renderingDebugConfig.isWireframe());
  PerformanceMonitor.endActivity();
}
Program: 697
Project: 697
Buggy source:
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  enableWireframeIf(renderingDebugConfig.isWireframe());
  for (  RenderSystem renderer : componentSystemManager.iterateRenderSubscribers()) {
    renderer.renderOverlay();
  }
  PerformanceMonitor.endActivity();
}

Fixed version (ground truth):
@Override public void process(){
  PerformanceMonitor.startActivity("String_Node_Str");
  enableWireframeIf(renderingDebugConfig.isWireframe());
  for (  RenderSystem renderer : componentSystemManager.iterateRenderSubscribers()) {
    renderer.renderOverlay();
  }
  disableWireframeIf(renderingDebugConfig.isWireframe());
  PerformanceMonitor.endActivity();
}
Program: 698
Project: 698
Buggy source:
@Override public void setTooltip(String value){
  if (value != null && !value.isEmpty()) {
    setTooltip(new UILabel(value));
  }
 else {
    tooltip=new DefaultBinding<>(null);
  }
}

Fixed version (ground truth):
@Override public void setTooltip(UIWidget val){
  tooltip.set(val);
}
Program: 699
Project: 699
Buggy source:
@Override public String getMode(){
  if (this.isEnabled())   return DEFAULT_MODE;
  return DISABLED_MODE;
}

Fixed version (ground truth):
@Override public String getMode(){
  if (this.isEnabled()) {
    return DEFAULT_MODE;
  }
  return DISABLED_MODE;
}
Program: 700
Project: 700
Buggy source:
public TooltipLabelBinding(Binding<String> stringBind){
  tooltipLabel.bindText(stringBind);
}

Fixed version (ground truth):
TooltipLabelBinding(Binding<String> stringBind){
  tooltipLabel.bindText(stringBind);
}
Program: 701
Project: 701
Buggy source:
@Override public String getMode(){
  if (!isEnabled())   return DISABLED_MODE;
  if (active) {
    return ACTIVE_MODE;
  }
 else   if (tickerListenerLeft.isMouseOver() || tickerListenerRight.isMouseOver()) {
    return HOVER_MODE;
  }
  return DEFAULT_MODE;
}

Fixed version (ground truth):
@Override public String getMode(){
  if (!isEnabled()) {
    return DISABLED_MODE;
  }
  if (active) {
    return ACTIVE_MODE;
  }
 else   if (tickerListenerLeft.isMouseOver() || tickerListenerRight.isMouseOver()) {
    return HOVER_MODE;
  }
  return DEFAULT_MODE;
}
Program: 702
Project: 702
Buggy source:
public ItemListener(int index){
  this.index=index;
}

Fixed version (ground truth):
ItemListener(int index){
  this.index=index;
}
Program: 703
Project: 703
Buggy source:
public ItemListener(int index){
  this.index=index;
}

Fixed version (ground truth):
ItemListener(int index){
  this.index=index;
}
Program: 704
Project: 704
Buggy source:
private void removeMesh(EntityRef entity){
  Material mat=opaqueEntities.remove(entity);
  if (mat != null) {
    opaqueMesh.remove(mat,entity);
    opaqueMeshSorter.remove(entity);
  }
 else {
    mat=translucentEntities.remove(entity);
    if (mat != null) {
      translucentMesh.remove(mat,entity);
      translucentMeshSorter.remove(entity);
    }
  }
}

Fixed version (ground truth):
private void removeMesh(EntityRef entity){
  MeshComponent meshComponent=entity.getComponent(MeshComponent.class);
  if (meshComponent != null && meshComponent.material != null) {
    if (meshComponent.translucent) {
      translucentMeshSorter.remove(entity);
    }
 else {
      opaqueMeshSorter.remove(entity);
    }
  }
}
Program: 705
Project: 705
Buggy source:
private void addMesh(EntityRef entity){
  MeshComponent meshComp=entity.getComponent(MeshComponent.class);
  if (meshComp.material != null) {
    if (meshComp.translucent) {
      translucentMesh.put(meshComp.material,entity);
      translucentEntities.put(entity,meshComp.material);
      translucentMeshSorter.add(entity);
    }
 else {
      opaqueMesh.put(meshComp.material,entity);
      opaqueEntities.put(entity,meshComp.material);
      opaqueMeshSorter.add(entity);
    }
  }
}

Fixed version (ground truth):
private void addMesh(EntityRef entity){
  MeshComponent meshComponent=entity.getComponent(MeshComponent.class);
  if (meshComponent != null && meshComponent.material != null) {
    if (meshComponent.translucent) {
      translucentMeshSorter.add(entity);
    }
 else {
      opaqueMeshSorter.add(entity);
    }
  }
}
Program: 706
Project: 706
Buggy source:
private void renderAlphaBlend(Iterable<EntityRef> entityRefs){
  Vector3f cameraPosition=worldRenderer.getActiveCamera().getPosition();
  FloatBuffer tempMatrixBuffer44=BufferUtils.createFloatBuffer(16);
  FloatBuffer tempMatrixBuffer33=BufferUtils.createFloatBuffer(12);
  for (  EntityRef entity : entityRefs) {
    MeshComponent meshComp=entity.getComponent(MeshComponent.class);
    if (meshComp != null && meshComp.material != null && meshComp.material.isRenderable()) {
      meshComp.material.enable();
      LocationComponent location=entity.getComponent(LocationComponent.class);
      if (location == null) {
        continue;
      }
      if (isHidden(entity,meshComp)) {
        continue;
      }
      Quat4f worldRot=location.getWorldRotation();
      Vector3f worldPos=location.getWorldPosition();
      float worldScale=location.getWorldScale();
      AABB aabb=meshComp.mesh.getAABB().transform(worldRot,worldPos,worldScale);
      if (worldRenderer.getActiveCamera().hasInSight(aabb)) {
        Vector3f worldPositionCameraSpace=new Vector3f();
        worldPositionCameraSpace.sub(worldPos,cameraPosition);
        Matrix4f matrixCameraSpace=new Matrix4f(worldRot,worldPositionCameraSpace,worldScale);
        Matrix4f modelViewMatrix=MatrixUtils.calcModelViewMatrix(worldRenderer.getActiveCamera().getViewMatrix(),matrixCameraSpace);
        MatrixUtils.matrixToFloatBuffer(modelViewMatrix,tempMatrixBuffer44);
        meshComp.material.setMatrix4("String_Node_Str",worldRenderer.getActiveCamera().getProjectionMatrix());
        meshComp.material.setMatrix4("String_Node_Str",tempMatrixBuffer44,true);
        MatrixUtils.matrixToFloatBuffer(MatrixUtils.calcNormalMatrix(modelViewMatrix),tempMatrixBuffer33);
        meshComp.material.setMatrix3("String_Node_Str",tempMatrixBuffer33,true);
        meshComp.material.setFloat4("String_Node_Str",meshComp.color.rf(),meshComp.color.gf(),meshComp.color.bf(),meshComp.color.af(),true);
        meshComp.material.setFloat("String_Node_Str",worldRenderer.getRenderingLightIntensityAt(worldPos),true);
        meshComp.material.setFloat("String_Node_Str",worldRenderer.getMainLightIntensityAt(worldPos),true);
        OpenGLMesh mesh=(OpenGLMesh)meshComp.mesh;
        meshComp.material.bindTextures();
        mesh.render();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void renderAlphaBlend(){
  if (config.getRendering().isRenderNearest()) {
    renderEntities(Arrays.asList(translucentMeshSorter.getNearest(config.getRendering().getMeshLimit())));
  }
 else {
    renderEntities(translucentMeshSorter.getEntities());
  }
}
Program: 708
Project: 708
Buggy source:
@ReceiveEvent(components={MeshComponent.class}) public void onChangeMesh(OnChangedComponent event,EntityRef entity){
  removeMesh(entity);
  if (entity.hasComponent(LocationComponent.class)) {
    addMesh(entity);
  }
}

Fixed version (ground truth):
@ReceiveEvent(components=MeshComponent.class) public void onChangeMesh(OnChangedComponent event,EntityRef entity){
  removeMesh(entity);
  if (entity.hasComponent(LocationComponent.class)) {
    addMesh(entity);
  }
}
Program: 710
Project: 710
Buggy source:
private void onEnd(){
  myState=AnimState.STOPPED;
  for (  AnimationListener li : myListeners) {
    li.onEnd(myRepeatCount);
  }
}

Fixed version (ground truth):
public void onEnd(int repeatCount){
}
Program: 711
Project: 711
Buggy source:
@Override public boolean onMouseClick(NUIMouseClickEvent event){
  if (event.getMouseButton() == MouseInput.MOUSE_LEFT) {
    Vector2i pos=event.getRelativeMousePosition();
    mouseOffset=(sliderSize > handleSize) ? (handleSize / 2) : 0;
    if (vertical) {
      updatePosition(pos.y - mouseOffset);
      setValue(TeraMath.clamp(pos.y - mouseOffset,0,sliderSize) * getRange() / sliderSize);
    }
 else {
      updatePosition(pos.x - mouseOffset);
      setValue(TeraMath.clamp(pos.x - mouseOffset,0,sliderSize) * getRange() / sliderSize);
    }
    dragging=true;
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onMouseClick(NUIMouseClickEvent event){
  if (event.getMouseButton() == MouseInput.MOUSE_LEFT) {
    Vector2i pos=event.getRelativeMousePosition();
    mouseOffset=(sliderSize > handleSize) ? (handleSize / 2) : 0;
    int pixelPosition=vertical ? pos.y - mouseOffset : pos.x - mouseOffset;
    updatePosition(pixelPosition);
    if (sliderSize > 0) {
      int clamped=TeraMath.clamp(pixelPosition,0,sliderSize);
      setValue(clamped * getRange() / sliderSize);
    }
 else {
      setValue(0);
    }
    dragging=true;
    return true;
  }
  return false;
}
Program: 712
Project: 712
Buggy source:
@Override public void recompile(){
  TIntIntIterator it=disposalAction.shaderPrograms.iterator();
  while (it.hasNext()) {
    it.advance();
    GL20.glDeleteProgram(it.value());
  }
  disposalAction.shaderPrograms.clear();
  uniformLocationMap.clear();
  bindMap.clear();
  disposalAction.shaderPrograms.put(0,shader.linkShaderProgram(0));
  for (  Set<ShaderProgramFeature> permutation : Sets.powerSet(shader.getAvailableFeatures())) {
    int featureMask=ShaderProgramFeature.getBitset(permutation);
    disposalAction.shaderPrograms.put(featureMask,shader.linkShaderProgram(featureMask));
  }
  if (shaderParameters != null) {
    shaderParameters.initialParameters(this);
  }
  rebindVaribles(materialData);
}

Fixed version (ground truth):
@Override public void recompile(){
  TIntIntIterator it=disposalAction.shaderPrograms.iterator();
  while (it.hasNext()) {
    it.advance();
    GL20.glDeleteProgram(it.value());
  }
  disposalAction.shaderPrograms.clear();
  uniformLocationMap.clear();
  bindMap.clear();
  disposalAction.shaderPrograms.put(0,shader.linkShaderProgram(0));
  for (  Set<ShaderProgramFeature> permutation : Sets.powerSet(shader.getAvailableFeatures())) {
    int featureMask=ShaderProgramFeature.getBitset(permutation);
    disposalAction.shaderPrograms.put(featureMask,shader.linkShaderProgram(featureMask));
  }
  if (shaderParameters != null) {
    shaderParameters.initialParameters(this);
  }
  rebindVariables(materialData);
}
Program: 713
Project: 713
Buggy source:
@Override public final void doReload(MaterialData data){
  try {
    GameThread.synch(() -> {
      disposalAction.run();
      uniformLocationMap.clear();
      shader=(GLSLShader)data.getShader();
      recompile();
      rebindVaribles(data);
    }
);
  }
 catch (  InterruptedException e) {
    logger.error("String_Node_Str",getUrn(),e);
  }
}

Fixed version (ground truth):
@Override public final void doReload(MaterialData data){
  try {
    GameThread.synch(() -> {
      disposalAction.run();
      uniformLocationMap.clear();
      shader=(GLSLShader)data.getShader();
      recompile();
      rebindVariables(data);
    }
);
  }
 catch (  InterruptedException e) {
    logger.error("String_Node_Str",getUrn(),e);
  }
}
Program: 714
Project: 714
Buggy source:
/** 
 * Executes on tick on the task, depending on the status: <ul> <li>   {@link Status#NOT_INITIALIZED} : initialize ({@link #onInitialize()}) and set status to   {@link Status#RUNNING}</li> <li>   {@link Status#RUNNING} : {@link #update(float)} the task</li><li>  {@link Status#SUSPENDED} : do nothing</li><li>  {@link Status#SUCCESS} or {@link Status#FAILURE} : status will be terminated, success or failure can be handled in {@link #onTerminate(Status)}<li>   {@link Status#TERMINATED} : terminated task</li></ul>
 * @param deltaSeconds Seconds since last engine update
 * @return The updated status of the task
 */
public Status tick(float deltaSeconds){
switch (status) {
case NOT_INITIALIZED:
{
      onInitialize();
      status=Status.RUNNING;
      break;
    }
case RUNNING:
{
    Status newStatus=update(deltaSeconds);
    if (!(newStatus == Status.RUNNING || newStatus == Status.SUCCESS || newStatus == Status.FAILURE)) {
      LOG.warn("String_Node_Str",this.getClass(),newStatus);
    }
    status=newStatus;
    break;
  }
case SUSPENDED:
break;
case FAILURE:
case SUCCESS:
{
onTerminate(status);
status=Status.TERMINATED;
break;
}
case TERMINATED:
{
break;
}
default :
break;
}
return status;
}

Fixed version (ground truth):
/** 
 * Executes on tick on the task, depending on the status: <ul> <li>   {@link Status#NOT_INITIALIZED} : initialize ({@link #onInitialize()}) and set status to   {@link Status#RUNNING}</li> <li>   {@link Status#RUNNING} : {@link #update(float)} the task</li><li>  {@link Status#SUSPENDED} : do nothing</li><li>  {@link Status#SUCCESS} or {@link Status#FAILURE} : status will be terminated, success or failure can be handled in {@link #onTerminate(Status)}<li>   {@link Status#TERMINATED} : terminated task</li></ul>
 * @param deltaSeconds Seconds since last engine update
 * @return The updated status of the task
 */
public Status tick(float deltaSeconds){
switch (status) {
case NOT_INITIALIZED:
{
      onInitialize();
      status=Status.RUNNING;
      status=this.tick(deltaSeconds);
      break;
    }
case RUNNING:
{
    Status newStatus=update(deltaSeconds);
    if (!(newStatus == Status.RUNNING || newStatus == Status.SUCCESS || newStatus == Status.FAILURE)) {
      LOG.warn("String_Node_Str",this.getClass(),newStatus);
    }
    status=newStatus;
    if (newStatus == Status.FAILURE || newStatus == Status.SUCCESS) {
      onTerminate(status);
    }
    break;
  }
case SUSPENDED:
break;
case FAILURE:
case SUCCESS:
{
status=Status.TERMINATED;
break;
}
case TERMINATED:
{
break;
}
default :
break;
}
return status;
}
Program: 715
Project: 715
Buggy source:
@Override public void recompile(){
  TIntIntIterator it=disposalAction.shaderPrograms.iterator();
  while (it.hasNext()) {
    it.advance();
    GL20.glDeleteProgram(it.value());
  }
  disposalAction.shaderPrograms.clear();
  uniformLocationMap.clear();
  disposalAction.shaderPrograms.put(0,shader.linkShaderProgram(0));
  for (  Set<ShaderProgramFeature> permutation : Sets.powerSet(shader.getAvailableFeatures())) {
    int featureMask=ShaderProgramFeature.getBitset(permutation);
    disposalAction.shaderPrograms.put(featureMask,shader.linkShaderProgram(featureMask));
  }
  if (shaderParameters != null) {
    shaderParameters.initialParameters(this);
  }
}

Fixed version (ground truth):
@Override public void recompile(){
  TIntIntIterator it=disposalAction.shaderPrograms.iterator();
  while (it.hasNext()) {
    it.advance();
    GL20.glDeleteProgram(it.value());
  }
  disposalAction.shaderPrograms.clear();
  uniformLocationMap.clear();
  bindMap.clear();
  disposalAction.shaderPrograms.put(0,shader.linkShaderProgram(0));
  for (  Set<ShaderProgramFeature> permutation : Sets.powerSet(shader.getAvailableFeatures())) {
    int featureMask=ShaderProgramFeature.getBitset(permutation);
    disposalAction.shaderPrograms.put(featureMask,shader.linkShaderProgram(featureMask));
  }
  if (shaderParameters != null) {
    shaderParameters.initialParameters(this);
  }
  rebindVaribles(materialData);
}
Program: 716
Project: 716
Buggy source:
@Override public final void doReload(MaterialData data){
  try {
    GameThread.synch(() -> {
      disposalAction.run();
      uniformLocationMap.clear();
      shader=(GLSLShader)data.getShader();
      recompile();
      for (      Map.Entry<String,Texture> entry : data.getTextures().entrySet()) {
        setTexture(entry.getKey(),entry.getValue());
      }
      for (      Map.Entry<String,Float> entry : data.getFloatParams().entrySet()) {
        setFloat(entry.getKey(),entry.getValue());
      }
      for (      Map.Entry<String,Integer> entry : data.getIntegerParams().entrySet()) {
        setInt(entry.getKey(),entry.getValue());
      }
      for (      Map.Entry<String,float[]> entry : data.getFloatArrayParams().entrySet()) {
switch (entry.getValue().length) {
case 1:
          setFloat(entry.getKey(),entry.getValue()[0]);
        break;
case 2:
      setFloat2(entry.getKey(),entry.getValue()[0],entry.getValue()[1]);
    break;
case 3:
  setFloat3(entry.getKey(),entry.getValue()[0],entry.getValue()[1],entry.getValue()[2]);
break;
case 4:
setFloat4(entry.getKey(),entry.getValue()[0],entry.getValue()[1],entry.getValue()[2],entry.getValue()[3]);
break;
default :
logger.error("String_Node_Str");
break;
}
}
}
);
}
 catch (InterruptedException e) {
logger.error("String_Node_Str",getUrn(),e);
}
}

Fixed version (ground truth):
@Override public final void doReload(MaterialData data){
  try {
    GameThread.synch(() -> {
      disposalAction.run();
      uniformLocationMap.clear();
      shader=(GLSLShader)data.getShader();
      recompile();
      rebindVaribles(data);
    }
);
  }
 catch (  InterruptedException e) {
    logger.error("String_Node_Str",getUrn(),e);
  }
}
Program: 717
Project: 717
Buggy source:
public GLSLMaterial(ResourceUrn urn,AssetType<?,MaterialData> assetType,MaterialData data){
  super(urn,assetType);
  disposalAction=new DisposalAction(urn);
  getDisposalHook().setDisposeAction(disposalAction);
  shaderManager=CoreRegistry.get(ShaderManager.class);
  reload(data);
}

Fixed version (ground truth):
public GLSLMaterial(ResourceUrn urn,AssetType<?,MaterialData> assetType,MaterialData data){
  super(urn,assetType);
  disposalAction=new DisposalAction(urn);
  getDisposalHook().setDisposeAction(disposalAction);
  this.materialData=data;
  shaderManager=CoreRegistry.get(ShaderManager.class);
  reload(data);
}
Program: 718
Project: 718
Buggy source:
private boolean canPlaceBlock(Block block,Vector3i targetBlock,Vector3i blockPos){
  if (block == null) {
    return false;
  }
  Block centerBlock=worldProvider.getBlock(targetBlock.x,targetBlock.y,targetBlock.z);
  if (!centerBlock.isAttachmentAllowed()) {
    return false;
  }
  Block adjBlock=worldProvider.getBlock(blockPos.x,blockPos.y,blockPos.z);
  if (!adjBlock.isReplacementAllowed() || adjBlock.isTargetable()) {
    return false;
  }
  if (!block.isPenetrable()) {
    Physics physics=CoreRegistry.get(Physics.class);
    AABB blockBounds=block.getBounds(blockPos);
    Vector3f min=new Vector3f(blockBounds.getMin());
    Vector3f max=new Vector3f(blockBounds.getMax());
    min.x+=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    max.x-=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    min.y+=KinematicCharacterMover.VERTICAL_PENETRATION;
    max.y-=KinematicCharacterMover.VERTICAL_PENETRATION;
    min.z+=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    max.z-=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    float additionalAllowedPenetration=0.04f;
    min.add(ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION);
    max.sub(ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION);
    AABB newBounds=AABB.createMinMax(min,max);
    return physics.scanArea(newBounds,StandardCollisionGroup.DEFAULT,StandardCollisionGroup.CHARACTER).isEmpty();
  }
  return true;
}

Fixed version (ground truth):
private boolean canPlaceBlock(Block block,Vector3i targetBlock,Vector3i blockPos){
  if (block == null) {
    return false;
  }
  Block centerBlock=worldProvider.getBlock(targetBlock.x,targetBlock.y,targetBlock.z);
  if (!centerBlock.isAttachmentAllowed()) {
    return false;
  }
  Block adjBlock=worldProvider.getBlock(blockPos.x,blockPos.y,blockPos.z);
  if (!adjBlock.isReplacementAllowed() || adjBlock.isTargetable()) {
    return false;
  }
  if (block.getBlockFamily().equals(adjBlock.getBlockFamily())) {
    return false;
  }
  if (!block.isPenetrable()) {
    Physics physics=CoreRegistry.get(Physics.class);
    AABB blockBounds=block.getBounds(blockPos);
    Vector3f min=new Vector3f(blockBounds.getMin());
    Vector3f max=new Vector3f(blockBounds.getMax());
    min.x+=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    max.x-=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    min.y+=KinematicCharacterMover.VERTICAL_PENETRATION;
    max.y-=KinematicCharacterMover.VERTICAL_PENETRATION;
    min.z+=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    max.z-=KinematicCharacterMover.HORIZONTAL_PENETRATION;
    float additionalAllowedPenetration=0.04f;
    min.add(ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION);
    max.sub(ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION,ADDITIONAL_ALLOWED_PENETRATION);
    AABB newBounds=AABB.createMinMax(min,max);
    return physics.scanArea(newBounds,StandardCollisionGroup.DEFAULT,StandardCollisionGroup.CHARACTER).isEmpty();
  }
  return true;
}
Program: 719
Project: 719
Buggy source:
public boolean updateTarget(Vector3f pos,Vector3f dir,float maxDist){
  if (targetBlockPos != null && !target.exists()) {
    target=blockRegistry.getEntityAt(targetBlockPos);
  }
  HitResult hitInfo=physics.rayTrace(pos,dir,maxDist,filter);
  EntityRef newTarget=hitInfo.getEntity();
  if (target.equals(newTarget)) {
    return false;
  }
  if (hitInfo.isWorldHit()) {
    targetBlockPos=hitInfo.getBlockPosition();
  }
 else {
    targetBlockPos=null;
  }
  prevTarget=target;
  target=newTarget;
  return true;
}

Fixed version (ground truth):
public boolean updateTarget(Vector3f pos,Vector3f dir,float maxDist){
  if (targetBlockPos != null && !target.exists()) {
    target=blockRegistry.getEntityAt(targetBlockPos);
  }
  HitResult hitInfo=physics.rayTrace(pos,dir,maxDist,filter);
  EntityRef newTarget=hitInfo.getEntity();
  if (hitInfo.isWorldHit()) {
    if (targetBlockPos != null) {
      if (targetBlockPos.equals(hitInfo.getBlockPosition())) {
        return false;
      }
    }
    targetBlockPos=hitInfo.getBlockPosition();
  }
 else {
    if (target.equals(newTarget)) {
      return false;
    }
    targetBlockPos=null;
  }
  prevTarget=target;
  target=newTarget;
  LocationComponent location=target.getComponent(LocationComponent.class);
  if (location != null && targetBlockPos != null) {
    location.setLocalPosition(targetBlockPos.toVector3f());
  }
  return true;
}
Program: 720
Project: 720
Buggy source:
@Override public Vector2i getPreferredContentSize(Canvas canvas,Vector2i sizeHint){
  return new Vector2i();
}

Fixed version (ground truth):
@Override public Vector2i getPreferredContentSize(Canvas canvas,Vector2i sizeHint){
  if (icon != null) {
    TextureRegion texture=icon.get();
    if (texture != null) {
      return texture.size();
    }
  }
  return new Vector2i();
}
Program: 721
Project: 721
Buggy source:
/** 
 * Located in the onDraw method, this draws the menu items with a scrollbar.
 * @param canvas {@link Canvas} from the onDraw method.
 * @param frame Menu frame.
 * @param font {@link Font} used in the menu.
 * @param itemMargin Margin around every menu item.
 * @param height Total menu height.
 * @param itemHeight Height per menu item.
 */
private void createScrollbarItems(Canvas canvas,Rect2i frame,Font font,Border itemMargin,int height,int itemHeight){
  Rect2i scrollableArea=Rect2i.createFromMinAndSize(0,canvas.size().y,canvas.size().x,height - itemMargin.getBottom());
  int scrollbarWidth=canvas.calculateRestrictedSize(verticalBar,new Vector2i(canvas.size().x,canvas.size().y)).x;
  int scrollbarHeight=frame.size().y - itemMargin.getTop();
  int availableWidth=frame.size().x - scrollbarWidth;
  int scrollbarXPos=availableWidth - itemMargin.getRight();
  int scrollbarYPos=itemMargin.getTotalHeight() * 2 + font.getLineHeight();
  Rect2i scrollbarRegion=Rect2i.createFromMinAndSize(scrollbarXPos,scrollbarYPos,scrollbarWidth,scrollbarHeight);
  canvas.drawWidget(verticalBar,scrollbarRegion);
  for (int i=0; i < optionListeners.size(); ++i) {
    readItemMouseOver(canvas,i);
    Rect2i itemRegion=Rect2i.createFromMinAndSize(0,itemHeight * i - verticalBar.getValue(),availableWidth,itemHeight);
    try (SubRegion ignored=canvas.subRegion(scrollableArea,true)){
      drawItem(canvas,itemMargin,i,itemRegion);
    }
   }
}

Fixed version (ground truth):
/** 
 * Located in the onDraw method, this draws the menu items with a scrollbar.
 * @param canvas {@link Canvas} from the onDraw method.
 * @param frame Menu frame.
 * @param font {@link Font} used in the menu.
 * @param itemMargin Margin around every menu item.
 * @param height Total menu height.
 * @param itemHeight Height per menu item.
 */
private void createScrollbarItems(Canvas canvas,Rect2i frame,Font font,Border itemMargin,int height,int itemHeight){
  Rect2i scrollableArea=Rect2i.createFromMinAndSize(0,canvas.size().y,canvas.size().x,height - itemMargin.getBottom());
  int scrollbarWidth=canvas.calculateRestrictedSize(verticalBar,new Vector2i(canvas.size().x,canvas.size().y)).x;
  int scrollbarHeight=frame.size().y - itemMargin.getTop();
  int availableWidth=frame.size().x - scrollbarWidth;
  int scrollbarXPos=availableWidth - itemMargin.getRight();
  int scrollbarYPos=itemMargin.getTotalHeight() * 2 + font.getLineHeight();
  Rect2i scrollbarRegion=Rect2i.createFromMinAndSize(scrollbarXPos,scrollbarYPos,scrollbarWidth,scrollbarHeight);
  canvas.drawWidget(verticalBar,scrollbarRegion);
  float maxVertBarDesired=itemHeight * (optionListeners.size() - visibleOptionsNum - 0.5f) + itemMargin.getBottom();
  verticalBar.setRange((int)maxVertBarDesired);
  for (int i=0; i < optionListeners.size(); ++i) {
    readItemMouseOver(canvas,i);
    Rect2i itemRegion=Rect2i.createFromMinAndSize(0,itemHeight * i - verticalBar.getValue(),availableWidth,itemHeight);
    try (SubRegion ignored=canvas.subRegion(scrollableArea,true)){
      drawItem(canvas,itemMargin,i,itemRegion);
    }
   }
}
Program: 722
Project: 722
Buggy source:
@Override public void onDraw(Canvas canvas){
  canvas.drawBackground();
  try (SubRegion ignored=canvas.subRegion(canvas.getCurrentStyle().getMargin().shrink(canvas.getRegion()),false)){
    if (selection.get() != null) {
      optionRenderer.draw(selection.get(),canvas);
    }
  }
   if (opened) {
    canvas.setPart(LIST);
    canvas.setDrawOnTop(true);
    Font font=canvas.getCurrentStyle().getFont();
    Border itemMargin=canvas.getCurrentStyle().getMargin();
    int optionsSize=options.get().size() <= visibleOptionsNum ? options.get().size() : visibleOptionsNum;
    int itemHeight=itemMargin.getTotalHeight() + font.getLineHeight();
    int height=itemHeight * optionsSize + canvas.getCurrentStyle().getBackgroundBorder().getTotalHeight();
    canvas.addInteractionRegion(mainListener,Rect2i.createFromMinAndSize(0,0,canvas.size().x,canvas.size().y + height));
    Rect2i frame=Rect2i.createFromMinAndSize(0,canvas.size().y,canvas.size().x,height);
    canvas.drawBackground(frame);
    canvas.setPart(LIST_ITEM);
    if (options.get().size() > visibleOptionsNum) {
      createScrollbarItems(canvas,frame,font,itemMargin,height,itemHeight);
    }
 else {
      createNoScrollItems(canvas,itemMargin,itemHeight);
    }
  }
 else {
    canvas.addInteractionRegion(mainListener);
  }
}

Fixed version (ground truth):
@Override public void onDraw(Canvas canvas){
  canvas.drawBackground();
  try (SubRegion ignored=canvas.subRegion(canvas.getCurrentStyle().getMargin().shrink(canvas.getRegion()),false)){
    if (selection.get() != null) {
      optionRenderer.draw(selection.get(),canvas);
    }
  }
   if (opened) {
    canvas.setPart(LIST);
    canvas.setDrawOnTop(true);
    Font font=canvas.getCurrentStyle().getFont();
    Border itemMargin=canvas.getCurrentStyle().getMargin();
    float optionsSize=options.get().size() <= visibleOptionsNum ? options.get().size() : (visibleOptionsNum + 0.5f);
    int itemHeight=itemMargin.getTotalHeight() + font.getLineHeight();
    int height=(int)(itemHeight * optionsSize + canvas.getCurrentStyle().getBackgroundBorder().getTotalHeight());
    canvas.addInteractionRegion(mainListener,Rect2i.createFromMinAndSize(0,0,canvas.size().x,canvas.size().y + height));
    Rect2i frame=Rect2i.createFromMinAndSize(0,canvas.size().y,canvas.size().x,height);
    canvas.drawBackground(frame);
    canvas.setPart(LIST_ITEM);
    if (options.get().size() > visibleOptionsNum) {
      createScrollbarItems(canvas,frame,font,itemMargin,height,itemHeight);
    }
 else {
      createNoScrollItems(canvas,itemMargin,itemHeight);
    }
  }
 else {
    canvas.addInteractionRegion(mainListener);
  }
}
Program: 723
Project: 723
Buggy source:
@Override public void onInitialize(){
  ResourceUrn uri=getNode().sound;
  if (uri != null) {
    Optional<StaticSound> snd=assetManager.getAsset(uri,StaticSound.class);
    if (snd.isPresent()) {
      if (actor().hasLocation()) {
        Vector3f worldPosition=actor().location().getWorldPosition();
        audioManager.playSound(snd.get(),worldPosition,getNode().volume,AudioManager.PRIORITY_NORMAL,this);
      }
 else {
        audioManager.playSound(snd.get(),new Vector3f(),getNode().volume,AudioManager.PRIORITY_NORMAL,this);
      }
      playing=true;
    }
  }
}

Fixed version (ground truth):
@Override public void onInitialize(){
  ResourceUrn uri=getNode().sound;
  if (uri != null) {
    Optional<StaticSound> snd=assetManager.getAsset(uri,StaticSound.class);
    if (snd.isPresent()) {
      actor().minion().send(new PlaySoundEvent(snd.get(),getNode().volume));
      playing=true;
    }
  }
}
Program: 724
Project: 724
Buggy source:
@Override public void update(float delta){
  for (  EntityRef entity : entityManager.getEntitiesWith(BlockParticleEffectComponent.class,LocationComponent.class)) {
    BlockParticleEffectComponent particleEffect=entity.getComponent(BlockParticleEffectComponent.class);
    Iterator<Particle> iterator=particleEffect.particles.iterator();
    while (iterator.hasNext()) {
      BlockParticleEffectComponent.Particle p=iterator.next();
      p.lifeRemaining-=delta;
      if (p.lifeRemaining <= 0) {
        iterator.remove();
      }
 else {
        updateVelocity(entity,particleEffect,p,delta);
        updatePosition(p,delta);
      }
    }
    for (int i=0; particleEffect.spawnCount > 0 && i < PARTICLES_PER_UPDATE; ++i) {
      spawnParticle(particleEffect);
    }
    if (particleEffect.particles.size() == 0 && particleEffect.destroyEntityOnCompletion) {
      entity.destroy();
    }
 else {
      entity.saveComponent(particleEffect);
    }
  }
}

Fixed version (ground truth):
@Override public void update(float delta){
  for (  EntityRef entity : entityManager.getEntitiesWith(BlockParticleEffectComponent.class,LocationComponent.class)) {
    BlockParticleEffectComponent particleEffect=entity.getComponent(BlockParticleEffectComponent.class);
    Iterator<Particle> iterator=particleEffect.particles.iterator();
    while (iterator.hasNext()) {
      BlockParticleEffectComponent.Particle p=iterator.next();
      p.lifeRemaining-=delta;
      if (p.lifeRemaining <= 0) {
        iterator.remove();
      }
 else {
        updateVelocity(entity,particleEffect,p,delta);
        updatePosition(p,delta);
      }
    }
    for (int i=0; particleEffect.spawnCount > 0 && i < PARTICLES_PER_UPDATE; ++i) {
      spawnParticle(particleEffect);
    }
    if (particleEffect.particles.size() == 0 && particleEffect.destroyEntityOnCompletion) {
      entity.destroy();
    }
  }
}
Program: 725
Project: 725
Buggy source:
private void renderBlockParticles(Vector3f worldPos,Vector3f cameraPosition,BlockParticleEffectComponent particleEffect){
  Vector3i worldPos3i=new Vector3i(worldPos,RoundingMode.HALF_UP);
  Biome biome=worldProvider.getBiome(worldPos3i);
  glPushMatrix();
  glTranslated(worldPos.x - cameraPosition.x,worldPos.y - cameraPosition.y,worldPos.z - cameraPosition.z);
  for (  Particle particle : particleEffect.particles) {
    glPushMatrix();
    glTranslatef(particle.position.x,particle.position.y,particle.position.z);
    OpenGLUtil.applyBillboardOrientation();
    glScalef(particle.size,particle.size,particle.size);
    float light=worldRenderer.getRenderingLightValueAt(new Vector3f(worldPos.x + particle.position.x,worldPos.y + particle.position.y,worldPos.z + particle.position.z));
    renderParticle(particle,particleEffect.blockType.getArchetypeBlock(),biome,light);
    glPopMatrix();
  }
  glPopMatrix();
}

Fixed version (ground truth):
private void renderBlockParticles(Vector3f worldPos,Vector3f cameraPosition,BlockParticleEffectComponent particleEffect){
  Vector3i worldPos3i=new Vector3i(worldPos,RoundingMode.HALF_UP);
  Biome biome=worldProvider.getBiome(worldPos3i);
  glPushMatrix();
  glTranslated(worldPos.x - cameraPosition.x,worldPos.y - cameraPosition.y,worldPos.z - cameraPosition.z);
  for (  Particle particle : particleEffect.particles) {
    glPushMatrix();
    glTranslatef(particle.position.x,particle.position.y,particle.position.z);
    OpenGLUtil.applyBillboardOrientation();
    glScalef(particle.size,particle.size,particle.size);
    float light=worldRenderer.getRenderingLightValueAt(new Vector3f(worldPos.x + particle.position.x,worldPos.y + particle.position.y,worldPos.z + particle.position.z));
    renderParticle(particle,blockManager.getBlock(particleEffect.blockType).getBlockFamily().getArchetypeBlock(),biome,light);
    glPopMatrix();
  }
  glPopMatrix();
}
Program: 727
Project: 727
Buggy source:
@ReceiveEvent(components={BlockItemComponent.class,ItemComponent.class}) public void onPlaceBlock(ActivateEvent event,EntityRef item){
  if (!event.getTarget().exists()) {
    event.consume();
    return;
  }
  BlockItemComponent blockItem=item.getComponent(BlockItemComponent.class);
  BlockFamily type=blockItem.blockFamily;
  Side surfaceSide=Side.inDirection(event.getHitNormal());
  Side secondaryDirection=ChunkMath.getSecondaryPlacementDirection(event.getDirection(),event.getHitNormal());
  BlockComponent blockComponent=event.getTarget().getComponent(BlockComponent.class);
  if (blockComponent == null) {
    event.consume();
    return;
  }
  Vector3i targetBlock=blockComponent.getPosition();
  Vector3i placementPos=new Vector3i(targetBlock);
  placementPos.add(surfaceSide.getVector3i());
  Block block=type.getBlockForPlacement(worldProvider,blockEntityRegistry,placementPos,surfaceSide,secondaryDirection);
  if (canPlaceBlock(block,targetBlock,placementPos)) {
    if (networkSystem.getMode().isAuthority()) {
      PlaceBlocks placeBlocks=new PlaceBlocks(placementPos,block,event.getInstigator());
      worldProvider.getWorldEntity().send(placeBlocks);
      if (!placeBlocks.isConsumed()) {
        item.send(new OnBlockItemPlaced(placementPos,blockEntityRegistry.getBlockEntityAt(placementPos)));
      }
 else {
        event.consume();
      }
    }
    event.getInstigator().send(new PlaySoundEvent(event.getInstigator(),Assets.getSound("String_Node_Str").get(),0.5f));
  }
 else {
    event.consume();
  }
}

Fixed version (ground truth):
@ReceiveEvent(components={BlockItemComponent.class,ItemComponent.class}) public void onPlaceBlock(ActivateEvent event,EntityRef item){
  if (!event.getTarget().exists()) {
    event.consume();
    return;
  }
  BlockItemComponent blockItem=item.getComponent(BlockItemComponent.class);
  BlockFamily type=blockItem.blockFamily;
  Side surfaceSide=Side.inDirection(event.getHitNormal());
  Side secondaryDirection=ChunkMath.getSecondaryPlacementDirection(event.getDirection(),event.getHitNormal());
  BlockComponent blockComponent=event.getTarget().getComponent(BlockComponent.class);
  if (blockComponent == null) {
    event.consume();
    return;
  }
  Vector3i targetBlock=blockComponent.getPosition();
  Vector3i placementPos=new Vector3i(targetBlock);
  placementPos.add(surfaceSide.getVector3i());
  Block block=type.getBlockForPlacement(worldProvider,blockEntityRegistry,placementPos,surfaceSide,secondaryDirection);
  if (canPlaceBlock(block,targetBlock,placementPos)) {
    if (networkSystem.getMode().isAuthority()) {
      PlaceBlocks placeBlocks=new PlaceBlocks(placementPos,block,event.getInstigator());
      worldProvider.getWorldEntity().send(placeBlocks);
      if (!placeBlocks.isConsumed()) {
        item.send(new OnBlockItemPlaced(placementPos,blockEntityRegistry.getBlockEntityAt(placementPos)));
      }
 else {
        event.consume();
      }
    }
    event.getInstigator().send(new PlaySoundEvent(Assets.getSound("String_Node_Str").get(),0.5f));
  }
 else {
    event.consume();
  }
}
Program: 730
Project: 730
Buggy source:
@Override public FileVisitResult postVisitDirectory(Path dir,IOException exc) throws IOException {
  Files.delete(dir);
  return FileVisitResult.CONTINUE;
}

Fixed version (ground truth):
@Override public FileVisitResult postVisitDirectory(Path dir,IOException exc) throws IOException {
  try {
    Files.delete(dir);
  }
 catch (  DirectoryNotEmptyException e) {
    logger.warn("String_Node_Str");
    try {
      Thread.sleep(1000L);
    }
 catch (    InterruptedException e1) {
      Thread.currentThread().interrupt();
    }
    Files.delete(dir);
  }
  return FileVisitResult.CONTINUE;
}
Program: 732
Project: 732
Buggy source:
@ReceiveEvent public void ensureClientSideEntityOnHeldItemMountPoint(OnActivatedComponent event,EntityRef camera,FirstPersonHeldItemMountPointComponent firstPersonHeldItemMountPointComponent){
  if (!firstPersonHeldItemMountPointComponent.mountPointEntity.exists()) {
    EntityBuilder builder=entityManager.newBuilder("String_Node_Str");
    builder.setPersistent(false);
    firstPersonHeldItemMountPointComponent.mountPointEntity=builder.build();
    camera.saveComponent(firstPersonHeldItemMountPointComponent);
  }
  if (camera.exists()) {
    Location.removeChild(camera,firstPersonHeldItemMountPointComponent.mountPointEntity);
    Location.attachChild(camera,firstPersonHeldItemMountPointComponent.mountPointEntity,firstPersonHeldItemMountPointComponent.translate,new Quat4f(TeraMath.DEG_TO_RAD * firstPersonHeldItemMountPointComponent.rotateDegrees.y,TeraMath.DEG_TO_RAD * firstPersonHeldItemMountPointComponent.rotateDegrees.x,TeraMath.DEG_TO_RAD * firstPersonHeldItemMountPointComponent.rotateDegrees.z),firstPersonHeldItemMountPointComponent.scale);
  }
}

Fixed version (ground truth):
@ReceiveEvent public void ensureClientSideEntityOnHeldItemMountPoint(OnActivatedComponent event,EntityRef camera,FirstPersonHeldItemMountPointComponent firstPersonHeldItemMountPointComponent){
  if (!firstPersonHeldItemMountPointComponent.mountPointEntity.exists()) {
    EntityBuilder builder=entityManager.newBuilder("String_Node_Str");
    builder.setPersistent(false);
    firstPersonHeldItemMountPointComponent.mountPointEntity=builder.build();
    camera.saveComponent(firstPersonHeldItemMountPointComponent);
  }
  Location.removeChild(camera,firstPersonHeldItemMountPointComponent.mountPointEntity);
  Location.attachChild(camera,firstPersonHeldItemMountPointComponent.mountPointEntity,firstPersonHeldItemMountPointComponent.translate,new Quat4f(TeraMath.DEG_TO_RAD * firstPersonHeldItemMountPointComponent.rotateDegrees.y,TeraMath.DEG_TO_RAD * firstPersonHeldItemMountPointComponent.rotateDegrees.x,TeraMath.DEG_TO_RAD * firstPersonHeldItemMountPointComponent.rotateDegrees.z),firstPersonHeldItemMountPointComponent.scale);
}
Program: 733
Project: 733
Buggy source:
@ReceiveEvent public void ensureHeldItemIsMountedOnLoad(OnChangedComponent event,EntityRef entityRef,ClientComponent clientComponent){
  if (localPlayer.getCharacterEntity().exists() && localPlayer.getCameraEntity().exists()) {
    CharacterHeldItemComponent characterHeldItemComponent=localPlayer.getCharacterEntity().getComponent(CharacterHeldItemComponent.class);
    if (characterHeldItemComponent != null) {
      linkHeldItemLocationForLocalPlayer(localPlayer.getCharacterEntity(),characterHeldItemComponent.selectedItem,null);
    }
  }
}

Fixed version (ground truth):
@ReceiveEvent public void ensureHeldItemIsMountedOnLoad(OnChangedComponent event,EntityRef entityRef,ClientComponent clientComponent){
  if (localPlayer.getClientEntity().equals(entityRef) && localPlayer.getCharacterEntity().exists() && localPlayer.getCameraEntity().exists()) {
    CharacterHeldItemComponent characterHeldItemComponent=localPlayer.getCharacterEntity().getComponent(CharacterHeldItemComponent.class);
    if (characterHeldItemComponent != null) {
      linkHeldItemLocationForLocalPlayer(localPlayer.getCharacterEntity(),characterHeldItemComponent.selectedItem,null);
    }
  }
}