nus-yam/ex-repair huggingface dataset:
Program: 393
Project: 393
Buggy source:
private void preRenderUpdate(RenderingStage renderingStage){
  resetStats();
  currentRenderingStage=renderingStage;
  if (currentRenderingStage == RenderingStage.MONO || currentRenderingStage == RenderingStage.LEFT_EYE) {
    isFirstRenderingStageForCurrentFrame=true;
  }
 else {
    isFirstRenderingStageForCurrentFrame=false;
  }
  if (isFirstRenderingStageForCurrentFrame) {
    timeSmoothedMainLightIntensity=TeraMath.lerp(timeSmoothedMainLightIntensity,getMainLightIntensityAt(playerCamera.getPosition()),secondsSinceLastFrame);
    playerCamera.update(secondsSinceLastFrame);
    renderableWorld.update();
    renderableWorld.generateVBOs();
    secondsSinceLastFrame=0;
    displayResolutionDependentFBOs.update();
    millisecondsSinceRenderingStart+=secondsSinceLastFrame * 1000;
  }
  if (currentRenderingStage != RenderingStage.MONO) {
    playerCamera.updateFrustum();
  }
  renderableWorld.queueVisibleChunks(isFirstRenderingStageForCurrentFrame);
  if (requestedTaskListRefresh) {
    renderTaskListGenerator.refresh();
    requestedTaskListRefresh=false;
  }
}

Fixed version (ground truth):
private void preRenderUpdate(RenderingStage renderingStage){
  resetStats();
  currentRenderingStage=renderingStage;
  if (currentRenderingStage == RenderingStage.MONO || currentRenderingStage == RenderingStage.LEFT_EYE) {
    isFirstRenderingStageForCurrentFrame=true;
  }
 else {
    isFirstRenderingStageForCurrentFrame=false;
  }
  if (isFirstRenderingStageForCurrentFrame) {
    timeSmoothedMainLightIntensity=TeraMath.lerp(timeSmoothedMainLightIntensity,getMainLightIntensityAt(playerCamera.getPosition()),secondsSinceLastFrame);
    playerCamera.update(secondsSinceLastFrame);
    renderableWorld.update();
    renderableWorld.generateVBOs();
    secondsSinceLastFrame=0;
    displayResolutionDependentFBOs.update();
    millisecondsSinceRenderingStart+=secondsSinceLastFrame * 1000;
  }
  if (currentRenderingStage != RenderingStage.MONO) {
    playerCamera.updateFrustum();
  }
  renderableWorld.queueVisibleChunks(isFirstRenderingStageForCurrentFrame);
  if (requestedTaskListRefresh) {
    List<Node> orderedNodes=renderGraph.getNodesInTopologicalOrder();
    renderPipelineTaskList=renderTaskListGenerator.generateFrom(orderedNodes);
    requestedTaskListRefresh=false;
  }
}
Program: 394
Project: 394
Buggy source:
private Rect2i getTargetRegion(String id,Canvas canvas){
  if (id != null && !id.isEmpty()) {
    if (loopDetectionId.equals(id)) {
      logger.warn("String_Node_Str",loopDetectionId);
      loopDetectionId="String_Node_Str";
      return canvas.getRegion();
    }
 else     if (loopDetectionId.isEmpty()) {
      loopDetectionId=id;
    }
    WidgetInfo target=contentLookup.get(id);
    if (target != null) {
      Rect2i region=getRegion(target,canvas);
      loopDetectionId="String_Node_Str";
      return region;
    }
  }
  loopDetectionId="String_Node_Str";
  return canvas.getRegion();
}

Fixed version (ground truth):
private Rect2i getTargetRegion(String id,Canvas canvas){
  if (id != null && !id.isEmpty()) {
    if (loopDetectionId.equals(id)) {
      logger.warn("String_Node_Str",loopDetectionId);
      loopDetectionId="String_Node_Str";
      return canvas.getRegion();
    }
 else     if (loopDetectionId.isEmpty()) {
      loopDetectionId=id;
    }
    WidgetInfo target=contentLookup.get(id);
    if (target != null) {
      try {
        Rect2i region=getRegion(target,canvas);
        loopDetectionId="String_Node_Str";
        return region;
      }
 catch (      StackOverflowError e) {
        logger.error("String_Node_Str",loopDetectionId);
      }
    }
  }
  loopDetectionId="String_Node_Str";
  return canvas.getRegion();
}
Program: 396
Project: 396
Buggy source:
@Override public void set(WorldGeneratorInfo value){
  if (value != null) {
    config.getWorldGeneration().setDefaultGenerator(value.getUri());
  }
}

Fixed version (ground truth):
@Override public void set(Boolean value){
  playButton.setEnabled(value);
}
Program: 399
Project: 399
Buggy source:
public boolean connect(Node... nodeList){
  boolean returnValue=true;
  assert(nodeList.length > 1);
  Node fromNode=null;
  for (  Node toNode : nodeList) {
    Preconditions.checkNotNull(toNode,"String_Node_Str");
    if (fromNode == null) {
      fromNode=toNode;
      continue;
    }
    boolean success=edgeMap.put(fromNode,toNode);
    if (success) {
      reverseEdgeMap.put(toNode,fromNode);
    }
 else {
      logger.warn("String_Node_Str" + fromNode.getClass() + "String_Node_Str"+ toNode.getClass());
    }
    returnValue=returnValue && success;
  }
  return returnValue;
}

Fixed version (ground truth):
public boolean connect(Node... nodeList){
  boolean returnValue=true;
  assert(nodeList.length > 1);
  Node fromNode=null;
  for (  Node toNode : nodeList) {
    Preconditions.checkNotNull(toNode,"String_Node_Str");
    if (fromNode != null) {
      boolean success=edgeMap.put(fromNode,toNode);
      if (success) {
        reverseEdgeMap.put(toNode,fromNode);
      }
 else {
        logger.warn("String_Node_Str" + fromNode.getClass() + "String_Node_Str"+ toNode.getClass());
      }
      returnValue=returnValue && success;
    }
    fromNode=toNode;
  }
  return returnValue;
}
Program: 400
Project: 400
Buggy source:
private void addWorldRenderingNodes(RenderGraph renderGraph){
  Node lastUpdatedGBufferClearingNode=renderGraph.findNode("String_Node_Str");
  Node opaqueObjectsNode=new OpaqueObjectsNode(context);
  renderGraph.addNode(opaqueObjectsNode,"String_Node_Str");
  renderGraph.connect(lastUpdatedGBufferClearingNode,opaqueObjectsNode);
  Node opaqueBlocksNode=new OpaqueBlocksNode(context);
  renderGraph.addNode(opaqueBlocksNode,"String_Node_Str");
  renderGraph.connect(lastUpdatedGBufferClearingNode,opaqueBlocksNode);
  Node alphaRejectBlocksNode=new AlphaRejectBlocksNode(context);
  renderGraph.addNode(alphaRejectBlocksNode,"String_Node_Str");
  renderGraph.connect(lastUpdatedGBufferClearingNode,alphaRejectBlocksNode);
  Node overlaysNode=new OverlaysNode(context);
  renderGraph.addNode(overlaysNode,"String_Node_Str");
  renderGraph.connect(lastUpdatedGBufferClearingNode,overlaysNode);
}

Fixed version (ground truth):
private void addWorldRenderingNodes(RenderGraph renderGraph){
  Node hazeIntermediateNode=renderGraph.findNode("String_Node_Str");
  Node opaqueObjectsNode=new OpaqueObjectsNode(context);
  renderGraph.addNode(opaqueObjectsNode,"String_Node_Str");
  renderGraph.connect(hazeIntermediateNode,opaqueObjectsNode);
  Node opaqueBlocksNode=new OpaqueBlocksNode(context);
  renderGraph.addNode(opaqueBlocksNode,"String_Node_Str");
  renderGraph.connect(hazeIntermediateNode,opaqueBlocksNode);
  Node alphaRejectBlocksNode=new AlphaRejectBlocksNode(context);
  renderGraph.addNode(alphaRejectBlocksNode,"String_Node_Str");
  renderGraph.connect(hazeIntermediateNode,alphaRejectBlocksNode);
  Node overlaysNode=new OverlaysNode(context);
  renderGraph.addNode(overlaysNode,"String_Node_Str");
  renderGraph.connect(hazeIntermediateNode,overlaysNode);
}
Program: 401
Project: 401
Buggy source:
private void initRenderGraph(){
  addGBufferClearingNodes(renderGraph);
  addWorldRenderingNodes(renderGraph);
  addSkyNodes(renderGraph);
  addLightingNodes(renderGraph);
  add3dDecorationNodes(renderGraph);
  addReflectionAndRefractionNodes(renderGraph);
  addPrePostProcessingNodes(renderGraph);
  addBloomNodes(renderGraph);
  addExposureNodes(renderGraph);
  addInitialPostProcessingNodes(renderGraph);
  addFinalPostProcessingNodes(renderGraph);
  addOutputNodes(renderGraph);
  renderTaskListGenerator=new RenderTaskListGenerator();
  List<Node> orderedNodes=renderGraph.getNodesInTopologicalOrder();
  renderPipelineTaskList=renderTaskListGenerator.generateFrom(orderedNodes);
}

Fixed version (ground truth):
private void initRenderGraph(){
  addGBufferClearingNodes(renderGraph);
  addSkyNodes(renderGraph);
  addWorldRenderingNodes(renderGraph);
  addLightingNodes(renderGraph);
  add3dDecorationNodes(renderGraph);
  addReflectionAndRefractionNodes(renderGraph);
  addPrePostProcessingNodes(renderGraph);
  addBloomNodes(renderGraph);
  addExposureNodes(renderGraph);
  addInitialPostProcessingNodes(renderGraph);
  addFinalPostProcessingNodes(renderGraph);
  addOutputNodes(renderGraph);
  renderTaskListGenerator=new RenderTaskListGenerator();
  List<Node> orderedNodes=renderGraph.getNodesInTopologicalOrder();
  renderPipelineTaskList=renderTaskListGenerator.generateFrom(orderedNodes);
}
Program: 402
Project: 402
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. <p> 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 head mounted display. <p> 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::process);
  LwjglGraphics.initOpenGLParams();
  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. <p> 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 head mounted display. <p> 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);
  FBO lastUpdatedGBuffer=displayResolutionDependentFBOs.getGBufferPair().getLastUpdatedFbo();
  glViewport(0,0,lastUpdatedGBuffer.width(),lastUpdatedGBuffer.height());
  renderPipelineTaskList.forEach(RenderPipelineTask::process);
  LwjglGraphics.initOpenGLParams();
  playerCamera.updatePrevViewProjectionMatrix();
}
Program: 403
Project: 403
Buggy source:
private void add3dDecorationNodes(RenderGraph renderGraph){
  Node outlineNode=new OutlineNode(context);
  renderGraph.addNode(outlineNode,"String_Node_Str");
  Node ambientOcclusionNode=new AmbientOcclusionNode(context);
  renderGraph.addNode(ambientOcclusionNode,"String_Node_Str");
  Node blurredAmbientOcclusionNode=new BlurredAmbientOcclusionNode(context);
  renderGraph.addNode(blurredAmbientOcclusionNode,"String_Node_Str");
  Node opaqueObjectsNode=renderGraph.findNode(new SimpleUri("String_Node_Str"));
  Node opaqueBlocksNode=renderGraph.findNode(new SimpleUri("String_Node_Str"));
  Node alphaRejectBlocksNode=renderGraph.findNode(new SimpleUri("String_Node_Str"));
  renderGraph.connect(opaqueObjectsNode,outlineNode);
  renderGraph.connect(opaqueBlocksNode,outlineNode);
  renderGraph.connect(alphaRejectBlocksNode,outlineNode);
  renderGraph.connect(opaqueObjectsNode,ambientOcclusionNode);
  renderGraph.connect(opaqueBlocksNode,ambientOcclusionNode);
  renderGraph.connect(alphaRejectBlocksNode,ambientOcclusionNode);
  renderGraph.connect(ambientOcclusionNode,blurredAmbientOcclusionNode);
}

Fixed version (ground truth):
private void add3dDecorationNodes(RenderGraph renderGraph){
  Node outlineNode=new OutlineNode(context);
  renderGraph.addNode(outlineNode,"String_Node_Str");
  Node ambientOcclusionNode=new AmbientOcclusionNode(context);
  renderGraph.addNode(ambientOcclusionNode,"String_Node_Str");
  Node blurredAmbientOcclusionNode=new BlurredAmbientOcclusionNode(context);
  renderGraph.addNode(blurredAmbientOcclusionNode,"String_Node_Str");
  Node opaqueObjectsNode=renderGraph.findNode(new SimpleUri("String_Node_Str"));
  Node opaqueBlocksNode=renderGraph.findNode(new SimpleUri("String_Node_Str"));
  Node alphaRejectBlocksNode=renderGraph.findNode(new SimpleUri("String_Node_Str"));
  Node applyDeferredLightingNode=renderGraph.findNode(new SimpleUri("String_Node_Str"));
  renderGraph.connect(opaqueObjectsNode,outlineNode);
  renderGraph.connect(opaqueBlocksNode,outlineNode);
  renderGraph.connect(alphaRejectBlocksNode,outlineNode);
  renderGraph.connect(opaqueObjectsNode,ambientOcclusionNode);
  renderGraph.connect(opaqueBlocksNode,ambientOcclusionNode);
  renderGraph.connect(alphaRejectBlocksNode,ambientOcclusionNode);
  renderGraph.connect(applyDeferredLightingNode,ambientOcclusionNode);
  renderGraph.connect(ambientOcclusionNode,blurredAmbientOcclusionNode);
}
Program: 404
Project: 404
Buggy source:
@Override public void onMouseOver(NUIMouseOverEvent event){
  int sectionOver=getSectionOver(event.getRelativeMousePosition());
  if (selectedTab != -1) {
    sections[selectedTab].setSelected(false);
  }
  if (sectionOver != -1) {
    sections[sectionOver].setSelected(true);
  }
  selectedTab=sectionOver;
}

Fixed version (ground truth):
@Override public void onMouseOver(NUIMouseOverEvent event){
  int sectionOver=getSectionOver(event.getRelativeMousePosition());
  if (selectedTab != -1) {
    sections.get(selectedTab).setSelected(false);
  }
  if (sectionOver != -1) {
    sections.get(sectionOver).setSelected(true);
  }
  selectedTab=sectionOver;
}
Program: 405
Project: 405
Buggy source:
/** 
 * Subscribes a listener to a section. Will be triggered when the mouse is released over that section
 * @param sectionNum The section to attach the listener to
 * @param listener   The listener to attach
 */
public void subscribe(int sectionNum,ActivateEventListener listener){
  if (sectionNum >= 0 && sectionNum < sections.length) {
    sections[sectionNum].addListener(listener);
  }
}

Fixed version (ground truth):
/** 
 * Subscribes a listener to a section. Will be triggered when the mouse is released over that section
 * @param sectionNum The section to attach the listener to
 * @param listener   The listener to attach
 */
public void subscribe(int sectionNum,ActivateEventListener listener){
  if (sectionNum >= 0 && sectionNum < sections.size()) {
    sections.get(sectionNum).addListener(listener);
  }
}
Program: 406
Project: 406
Buggy source:
/** 
 * Unsubscribes a listener from a section. It will no longer be triggered by that section
 * @param sectionNum The section to unsubscribe from
 * @param listener   The listener to unsubscribe
 */
public void unsubscribe(int sectionNum,ActivateEventListener listener){
  if (sectionNum >= 0 && sectionNum < sections.length) {
    sections[sectionNum].removeListener(listener);
  }
}

Fixed version (ground truth):
/** 
 * Unsubscribes a listener from a section. It will no longer be triggered by that section
 * @param sectionNum The section to unsubscribe from
 * @param listener   The listener to unsubscribe
 */
public void unsubscribe(int sectionNum,ActivateEventListener listener){
  if (sectionNum >= 0 && sectionNum < sections.size()) {
    sections.get(sectionNum).removeListener(listener);
  }
}
Program: 407
Project: 407
Buggy source:
private void initialise(Canvas canvas){
  final double circleToSquare=0.707106781;
  Rect2i region=canvas.getRegion();
  int sectionWidth=region.width() / 4;
  double offset=sectionWidth * 1.5;
  radius=sectionWidth * 2;
  sectionAngle=(Math.PI * 2) / sections.length;
  int infoSquareSize=(int)(radius * circleToSquare);
  int sectionSquareSize=(int)(sectionWidth * circleToSquare);
  Rect2i infoRegion=Rect2i.createFromMinAndSize(sectionWidth + infoSquareSize / 4,sectionWidth + infoSquareSize / 4,infoSquareSize,infoSquareSize);
  for (int i=0; i < sections.length; i++) {
    sections[i].setDrawRegion(Rect2i.createFromMinAndSize((int)(Math.cos(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5),(int)(Math.sin(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5),sectionWidth,sectionWidth));
    sections[i].setInnerRegion(Rect2i.createFromMinAndSize((int)(Math.cos(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5 + sectionSquareSize / 4),(int)(Math.sin(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5 + sectionSquareSize / 4),sectionSquareSize,sectionSquareSize));
    sections[i].setInfoRegion(infoRegion);
  }
}

Fixed version (ground truth):
private void initialise(Canvas canvas){
  final double circleToSquare=0.707106781;
  Rect2i region=canvas.getRegion();
  int sectionWidth=region.width() / 4;
  double offset=sectionWidth * 1.5;
  radius=sectionWidth * 2;
  sectionAngle=(Math.PI * 2) / sections.size();
  int infoSquareSize=(int)(radius * circleToSquare);
  int sectionSquareSize=(int)(sectionWidth * circleToSquare);
  Rect2i infoRegion=Rect2i.createFromMinAndSize(sectionWidth + infoSquareSize / 4,sectionWidth + infoSquareSize / 4,infoSquareSize,infoSquareSize);
  for (int i=0; i < sections.size(); i++) {
    sections.get(i).setDrawRegion(Rect2i.createFromMinAndSize((int)(Math.cos(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5),(int)(Math.sin(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5),sectionWidth,sectionWidth));
    sections.get(i).setInnerRegion(Rect2i.createFromMinAndSize((int)(Math.cos(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5 + sectionSquareSize / 4),(int)(Math.sin(i * sectionAngle + sectionAngle / 2) * offset + sectionWidth * 1.5 + sectionSquareSize / 4),sectionSquareSize,sectionSquareSize));
    sections.get(i).setInfoRegion(infoRegion);
  }
}
Program: 408
Project: 408
Buggy source:
@Override public void onMouseRelease(NUIMouseReleaseEvent event){
  if (selectedTab != -1) {
    sections[selectedTab].setSelected(false);
    sections[selectedTab].activateSection();
    selectedTab=-1;
  }
}

Fixed version (ground truth):
@Override public void onMouseRelease(NUIMouseReleaseEvent event){
  if (selectedTab != -1) {
    sections.get(selectedTab).setSelected(false);
    sections.get(selectedTab).activateSection();
    selectedTab=-1;
  }
}
Program: 409
Project: 409
Buggy source:
public void setIcon(Binding<TextureRegion> newIcon){
  icon=newIcon;
}

Fixed version (ground truth):
/** 
 * Set icon texture
 */
public void setIcon(TextureRegion newIcon){
  icon=newIcon;
}
Program: 410
Project: 410
Buggy source:
public void setInfoWidget(Binding<UIWidget> infoWidget){
  widget=infoWidget;
}

Fixed version (ground truth):
/** 
 * Sets info widget
 */
public void setInfoWidget(UIWidget infoWidget){
  widget=infoWidget;
}
Program: 411
Project: 411
Buggy source:
/** 
 * Draws the widget
 * @param canvas The canvas to draw on.
 */
public void onDraw(Canvas canvas){
  canvas.getRegion();
  canvas.drawTexture(sectionTexture,sectionRegion);
  if (icon.get() != null) {
    canvas.drawTexture(icon.get(),innerRegion);
  }
  if (text.get() != null) {
    canvas.drawText(text.get(),innerRegion);
  }
  if (isSelected) {
    canvas.drawTexture(selectedTexture,sectionRegion);
    if (widget.get() != null) {
      canvas.drawWidget(widget.get(),infoRegion);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draws the widget
 * @param canvas The canvas to draw on.
 */
public void onDraw(Canvas canvas){
  canvas.getRegion();
  canvas.drawTexture(sectionTexture,sectionRegion);
  if (icon != null) {
    canvas.drawTexture(icon,innerRegion);
  }
  if (text != null) {
    canvas.drawText(text,innerRegion);
  }
  if (isSelected) {
    canvas.drawTexture(selectedTexture,sectionRegion);
    if (widget != null) {
      canvas.drawWidget(widget,infoRegion);
    }
  }
}
Program: 412
Project: 412
Buggy source:
public void setText(Binding<String> newText){
  text=newText;
}

Fixed version (ground truth):
/** 
 * Set section text
 */
public void setText(String newText){
  text=newText;
}
Program: 414
Project: 414
Buggy source:
private static boolean hasSenderAnnotation(Method method){
  final Class[] paramTypes=method.getParameterTypes();
  final Annotation[][] paramAnnotations=method.getParameterAnnotations();
  for (int i=0; i < paramAnnotations.length; i++) {
    if (paramTypes[i].getTypeName().equals(ENTITY_REF_NAME)) {
      if (paramAnnotations[i].length == 0) {
        return false;
      }
 else {
        for (        Annotation annotation : paramAnnotations[i]) {
          if (annotation instanceof Sender) {
            return true;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean hasSenderAnnotation(Method method){
  final Class[] paramTypes=method.getParameterTypes();
  final Annotation[][] paramAnnotations=method.getParameterAnnotations();
  for (int i=0; i < paramAnnotations.length; i++) {
    if (paramTypes[i].getTypeName().equals(ENTITY_REF_NAME)) {
      if (paramAnnotations[i].length == 0) {
        return false;
      }
 else {
        for (        Annotation annotation : paramAnnotations[i]) {
          if (annotation instanceof Sender) {
            return true;
          }
        }
      }
    }
  }
  return true;
}
Program: 415
Project: 415
Buggy source:
/** 
 * Removes the config associated with the given id, and returns it.
 * @param configId The id of the config to remove.
 * @return The config associated with the given id, and null if no config is associated with the given id.
 */
FlexibleConfig removeConfig(SimpleUri configId);

Fixed version (ground truth):
/** 
 * Removes the config associated with the given id, and returns it.
 * @param configId The id of the config to remove.
 * @return The config associated with the given id, or null if no config is associated with the given id.
 */
FlexibleConfig removeConfig(SimpleUri configId);
Program: 417
Project: 417
Buggy source:
@Override public void dispose(boolean shuttingDown){
  ChunkProvider chunkProvider=context.get(ChunkProvider.class);
  chunkProvider.dispose();
  boolean save=networkSystem.getMode().isAuthority();
  if (save) {
    storageManager.waitForCompletionOfPreviousSaveAndStartSaving();
  }
  networkSystem.shutdown();
  eventSystem.process();
  GameThread.processWaitingProcesses();
  nuiManager.clear();
  context.get(AudioManager.class).stopAllSounds();
  if (worldRenderer != null) {
    worldRenderer.dispose();
    worldRenderer=null;
  }
  componentSystemManager.shutdown();
  context.get(PhysicsEngine.class).dispose();
  entityManager.clear();
  if (storageManager != null) {
    storageManager.finishSavingAndShutdown();
  }
  ModuleEnvironment oldEnvironment=context.get(ModuleManager.class).getEnvironment();
  context.get(ModuleManager.class).loadEnvironment(Collections.<Module>emptySet(),true);
  if (!shuttingDown) {
    context.get(EnvironmentSwitchHandler.class).handleSwitchToEmptyEnivronment(context);
  }
  if (oldEnvironment != null) {
    oldEnvironment.close();
  }
  console.dispose();
  GameThread.clearWaitingProcesses();
  nuiManager.getHUD().clearVisibleBinding();
}

Fixed version (ground truth):
@Override public void dispose(boolean shuttingDown){
  ChunkProvider chunkProvider=context.get(ChunkProvider.class);
  chunkProvider.dispose();
  boolean save=networkSystem.getMode().isAuthority();
  if (save) {
    storageManager.waitForCompletionOfPreviousSaveAndStartSaving();
  }
  networkSystem.shutdown();
  eventSystem.process();
  GameThread.processWaitingProcesses();
  nuiManager.clear();
  context.get(AudioManager.class).stopAllSounds();
  if (worldRenderer != null) {
    worldRenderer.dispose();
    worldRenderer=null;
  }
  componentSystemManager.shutdown();
  context.get(PhysicsEngine.class).dispose();
  entityManager.clear();
  if (storageManager != null) {
    storageManager.finishSavingAndShutdown();
  }
  ModuleEnvironment oldEnvironment=context.get(ModuleManager.class).getEnvironment();
  context.get(ModuleManager.class).loadEnvironment(Collections.<Module>emptySet(),true);
  if (!shuttingDown) {
    context.get(EnvironmentSwitchHandler.class).handleSwitchToEmptyEnvironment(context);
  }
  if (oldEnvironment != null) {
    oldEnvironment.close();
  }
  console.dispose();
  GameThread.clearWaitingProcesses();
  nuiManager.getHUD().clearVisibleBinding();
}
Program: 418
Project: 418
Buggy source:
@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(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(characterHeldItemComponent.selectedItem);
    }
  }
}
Program: 419
Project: 419
Buggy source:
@ReceiveEvent public void onHeldItemChanged(OnChangedComponent event,EntityRef character,CharacterHeldItemComponent heldItemComponent,CharacterComponent characterComponents){
  if (localPlayer.getCharacterEntity().equals(character)) {
    EntityRef oldHeldItem=currentHeldItem;
    currentHeldItem=heldItemComponent.selectedItem;
    linkHeldItemLocationForLocalPlayer(currentHeldItem,oldHeldItem);
  }
}

Fixed version (ground truth):
@ReceiveEvent public void onHeldItemChanged(OnChangedComponent event,EntityRef character,CharacterHeldItemComponent heldItemComponent,CharacterComponent characterComponents){
  if (localPlayer.getCharacterEntity().equals(character)) {
    EntityRef newItem=heldItemComponent.selectedItem;
    linkHeldItemLocationForLocalPlayer(newItem);
  }
}
Program: 420
Project: 420
Buggy source:
@ReceiveEvent public void onHeldItemActivated(OnActivatedComponent event,EntityRef character,CharacterHeldItemComponent heldItemComponent,CharacterComponent characterComponents){
  if (localPlayer.getCharacterEntity().equals(character)) {
    EntityRef oldHeldItem=currentHeldItem;
    currentHeldItem=heldItemComponent.selectedItem;
    linkHeldItemLocationForLocalPlayer(currentHeldItem,oldHeldItem);
  }
}

Fixed version (ground truth):
@ReceiveEvent public void onHeldItemActivated(OnActivatedComponent event,EntityRef character,CharacterHeldItemComponent heldItemComponent,CharacterComponent characterComponents){
  if (localPlayer.getCharacterEntity().equals(character)) {
    EntityRef newItem=heldItemComponent.selectedItem;
    linkHeldItemLocationForLocalPlayer(newItem);
  }
}
Program: 421
Project: 421
Buggy source:
@Override public void preSave(){
  if (clientHeldItem != EntityRef.NULL) {
    clientHeldItem.destroy();
  }
}

Fixed version (ground truth):
@Override public void preSave(){
  if (currentHeldItem != EntityRef.NULL) {
    currentHeldItem.destroy();
  }
}
Program: 425
Project: 425
Buggy source:
@Override public void propertyChange(PropertyChangeEvent event){
  outputFboHeight=ssaoBlurredFbo.height();
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent event){
  outputFboWidth=ssaoBlurredFbo.width();
  outputFboHeight=ssaoBlurredFbo.height();
}
Program: 426
Project: 426
Buggy source:
public MapWorldProvider(WorldGenerator worldGenerator,BlockManagerImpl blockManager,BiomeManager biomeManager){
  this.worldGenerator=worldGenerator;
  this.blockManager=blockManager;
  this.biomeManager=biomeManager;
  entityBuffer=new EntityBufferImpl();
}

Fixed version (ground truth):
public MapWorldProvider(WorldGenerator worldGenerator,BlockManager blockManager,BiomeManager biomeManager){
  this.worldGenerator=worldGenerator;
  this.blockManager=blockManager;
  this.biomeManager=biomeManager;
  entityBuffer=new EntityBufferImpl();
}
Program: 427
Project: 427
Buggy source:
public void setupWorldProvider(WorldGenerator generator){
  generator.initialize();
  WorldProviderCore stub=new MapWorldProvider(generator,blockManager,Mockito.mock(BiomeManager.class));
  WorldProvider world=new WorldProviderWrapper(stub);
  CoreRegistry.put(WorldProvider.class,world);
  CoreRegistry.put(BlockEntityRegistry.class,new EntityAwareWorldProvider(stub,context));
}

Fixed version (ground truth):
public void setupWorldProvider(WorldGenerator generator){
  generator.initialize();
  WorldProviderCore stub=new MapWorldProvider(generator,context.get(BlockManager.class),Mockito.mock(BiomeManager.class));
  WorldProvider world=new WorldProviderWrapper(stub);
  CoreRegistry.put(WorldProvider.class,world);
  CoreRegistry.put(BlockEntityRegistry.class,new EntityAwareWorldProvider(stub,context));
}
Program: 428
Project: 428
Buggy source:
public CountDelegate(BehaviorNode delegate){
  super(delegate);
  id=nextId2;
  nextId2++;
}

Fixed version (ground truth):
CountDelegate(BehaviorNode delegate){
  super(delegate);
  id=nextId2;
  nextId2++;
}
Program: 429
Project: 429
Buggy source:
public static void main(String[] args){
  BehaviorTreeBuilder treeBuilder=new BehaviorTreeBuilder();
  BehaviorNode node=treeBuilder.fromJson("String_Node_Str");
  System.out.println(new DefaultBehaviorTreeRunner(node,null).step());
  treeBuilder.registerAction("String_Node_Str",Print.class);
  node=treeBuilder.fromJson("String_Node_Str");
  System.out.println(new DefaultBehaviorTreeRunner(node,null).step());
  treeBuilder.registerAction("String_Node_Str",Delay.class);
  Actor actor=new Actor(null);
  actor.setDelta(0.1f);
  node=treeBuilder.fromJson("String_Node_Str");
  DefaultBehaviorTreeRunner tree=new DefaultBehaviorTreeRunner(node,actor);
  for (int i=0; i < 100; i++) {
    tree.step();
  }
  System.out.println();
  treeBuilder.registerDecorator("String_Node_Str",Repeat.class);
  actor=new Actor(null);
  actor.setDelta(0.1f);
  node=treeBuilder.fromJson("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  tree=new DefaultBehaviorTreeRunner(node,actor);
  for (int i=0; i < 100; i++) {
    tree.step();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  BehaviorTreeBuilder treeBuilder=new BehaviorTreeBuilder();
  BehaviorNode node=treeBuilder.fromJson("String_Node_Str");
  logger.info("String_Node_Str",new DefaultBehaviorTreeRunner(node,null).step());
  treeBuilder.registerAction("String_Node_Str",Print.class);
  node=treeBuilder.fromJson("String_Node_Str");
  logger.info("String_Node_Str",new DefaultBehaviorTreeRunner(node,null).step());
  treeBuilder.registerAction("String_Node_Str",Delay.class);
  Actor actor=new Actor(null);
  actor.setDelta(0.1f);
  node=treeBuilder.fromJson("String_Node_Str");
  DefaultBehaviorTreeRunner tree=new DefaultBehaviorTreeRunner(node,actor);
  for (int i=0; i < 100; i++) {
    tree.step();
  }
  treeBuilder.registerDecorator("String_Node_Str",Repeat.class);
  actor=new Actor(null);
  actor.setDelta(0.1f);
  node=treeBuilder.fromJson("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  tree=new DefaultBehaviorTreeRunner(node,actor);
  for (int i=0; i < 100; i++) {
    tree.step();
  }
}
Program: 430
Project: 430
Buggy source:
public String toString(){
  return actor.hasComponent(DisplayNameComponent.class) ? actor.getComponent(DisplayNameComponent.class).name : "String_Node_Str" + actor.getEntity().getParentPrefab().getName();
}

Fixed version (ground truth):
@Override public String toString(){
  if (actor.hasComponent(DisplayNameComponent.class)) {
    return actor.getComponent(DisplayNameComponent.class).name;
  }
  return "String_Node_Str" + actor.getEntity().getParentPrefab().getName();
}
Program: 431
Project: 431
Buggy source:
@Override public void initialise(){
  List<ResourceUrn> uris=Lists.newArrayList();
  uris.addAll(new ArrayList<>(assetManager.getAvailableAssets(StaticSound.class)));
  for (  ResourceUrn uri : assetManager.getAvailableAssets(BehaviorTree.class)) {
    Optional<BehaviorTree> asset=assetManager.getAsset(uri,BehaviorTree.class);
    asset.ifPresent(behaviorTree -> trees.add(behaviorTree));
  }
}

Fixed version (ground truth):
@Override public void initialise(){
  List<ResourceUrn> uris=Lists.newArrayList();
  uris.addAll(new ArrayList<>(assetManager.getAvailableAssets(StaticSound.class)));
  for (  ResourceUrn uri : assetManager.getAvailableAssets(BehaviorTree.class)) {
    try {
      Optional<BehaviorTree> asset=assetManager.getAsset(uri,BehaviorTree.class);
      asset.ifPresent(behaviorTree -> trees.add(behaviorTree));
    }
 catch (    RuntimeException e) {
      logger.info("String_Node_Str",uri,e);
    }
  }
}
Program: 432
Project: 432
Buggy source:
@Override protected void setupWorldProvider(){
  WorldProvider worldProvider=mock(WorldProvider.class);
  when(worldProvider.getWorldInfo()).thenReturn(new WorldInfo());
  when(worldProvider.getTime()).thenReturn(worldTime);
  context.put(WorldProvider.class,worldProvider);
}

Fixed version (ground truth):
@Override protected void setupWorldProvider(){
  WorldProvider worldProvider=mock(WorldProvider.class);
  when(worldProvider.getWorldInfo()).thenReturn(new WorldInfo());
  when(worldProvider.getTime()).thenReturn(WORLD_TIME);
  context.put(WorldProvider.class,worldProvider);
}
Program: 433
Project: 433
Buggy source:
@Test public void testSubscribe(){
  final int SUBSCRIBER_COUNT=10;
  for (int i=0; i < SUBSCRIBER_COUNT; i++) {
    setting.subscribe(propertyChangeEvent -> eventCallCount++);
  }
  setting.setValue(30);
  assertEquals(SUBSCRIBER_COUNT,eventCallCount);
}

Fixed version (ground truth):
@Test public void testSubscribe(){
  final int subscriberCount=10;
  for (int i=0; i < subscriberCount; i++) {
    setting.subscribe(propertyChangeEvent -> eventCallCount++);
  }
  setting.setValue(30);
  assertEquals(subscriberCount,eventCallCount);
}
Program: 434
Project: 434
Buggy source:
@Test public void testSetEventCall(){
  setting.subscribe(listener);
  Random random=new FastRandom();
  final int MAX_SET_VALUE_COUNT=50;
  int expectedEventCallCount=0;
  for (int i=0; i < MAX_SET_VALUE_COUNT; i++) {
    int randomInt=random.nextInt(-50,150);
    expectedEventCallCount+=setting.setValue(randomInt) ? 1 : 0;
  }
  assertEquals(expectedEventCallCount,eventCallCount);
}

Fixed version (ground truth):
@Test public void testSetEventCall(){
  setting.subscribe(listener);
  Random random=new FastRandom();
  final int maxSetValueCount=50;
  int expectedEventCallCount=0;
  for (int i=0; i < maxSetValueCount; i++) {
    int randomInt=random.nextInt(-50,150);
    expectedEventCallCount+=setting.setValue(randomInt) ? 1 : 0;
  }
  assertEquals(expectedEventCallCount,eventCallCount);
}
Program: 435
Project: 435
Buggy source:
public CharlieNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}

Fixed version (ground truth):
CharlieNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}
Program: 436
Project: 436
Buggy source:
public EchoNode(){
}

Fixed version (ground truth):
EchoNode(){
}
Program: 437
Project: 437
Buggy source:
public BravoNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}

Fixed version (ground truth):
BravoNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}
Program: 438
Project: 438
Buggy source:
public DeltaNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}

Fixed version (ground truth):
DeltaNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}
Program: 439
Project: 439
Buggy source:
public AlphaNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}

Fixed version (ground truth):
AlphaNode(){
  addDesiredStateChange(new SetName("String_Node_Str"));
}
Program: 440
Project: 440
Buggy source:
@Test public void testAllRelativeWidths() throws Exception {
  rowLayout.setColumnRatios(0.4f,0.5f,0.1f);
  rowLayout.setHorizontalSpacing(0);
  Vector2i result=rowLayout.getPreferredContentSize(canvas,canvas.size());
  assertEquals(CANVAS_WIDTH,result.x);
  assertEquals(15,result.y);
  rowLayout.onDraw(canvas);
  final int WIDTH_1=CANVAS_WIDTH * 4 / 10;
  final int WIDTH_2=CANVAS_WIDTH / 2;
  final int WIDTH_3=CANVAS_WIDTH / 10;
  verify(canvas).drawWidget(itemAt1x1,Rect2i.createFromMinAndSize(0,0,WIDTH_1,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x2,Rect2i.createFromMinAndSize(WIDTH_1,0,WIDTH_2,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x3,Rect2i.createFromMinAndSize(WIDTH_1 + WIDTH_2,0,WIDTH_3,CANVAS_HEIGHT));
}

Fixed version (ground truth):
@Test public void testAllRelativeWidths() throws Exception {
  rowLayout.setColumnRatios(0.4f,0.5f,0.1f);
  rowLayout.setHorizontalSpacing(0);
  Vector2i result=rowLayout.getPreferredContentSize(canvas,canvas.size());
  assertEquals(CANVAS_WIDTH,result.x);
  assertEquals(15,result.y);
  rowLayout.onDraw(canvas);
  final int width1=CANVAS_WIDTH * 4 / 10;
  final int width2=CANVAS_WIDTH / 2;
  final int width3=CANVAS_WIDTH / 10;
  verify(canvas).drawWidget(itemAt1x1,Rect2i.createFromMinAndSize(0,0,width1,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x2,Rect2i.createFromMinAndSize(width1,0,width2,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x3,Rect2i.createFromMinAndSize(width1 + width2,0,width3,CANVAS_HEIGHT));
}
Program: 441
Project: 441
Buggy source:
@Test public void testSomeRelativeWidths() throws Exception {
  rowLayout.setColumnRatios(0.5f);
  rowLayout.setHorizontalSpacing(0);
  Vector2i result=rowLayout.getPreferredContentSize(canvas,canvas.size());
  assertEquals(CANVAS_WIDTH,result.x);
  assertEquals(15,result.y);
  rowLayout.onDraw(canvas);
  final int WIDTH_1=CANVAS_WIDTH / 2;
  final int WIDTH_2=(CANVAS_WIDTH - WIDTH_1) / 2;
  final int WIDTH_3=(CANVAS_WIDTH - WIDTH_1) / 2;
  verify(canvas).drawWidget(itemAt1x1,Rect2i.createFromMinAndSize(0,0,WIDTH_1,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x2,Rect2i.createFromMinAndSize(WIDTH_1,0,WIDTH_2,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x3,Rect2i.createFromMinAndSize(WIDTH_1 + WIDTH_2,0,WIDTH_3,CANVAS_HEIGHT));
}

Fixed version (ground truth):
@Test public void testSomeRelativeWidths() throws Exception {
  rowLayout.setColumnRatios(0.5f);
  rowLayout.setHorizontalSpacing(0);
  Vector2i result=rowLayout.getPreferredContentSize(canvas,canvas.size());
  assertEquals(CANVAS_WIDTH,result.x);
  assertEquals(15,result.y);
  rowLayout.onDraw(canvas);
  final int width1=CANVAS_WIDTH / 2;
  final int width2=(CANVAS_WIDTH - width1) / 2;
  final int width3=(CANVAS_WIDTH - width1) / 2;
  verify(canvas).drawWidget(itemAt1x1,Rect2i.createFromMinAndSize(0,0,width1,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x2,Rect2i.createFromMinAndSize(width1,0,width2,CANVAS_HEIGHT));
  verify(canvas).drawWidget(itemAt1x3,Rect2i.createFromMinAndSize(width1 + width2,0,width3,CANVAS_HEIGHT));
}
Program: 442
Project: 442
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean add(Setting setting){
  SimpleUri id=setting.getId();
  if (id == null) {
    LOGGER.warn("String_Node_Str");
    return false;
  }
 else   if (contains(id)) {
    LOGGER.warn("String_Node_Str",id);
    return false;
  }
  settingMap.put(id,setting);
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean add(Setting setting){
  SimpleUri id=setting.getId();
  if (id == null) {
    LOGGER.warn("String_Node_Str");
    return false;
  }
 else   if (contains(id)) {
    LOGGER.warn("String_Node_Str",id);
    return false;
  }
  settingMap.put(id,setting);
  return true;
}
Program: 443
Project: 443
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean contains(SimpleUri id){
  return settingMap.containsKey(id);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean contains(SimpleUri id){
  return settingMap.containsKey(id);
}
Program: 444
Project: 444
Buggy source:
/** 
 * {@inheritDoc}
 */
@SuppressWarnings("String_Node_Str") public <V>Setting<V> get(SimpleUri id){
  return (Setting<V>)settingMap.get(id);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @SuppressWarnings("String_Node_Str") public <V>Setting<V> get(SimpleUri id){
  return (Setting<V>)settingMap.get(id);
}
Program: 445
Project: 445
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean remove(SimpleUri id){
  Setting setting=get(id);
  if (setting == null) {
    LOGGER.warn("String_Node_Str",id);
    return false;
  }
 else   if (setting.hasSubscribers()) {
    LOGGER.warn("String_Node_Str",id);
    return false;
  }
  settingMap.remove(id);
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean remove(SimpleUri id){
  Setting setting=get(id);
  if (setting == null) {
    LOGGER.warn("String_Node_Str",id);
    return false;
  }
 else   if (setting.hasSubscribers()) {
    LOGGER.warn("String_Node_Str",id);
    return false;
  }
  settingMap.remove(id);
  return true;
}
Program: 446
Project: 446
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean subscribe(PropertyChangeListener listener){
  if (subscribers == null) {
    subscribers=Sets.newHashSet();
  }
  if (listener == null) {
    LOGGER.warn(MessageFormat.format(this.warningFormatString,"String_Node_Str"));
    return false;
  }
  if (subscribers.contains(listener)) {
    LOGGER.warn(MessageFormat.format(this.warningFormatString,"String_Node_Str"));
    return false;
  }
  subscribers.add(listener);
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean subscribe(PropertyChangeListener listener){
  if (subscribers == null) {
    subscribers=Sets.newHashSet();
  }
  if (listener == null) {
    LOGGER.warn(MessageFormat.format(this.warningFormatString,"String_Node_Str"));
    return false;
  }
  if (subscribers.contains(listener)) {
    LOGGER.warn(MessageFormat.format(this.warningFormatString,"String_Node_Str"));
    return false;
  }
  subscribers.add(listener);
  return true;
}
Program: 447
Project: 447
Buggy source:
/** 
 * {@inheritDoc}
 */
public SimpleUri getId(){
  return id;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public SimpleUri getId(){
  return id;
}
Program: 448
Project: 448
Buggy source:
/** 
 * Creates a new   {@link SettingImpl} with the given id, default value and validator.
 * @param id           the id of the setting.
 * @param defaultValue the default value of the setting.
 * @param validator    the validator to be used to validate values.
 */
public SettingImpl(SimpleUri id,T defaultValue,SettingValueValidator<T> validator){
  this.id=id;
  this.warningFormatString=MessageFormat.format("String_Node_Str",this.id);
  this.validator=validator;
  if (!validate(defaultValue))   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  this.defaultValue=defaultValue;
  this.value=this.defaultValue;
  this.subscribers=null;
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link SettingImpl} with the given id, default value and validator.
 * @param id           the id of the setting.
 * @param defaultValue the default value of the setting.
 * @param validator    the validator to be used to validate values.
 */
public SettingImpl(SimpleUri id,T defaultValue,SettingValueValidator<T> validator){
  this.id=id;
  this.warningFormatString=MessageFormat.format("String_Node_Str",this.id);
  this.validator=validator;
  if (!validate(defaultValue)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  this.defaultValue=defaultValue;
  this.value=this.defaultValue;
  this.subscribers=null;
}
Program: 449
Project: 449
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getDescription(){
  return description;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String getDescription(){
  return description;
}
Program: 450
Project: 450
Buggy source:
/** 
 * {@inheritDoc}
 */
public T getDefaultValue(){
  return defaultValue;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T getDefaultValue(){
  return defaultValue;
}
Program: 451
Project: 451
Buggy source:
/** 
 * {@inheritDoc}
 */
public T getValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T getValue(){
  return value;
}
Program: 452
Project: 452
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean unsubscribe(PropertyChangeListener listener){
  if (!subscribers.contains(listener)) {
    LOGGER.warn(MessageFormat.format(this.warningFormatString,"String_Node_Str"),id);
    return false;
  }
  subscribers.remove(listener);
  if (subscribers.size() <= 0) {
    subscribers=null;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean unsubscribe(PropertyChangeListener listener){
  if (!subscribers.contains(listener)) {
    LOGGER.warn(MessageFormat.format(this.warningFormatString,"String_Node_Str"),id);
    return false;
  }
  subscribers.remove(listener);
  if (subscribers.size() <= 0) {
    subscribers=null;
  }
  return true;
}
Program: 453
Project: 453
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean hasSubscribers(){
  return subscribers != null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean hasSubscribers(){
  return subscribers != null;
}
Program: 454
Project: 454
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean setValue(T newValue){
  if (!validate(newValue)) {
    return false;
  }
  PropertyChangeEvent event=new PropertyChangeEvent(this,id.toString(),this.value,newValue);
  this.value=newValue;
  dispatchChangedEvent(event);
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean setValue(T newValue){
  if (!validate(newValue)) {
    return false;
  }
  PropertyChangeEvent event=new PropertyChangeEvent(this,id.toString(),this.value,newValue);
  this.value=newValue;
  dispatchChangedEvent(event);
  return true;
}
Program: 455
Project: 455
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getHumanReadableName(){
  return humanReadableName;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String getHumanReadableName(){
  return humanReadableName;
}
Program: 456
Project: 456
Buggy source:
/** 
 * {@inheritDoc}
 */
public SettingValueValidator<T> getValidator(){
  return validator;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public SettingValueValidator<T> getValidator(){
  return validator;
}
Program: 457
Project: 457
Buggy source:
private boolean validate(T value){
  return validator == null || validator.validate(value);
}

Fixed version (ground truth):
private boolean validate(T valueToValidate){
  return validator == null || validator.validate(valueToValidate);
}