nus-yam/ex-repair huggingface dataset:
Program: 940
Project: 940
Buggy source:
private void markForPropagation(LitChunk toChunk,int[] depth,int[] startingRegen,int[] adjDepths,int[] adjStartingRegen){
  Vector3i pos=new Vector3i();
  for (int z=0; z < ChunkConstants.SIZE_Z; ++z) {
    for (int x=0; x < ChunkConstants.SIZE_X; ++x) {
      int depthIndex=x + ChunkConstants.SIZE_X * z;
      int start=startingRegen[depthIndex];
      int adjStart=adjStartingRegen[depthIndex];
      if (start - adjStart > 1) {
        int initialDepth=Math.max(ChunkConstants.SUNLIGHT_REGEN_THRESHOLD - start,0);
        int finalDepth=depth[depthIndex];
        int strength=Math.min(start + initialDepth - ChunkConstants.SUNLIGHT_REGEN_THRESHOLD + 1,ChunkConstants.MAX_SUNLIGHT);
        for (int i=initialDepth; i < finalDepth; ++i) {
          sunlightPropagator.propagateFrom(toChunk.chunkToWorldPosition(x,ChunkConstants.SIZE_Y - i - 1,z),(byte)(strength));
          if (strength < ChunkConstants.MAX_SUNLIGHT) {
            strength++;
          }
        }
      }
 else {
        int initialDepth=Math.max(adjDepths[depthIndex],ChunkConstants.SUNLIGHT_REGEN_THRESHOLD - start);
        byte strength=(byte)Math.min(ChunkConstants.MAX_SUNLIGHT,start + initialDepth - ChunkConstants.SUNLIGHT_REGEN_THRESHOLD + 1);
        for (int i=initialDepth; i < depth[depthIndex]; ++i) {
          sunlightPropagator.propagateFrom(toChunk.chunkToWorldPosition(x,ChunkConstants.SIZE_Y - i - 1,z),strength);
          if (strength < ChunkConstants.MAX_SUNLIGHT) {
            strength++;
          }
          pos.y--;
        }
      }
    }
  }
}

Fixed version (ground truth):
private void markForPropagation(LitChunk toChunk,int[] depth,int[] startingRegen,int[] adjDepths,int[] adjStartingRegen){
  Vector3i pos=new Vector3i();
  for (int z=0; z < ChunkConstants.SIZE_Z; ++z) {
    for (int x=0; x < ChunkConstants.SIZE_X; ++x) {
      int depthIndex=x + ChunkConstants.SIZE_X * z;
      int start=startingRegen[depthIndex];
      int adjStart=adjStartingRegen[depthIndex];
      if (start - adjStart > 1) {
        int initialDepth=Math.max(ChunkConstants.SUNLIGHT_REGEN_THRESHOLD - start,0);
        int finalDepth=depth[depthIndex];
        int strength=Math.min(start + initialDepth - ChunkConstants.SUNLIGHT_REGEN_THRESHOLD + 1,ChunkConstants.MAX_SUNLIGHT);
        for (int i=initialDepth; i < finalDepth; ++i) {
          sunlightPropagator.propagateFrom(toChunk.chunkToWorldPosition(x,ChunkConstants.SIZE_Y - i - 1,z),(byte)(strength));
          if (strength < ChunkConstants.MAX_SUNLIGHT) {
            strength++;
          }
        }
      }
 else {
        int initialDepth=Math.max(adjDepths[depthIndex],ChunkConstants.SUNLIGHT_REGEN_THRESHOLD - start);
        byte strength=(byte)Math.min(ChunkConstants.MAX_SUNLIGHT,start + initialDepth - ChunkConstants.SUNLIGHT_REGEN_THRESHOLD + 1);
        for (int i=initialDepth; i <= depth[depthIndex]; ++i) {
          sunlightPropagator.propagateFrom(toChunk.chunkToWorldPosition(x,ChunkConstants.SIZE_Y - i - 1,z),strength);
          if (strength < ChunkConstants.MAX_SUNLIGHT) {
            strength++;
          }
          pos.y--;
        }
      }
    }
  }
}
Program: 941
Project: 941
Buggy source:
@Override public boolean step(){
  if (prefabs.hasNext()) {
    Assets.get(prefabs.next(),Prefab.class);
    step();
  }
  return !prefabs.hasNext();
}

Fixed version (ground truth):
@Override public boolean step(){
  if (prefabs.hasNext()) {
    Assets.get(prefabs.next(),Prefab.class);
    stepDone();
  }
  return !prefabs.hasNext();
}
Program: 943
Project: 943
Buggy source:
private boolean processChunkUpdate(ChunkImpl c){
  if ((c.isDirty() || c.getMesh() == null) && isChunkValidForRender(c)) {
    statDirtyChunks++;
    chunkUpdateManager.queueChunkUpdate(c);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean processChunkUpdate(ChunkImpl c){
  if ((c.isDirty() || c.getMesh() == null)) {
    statDirtyChunks++;
    chunkUpdateManager.queueChunkUpdate(c);
    return true;
  }
  return false;
}
Program: 944
Project: 944
Buggy source:
@Override public void run(){
  ChunkImpl chunk=new ChunkImpl(getPosition());
  generator.createChunk(chunk);
  if (nearCache.putIfAbsent(getPosition(),chunk) != null) {
    logger.warn("String_Node_Str",getPosition());
  }
  preparingChunks.remove(getPosition());
  pipeline.requestReview(Region3i.createFromCenterExtents(getPosition(),ChunkConstants.SECOND_PASS_EXTENTS));
}

Fixed version (ground truth):
@Override public void run(){
  ChunkImpl chunk=new ChunkImpl(getPosition());
  generator.createChunk(chunk);
  if (nearCache.putIfAbsent(getPosition(),chunk) != null) {
    logger.warn("String_Node_Str",getPosition());
  }
  preparingChunks.remove(getPosition());
  pipeline.requestReview(Region3i.createFromCenterExtents(getPosition(),ChunkConstants.GENERATION_EXTENTS));
}
Program: 946
Project: 946
Buggy source:
@Override public void removeRelevanceEntity(EntityRef entity){
  regionLock.writeLock().lock();
  try {
    ChunkRelevanceRegion region=regions.remove(entity);
    if (region != null) {
      pendingRemoveRegions.add(region);
    }
  }
  finally {
    regionLock.writeLock().unlock();
  }
}

Fixed version (ground truth):
@Override public void removeRelevanceEntity(EntityRef entity){
  regionLock.writeLock().lock();
  try {
    regions.remove(entity);
  }
  finally {
    regionLock.writeLock().unlock();
  }
}
Program: 947
Project: 947
Buggy source:
@Override public void run(){
  ChunkView view=getProvider().getViewAround(getPosition());
  if (view == null) {
    return;
  }
  view.lock();
  try {
    if (!view.isValidView()) {
      return;
    }
    ChunkImpl chunk=getProvider().getChunkForProcessing(getPosition());
    if (chunk.getChunkState() != ChunkImpl.State.ADJACENCY_GENERATION_PENDING) {
      return;
    }
    getPipeline().getWorldGenerator().applySecondPass(getPosition(),view);
    chunk.setChunkState(ChunkImpl.State.INTERNAL_LIGHT_GENERATION_PENDING);
    getPipeline().requestReview(Region3i.createFromCenterExtents(getPosition(),ChunkConstants.SECOND_PASS_EXTENTS));
  }
  finally {
    view.unlock();
  }
}

Fixed version (ground truth):
@Override public void run(){
  ChunkView view=getProvider().getSecondPassView(getPosition());
  if (view == null) {
    return;
  }
  view.lock();
  try {
    if (!view.isValidView()) {
      return;
    }
    ChunkImpl chunk=getProvider().getChunkForProcessing(getPosition());
    if (chunk.getChunkState() != ChunkImpl.State.ADJACENCY_GENERATION_PENDING) {
      return;
    }
    getPipeline().getWorldGenerator().applySecondPass(getPosition(),view);
    chunk.setChunkState(ChunkImpl.State.INTERNAL_LIGHT_GENERATION_PENDING);
    getPipeline().requestReview(Region3i.createFromCenterExtents(getPosition(),ChunkConstants.SECOND_PASS_EXTENTS));
  }
  finally {
    view.unlock();
  }
}
Program: 948
Project: 948
Buggy source:
/** 
 * Generates grass or a flower on the given chunk.
 * @param c The chunk
 * @param x Position on the x-axis
 * @param y Position on the y-axis
 * @param z Position on the z-axis
 */
private void generateGrassAndFlowers(Chunk c,int x,int y,int z,Random random){
  Block targetBlock=c.getBlock(x,y,z);
  if ((targetBlock.equals(grassBlock) || targetBlock.equals(sandBlock) || targetBlock.equals(snowBlock)) && c.getBlock(x,y + 1,z).equals(airBlock)) {
    WorldBiomeProvider.Biome biome=biomeProvider.getBiomeAt(c.getBlockWorldPosX(x),c.getBlockWorldPosZ(z));
    if (random.nextFloat() < config.getGrassDensity(biome)) {
      double rand=random.nextGaussian();
      if (rand > -0.4 && rand < 0.4) {
        c.setBlock(x,y + 1,z,tallGrass1);
      }
 else       if (rand > -0.6 && rand < 0.6) {
        c.setBlock(x,y + 1,z,tallGrass2);
      }
 else {
        c.setBlock(x,y + 1,z,tallGrass3);
      }
      if (random.nextGaussian() < -2) {
        c.setBlock(x,y + 1,z,random.nextItem(flowers));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Generates grass or a flower on the given chunk.
 * @param c The chunk
 * @param x Position on the x-axis
 * @param y Position on the y-axis
 * @param z Position on the z-axis
 */
private boolean generateGrassAndFlowers(Chunk c,int x,int y,int z,Random random){
  Block targetBlock=c.getBlock(x,y,z);
  if ((targetBlock.equals(grassBlock) || targetBlock.equals(sandBlock) || targetBlock.equals(snowBlock)) && c.getBlock(x,y + 1,z).equals(airBlock)) {
    WorldBiomeProvider.Biome biome=biomeProvider.getBiomeAt(c.getBlockWorldPosX(x),c.getBlockWorldPosZ(z));
    if (random.nextFloat() < config.getGrassDensity(biome)) {
      double rand=random.nextGaussian();
      if (rand > -0.4 && rand < 0.4) {
        c.setBlock(x,y + 1,z,tallGrass1);
      }
 else       if (rand > -0.6 && rand < 0.6) {
        c.setBlock(x,y + 1,z,tallGrass2);
      }
 else {
        c.setBlock(x,y + 1,z,tallGrass3);
      }
      if (random.nextGaussian() < -2) {
        c.setBlock(x,y + 1,z,random.nextItem(flowers));
      }
    }
    return true;
  }
  return false;
}
Program: 949
Project: 949
Buggy source:
@Override public void generateChunk(Chunk c){
  FastRandom random=new FastRandom(worldSeed.hashCode() ^ (c.getPos().x + 39L * (c.getPos().y + 39L * c.getPos().z)));
  for (int y=0; y < c.getChunkSizeY(); y++) {
    for (int x=0; x < c.getChunkSizeX(); x++) {
      for (int z=0; z < c.getChunkSizeZ(); z++) {
        generateGrassAndFlowers(c,x,y,z,random);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void generateChunk(Chunk c){
  FastRandom random=new FastRandom(worldSeed.hashCode() ^ (c.getPos().x + 39L * (c.getPos().y + 39L * c.getPos().z)));
  for (int x=0; x < c.getChunkSizeX(); x++) {
    for (int z=0; z < c.getChunkSizeZ(); z++) {
      for (int y=c.getChunkSizeY() - 2; y >= 0; y--) {
        if (generateGrassAndFlowers(c,x,y,z,random)) {
          break;
        }
      }
    }
  }
}
Program: 950
Project: 950
Buggy source:
@Override public void initialize(){
  register(new FlatTerrainGenerator());
  ForestGenerator forestGenerator=new ForestGenerator();
  DefaultGenerators.addDefaultForestGenerators(forestGenerator);
}

Fixed version (ground truth):
@Override public void initialize(){
  register(new FlatTerrainGenerator());
  register(new FloraGenerator());
  ForestGenerator forestGenerator=new ForestGenerator();
  DefaultGenerators.addDefaultForestGenerators(forestGenerator);
}
Program: 953
Project: 953
Buggy source:
@Override public void dispose(){
  if (CoreRegistry.get(Config.class).getRendering().isOculusVrSupport() && OculusVrHelper.isNativeLibraryLoaded()) {
    logger.info("String_Node_Str");
    TeraOVR.clear();
  }
  boolean save=networkSystem.getMode().isAuthority();
  networkSystem.shutdown();
  eventSystem.process();
  componentSystemManager.shutdown();
  GameThread.processWaitingProcesses();
  nuiManager.clear();
  if (worldRenderer != null) {
    worldRenderer.dispose();
    worldRenderer=null;
  }
  if (save) {
    CoreRegistry.get(Game.class).save();
  }
  CoreRegistry.get(PhysicsEngine.class).dispose();
  entityManager.clear();
  CoreRegistry.get(Console.class).dispose();
  CoreRegistry.clear();
  BlockManager.getAir().setEntity(EntityRef.NULL);
  GameThread.clearWaitingProcesses();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (CoreRegistry.get(Config.class).getRendering().isOculusVrSupport() && OculusVrHelper.isNativeLibraryLoaded()) {
    logger.info("String_Node_Str");
    TeraOVR.clear();
  }
  boolean save=networkSystem.getMode().isAuthority();
  networkSystem.shutdown();
  eventSystem.process();
  GameThread.processWaitingProcesses();
  nuiManager.clear();
  if (worldRenderer != null) {
    worldRenderer.dispose();
    worldRenderer=null;
  }
  componentSystemManager.shutdown();
  if (save) {
    CoreRegistry.get(Game.class).save();
  }
  CoreRegistry.get(PhysicsEngine.class).dispose();
  entityManager.clear();
  CoreRegistry.get(Console.class).dispose();
  CoreRegistry.clear();
  BlockManager.getAir().setEntity(EntityRef.NULL);
  GameThread.clearWaitingProcesses();
}
Program: 954
Project: 954
Buggy source:
public void shutdown(){
  chunkReviewer.shutdown(new ChunkRequest(this,provider,ChunkRequest.Type.EXIT,Region3i.EMPTY),true);
  chunkGenerator.shutdown(new ShutdownChunkTask(),true);
}

Fixed version (ground truth):
public void shutdown(){
  chunkReviewer.shutdown(new ChunkRequest(this,provider,ChunkRequest.Type.EXIT,Region3i.EMPTY),false);
  chunkGenerator.shutdown(new ShutdownChunkTask(),false);
}
Program: 955
Project: 955
Buggy source:
@Override public boolean step(){
  if (componentSystems.hasNext()) {
    componentSystems.next().postBegin();
  }
  return componentSystems.hasNext();
}

Fixed version (ground truth):
@Override public boolean step(){
  if (componentSystems.hasNext()) {
    componentSystems.next().postBegin();
  }
  return !componentSystems.hasNext();
}
Program: 956
Project: 956
Buggy source:
@Override public boolean step(){
  if (componentSystems.hasNext()) {
    componentSystems.next().preBegin();
  }
  return componentSystems.hasNext();
}

Fixed version (ground truth):
@Override public boolean step(){
  if (componentSystems.hasNext()) {
    componentSystems.next().preBegin();
  }
  return !componentSystems.hasNext();
}
Program: 957
Project: 957
Buggy source:
private ColumnInfo calculateColumnSize(List<UIWidget> column,Canvas canvas,Vector2i areaHint){
  int availableHeight=areaHint.y - verticalSpacing * (rows - 1);
  ColumnInfo columnInfo=new ColumnInfo();
  for (int i=0; i < rows && i < column.size(); ++i) {
    UIWidget widget=column.get(i);
    Vector2i cellSize=new Vector2i(availableHeight,areaHint.x);
    cellSize.y*=rowHeights[i];
    if (widget != null) {
      Vector2i contentSize=canvas.calculateRestrictedSize(widget,cellSize);
      columnInfo.widgetSizes.add(contentSize);
      columnInfo.width=Math.max(columnInfo.width,contentSize.x);
    }
 else {
      columnInfo.widgetSizes.add(new Vector2i(0,0));
    }
  }
  return columnInfo;
}

Fixed version (ground truth):
private ColumnInfo calculateColumnSize(List<UIWidget> column,Canvas canvas,Vector2i areaHint){
  int availableHeight=areaHint.y - verticalSpacing * (rows - 1);
  ColumnInfo columnInfo=new ColumnInfo();
  for (int i=0; i < rows && i < column.size(); ++i) {
    UIWidget widget=column.get(i);
    Vector2i cellSize=new Vector2i(areaHint.x,availableHeight);
    cellSize.y*=rowHeights[i];
    if (widget != null) {
      Vector2i contentSize=canvas.calculateRestrictedSize(widget,cellSize);
      columnInfo.widgetSizes.add(contentSize);
      columnInfo.width=Math.max(columnInfo.width,contentSize.x);
    }
 else {
      columnInfo.widgetSizes.add(new Vector2i(0,0));
    }
  }
  return columnInfo;
}
Program: 959
Project: 959
Buggy source:
@Override public boolean step(){
  if (componentSystems.hasNext()) {
    componentSystems.next().postBegin();
  }
  return componentSystems.hasNext();
}

Fixed version (ground truth):
@Override public boolean step(){
  if (componentSystems.hasNext()) {
    componentSystems.next().postBegin();
  }
  return !componentSystems.hasNext();
}
Program: 960
Project: 960
Buggy source:
public UIStyle getElementStyle(Class<? extends UIWidget> element,String part,String mode){
  List<Class<? extends UIWidget>> classes=cachedInheritanceTree.get(element);
  if (classes == null) {
    classes=ReflectionUtil.getInheritanceTree(element,UIWidget.class);
    cachedInheritanceTree.put(element,classes);
  }
  UIStyle style=null;
  for (int i=classes.size() - 1; i >= 0 && style == null; i--) {
    Table<String,String,UIStyle> elementStyles=elementStyleLookup.get(classes.get(i));
    if (elementStyles != null) {
      style=elementStyles.get(part,mode);
      if (style == null) {
        style=elementStyles.get(part,"String_Node_Str");
      }
    }
  }
  if (style == null) {
    return getElementStyle(element);
  }
  return style;
}

Fixed version (ground truth):
public UIStyle getElementStyle(Class<? extends UIWidget> element,String part,String mode){
  List<Class<? extends UIWidget>> classes=cachedInheritanceTree.get(element);
  if (classes == null) {
    classes=ReflectionUtil.getInheritanceTree(element,UIWidget.class);
    cachedInheritanceTree.put(element,classes);
  }
  UIStyle style=null;
  for (int i=classes.size() - 1; i >= 0 && style == null; i--) {
    Table<String,String,UIStyle> elementStyles=elementStyleLookup.get(classes.get(i));
    if (elementStyles != null) {
      style=elementStyles.get(part,mode);
      if (style == null && part.equals(UIWidget.BASE_PART)) {
        style=elementStyles.get("String_Node_Str",mode);
      }
      if (style == null) {
        style=elementStyles.get(part,"String_Node_Str");
      }
    }
  }
  if (style == null) {
    return getElementStyle(element);
  }
  return style;
}
Program: 961
Project: 961
Buggy source:
@Override public <T extends Event>void registerEventReceiver(EventReceiver<T> eventReceiver,Class<T> eventClass,int priority,Class<? extends Component>... componentTypes){
  EventHandlerInfo info=new ReceiverEventHandlerInfo<T>(eventReceiver,priority,componentTypes);
  for (  Class<? extends Component> c : componentTypes) {
    addEventHandler(eventClass,info,c);
    for (    Class<? extends Event> childType : childEvents.get(eventClass)) {
      addEventHandler(childType,info,c);
    }
  }
}

Fixed version (ground truth):
@Override public <T extends Event>void registerEventReceiver(EventReceiver<T> eventReceiver,Class<T> eventClass,int priority,Class<? extends Component>... componentTypes){
  EventHandlerInfo info=new ReceiverEventHandlerInfo<T>(eventReceiver,priority,componentTypes);
  addEventHandler(eventClass,info,Arrays.asList(componentTypes));
}
Program: 963
Project: 963
Buggy source:
private void addEventHandler(Class<? extends Event> type,EventHandlerInfo handlerInfo,Class<? extends Component> c){
  SetMultimap<Class<? extends Component>,EventHandlerInfo> componentMap=componentSpecificHandlers.get(type);
  if (componentMap == null) {
    componentMap=HashMultimap.create();
    componentSpecificHandlers.put(type,componentMap);
  }
  componentMap.put(c,handlerInfo);
}

Fixed version (ground truth):
private void addEventHandler(Class<? extends Event> type,EventHandlerInfo handler,Collection<Class<? extends Component>> components){
  if (components.isEmpty()) {
    generalHandlers.put(type,handler);
    for (    Class<? extends Event> childType : childEvents.get(type)) {
      generalHandlers.put(childType,handler);
    }
  }
 else {
    for (    Class<? extends Component> c : components) {
      addToComponentSpecificHandlers(type,handler,c);
      for (      Class<? extends Event> childType : childEvents.get(type)) {
        addToComponentSpecificHandlers(childType,handler,c);
      }
    }
  }
}
Program: 965
Project: 965
Buggy source:
@Command(shortDescription="String_Node_Str",runOnServer=true) public String giveItem(@CommandParam("String_Node_Str") String itemPrefabName,EntityRef client){
  Prefab prefab=prefabManager.getPrefab(itemPrefabName);
  if (prefab != null && prefab.getComponent(ItemComponent.class) != null) {
    EntityRef item=entityManager.create(prefab);
    EntityRef playerEntity=client.getComponent(ClientComponent.class).character;
    playerEntity.send(new GiveItemAction(item));
    return "String_Node_Str" + prefab.getName();
  }
 else {
    return blockCommands.giveBlock(itemPrefabName,client);
  }
}

Fixed version (ground truth):
@Command(shortDescription="String_Node_Str",runOnServer=true) public String giveItem(@CommandParam("String_Node_Str") String itemPrefabName,EntityRef client){
  Prefab prefab=prefabManager.getPrefab(itemPrefabName);
  if (prefab != null && prefab.getComponent(ItemComponent.class) != null) {
    EntityRef item=entityManager.create(prefab);
    EntityRef playerEntity=client.getComponent(ClientComponent.class).character;
    GiveItemAction event=new GiveItemAction(item);
    playerEntity.send(event);
    if (!event.isConsumed()) {
      item.destroy();
    }
    return "String_Node_Str" + prefab.getName();
  }
 else {
    return blockCommands.giveBlock(itemPrefabName,client);
  }
}
Program: 966
Project: 966
Buggy source:
private boolean shouldDropToWorld(CreateBlockDropsEvent event,Block block,BlockDamageModifierComponent blockDamageModifierComponent,EntityRef item){
  return !isDirectPickup(block,blockDamageModifierComponent) && !inventoryManager.giveItem(event.getInstigator(),item);
}

Fixed version (ground truth):
private boolean shouldDropToWorld(CreateBlockDropsEvent event,Block block,BlockDamageModifierComponent blockDamageModifierComponent,EntityRef item){
  return !isDirectPickup(block,blockDamageModifierComponent) || !inventoryManager.giveItem(event.getInstigator(),item);
}
Program: 967
Project: 967
Buggy source:
/** 
 * Increments time
 * @return The number of update cycles to run
 */
public Iterator<Float> tick(){
  long now=getRawTimeInMs();
  long newDelta=now - last.get();
  if (0 == newDelta) {
    try {
      Thread.sleep(0,1000);
    }
 catch (    InterruptedException e) {
    }
    newDelta=now - last.get();
  }
  if (newDelta >= UPDATE_CAP) {
    logger.warn("String_Node_Str",newDelta,UPDATE_CAP);
    newDelta=UPDATE_CAP;
  }
  int updateCycles=(int)((newDelta - 1) / MAX_UPDATE_CYCLE_LENGTH) + 1;
  last.set(now);
  avgDelta=avgDelta * DECAY_RATE + newDelta * ONE_MINUS_DECAY_RATE;
  if (desynch != 0) {
    long diff=(long)Math.ceil(desynch * RESYNC_TIME_RATE);
    if (diff == 0) {
      diff=(long)Math.signum(desynch);
    }
    gameTime.getAndAdd(diff);
    desynch-=diff;
  }
  if (paused) {
    delta.set(0);
    return new TimeStepper(1,0);
  }
 else {
    if (updateCycles > 0) {
      delta.set(newDelta / updateCycles);
    }
    return new TimeStepper(updateCycles,newDelta / updateCycles);
  }
}

Fixed version (ground truth):
/** 
 * Increments time
 * @return The number of update cycles to run
 */
public Iterator<Float> tick(){
  long now=getRawTimeInMs();
  long newDelta=now - last.get();
  if (0 == newDelta) {
    try {
      Thread.sleep(0,1000);
    }
 catch (    InterruptedException e) {
    }
    now=getRawTimeInMs();
    newDelta=now - last.get();
  }
  if (newDelta >= UPDATE_CAP) {
    logger.warn("String_Node_Str",newDelta,UPDATE_CAP);
    newDelta=UPDATE_CAP;
  }
  int updateCycles=(int)((newDelta - 1) / MAX_UPDATE_CYCLE_LENGTH) + 1;
  last.set(now);
  avgDelta=avgDelta * DECAY_RATE + newDelta * ONE_MINUS_DECAY_RATE;
  if (desynch != 0) {
    long diff=(long)Math.ceil(desynch * RESYNC_TIME_RATE);
    if (diff == 0) {
      diff=(long)Math.signum(desynch);
    }
    gameTime.getAndAdd(diff);
    desynch-=diff;
  }
  if (paused) {
    delta.set(0);
    return new TimeStepper(1,0);
  }
 else {
    if (updateCycles > 0) {
      delta.set(newDelta / updateCycles);
    }
    return new TimeStepper(updateCycles,newDelta / updateCycles);
  }
}
Program: 968
Project: 968
Buggy source:
@Override public void reload(MaterialData newData){
  this.data=data;
}

Fixed version (ground truth):
@Override public void reload(MaterialData newData){
  this.data=newData;
}
Program: 969
Project: 969
Buggy source:
/** 
 * @return The position at the center of the region
 */
public Vector3f center(){
  Vector3f result=min.toVector3f();
  result.add(size.toVector3f());
  result.scale(0.5f);
  return result;
}

Fixed version (ground truth):
/** 
 * @return The position at the center of the region
 */
public Vector3f center(){
  Vector3f result=min.toVector3f();
  Vector3f halfSize=size.toVector3f();
  halfSize.scale(0.5f);
  result.add(halfSize);
  return result;
}
Program: 970
Project: 970
Buggy source:
@Override public <T>ListMultimap<String,Class<? extends T>> findAllSubclassesOf(Class<? extends T> type){
  ListMultimap<String,Class<? extends T>> result=ArrayListMultimap.create();
  List<Class<? extends T>> validSuperTypes=Lists.newArrayList();
  validSuperTypes.add(type);
  for (  Module module : getActiveModulesOrderedByDependency()) {
    List<Class<? extends T>> moduleTypes=Lists.newArrayList();
    for (    Class<? extends T> superType : validSuperTypes) {
      for (      Class<? extends T> subtype : module.getReflections().getSubTypesOf(superType)) {
        moduleTypes.add(subtype);
      }
    }
    result.putAll(module.getId(),moduleTypes);
    for (    Class<? extends T> moduleType : moduleTypes) {
      if (!Modifier.isFinal(moduleType.getModifiers())) {
        validSuperTypes.add(moduleType);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public <T>ListMultimap<String,Class<? extends T>> findAllSubclassesOf(Class<? extends T> type){
  ListMultimap<String,Class<? extends T>> result=ArrayListMultimap.create();
  List<Class<? extends T>> validSuperTypes=Lists.newArrayList();
  validSuperTypes.add(type);
  for (  Module module : getActiveModulesOrderedByDependency()) {
    if (!module.isCodeModule()) {
      continue;
    }
    List<Class<? extends T>> moduleTypes=Lists.newArrayList();
    for (    Class<? extends T> superType : validSuperTypes) {
      for (      Class<? extends T> subtype : module.getReflections().getSubTypesOf(superType)) {
        moduleTypes.add(subtype);
      }
    }
    result.putAll(module.getId(),moduleTypes);
    for (    Class<? extends T> moduleType : moduleTypes) {
      if (!Modifier.isFinal(moduleType.getModifiers())) {
        validSuperTypes.add(moduleType);
      }
    }
  }
  return result;
}
Program: 971
Project: 971
Buggy source:
public ExtensionModule(ModuleManager manager,Path moduleRoot,ModuleInfo info,Version version,AssetSource moduleSource){
  if (info == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.manager=manager;
  this.moduleInfo=info;
  this.moduleRoot=moduleRoot;
  this.moduleSource=moduleSource;
  this.id=UriUtil.normalise(info.getId());
  this.version=version;
}

Fixed version (ground truth):
public ExtensionModule(Path moduleRoot,ModuleInfo info,Version version,AssetSource moduleSource){
  if (info == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.moduleInfo=info;
  this.moduleRoot=moduleRoot;
  this.moduleSource=moduleSource;
  this.id=UriUtil.normalise(info.getId());
  this.version=version;
}
Program: 972
Project: 972
Buggy source:
public ModuleClassLoader(URL[] urls,ClassLoader parent,ModuleSecurityManager securityManager){
  super(urls,parent);
  this.securityManager=securityManager;
  pool=new ClassPool(ClassPool.getDefault());
  for (  URL url : urls) {
    try {
      pool.appendClassPath(Paths.get(url.toURI()).toString());
    }
 catch (    NotFoundException|URISyntaxException e) {
      logger.error("String_Node_Str",url);
    }
  }
}

Fixed version (ground truth):
public ModuleClassLoader(URL[] urls,ClassLoader parent,ModuleSecurityManager securityManager){
  super(urls,parent);
  this.securityManager=securityManager;
  pool=new ClassPool(ClassPool.getDefault());
  for (  URL url : urls) {
    try {
      logger.info("String_Node_Str",Paths.get(url.toURI()).toString());
      pool.appendClassPath(Paths.get(url.toURI()).toString());
    }
 catch (    NotFoundException|URISyntaxException e) {
      logger.error("String_Node_Str",url);
    }
  }
}
Program: 973
Project: 973
Buggy source:
private void processModuleInfo(ModuleInfo moduleInfo,Path modulePath,AssetSource source){
  String moduleId=UriUtil.normalise(moduleInfo.getId());
  Version version=Version.create(moduleInfo.getVersion());
  if (version != null) {
    if (!modules.contains(moduleId,version)) {
      ExtensionModule module=new ExtensionModule(this,modulePath,moduleInfo,version,source);
      modules.put(moduleId,version,module);
      logger.info("String_Node_Str",moduleInfo.getDisplayName(),moduleInfo.getVersion(),module.isCodeModule());
    }
 else {
      logger.info("String_Node_Str",moduleInfo.getDisplayName(),moduleInfo.getVersion());
    }
  }
 else {
    logger.error("String_Node_Str" + moduleInfo.getId() + "String_Node_Str"+ moduleInfo.getVersion()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void processModuleInfo(ModuleInfo moduleInfo,Path modulePath,AssetSource source){
  String moduleId=UriUtil.normalise(moduleInfo.getId());
  Version version=Version.create(moduleInfo.getVersion());
  if (version != null) {
    if (!modules.contains(moduleId,version)) {
      ExtensionModule module=new ExtensionModule(modulePath,moduleInfo,version,source);
      modules.put(moduleId,version,module);
      logger.info("String_Node_Str",moduleInfo.getDisplayName(),moduleInfo.getVersion(),module.isCodeModule());
    }
 else {
      logger.info("String_Node_Str",moduleInfo.getDisplayName(),moduleInfo.getVersion());
    }
  }
 else {
    logger.error("String_Node_Str" + moduleInfo.getId() + "String_Node_Str"+ moduleInfo.getVersion()+ "String_Node_Str");
  }
}
Program: 974
Project: 974
Buggy source:
private MD5 parse(InputStream stream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(stream));
  MD5 md5=new MD5();
  String line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.version=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  Matcher commandlineMatch=commandLinePattern.matcher(line);
  if (commandlineMatch.matches()) {
    md5.commandline=commandlineMatch.group(1);
  }
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numJoints=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numMeshes=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readJoints(reader,md5);
  md5.meshes=new MD5Mesh[md5.numMeshes];
  for (int i=0; i < md5.numMeshes; ++i) {
    MD5ParserCommon.readToLine(reader,"String_Node_Str");
    md5.meshes[i]=readMesh(reader);
  }
  return md5;
}

Fixed version (ground truth):
private MD5 parse(InputStream stream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(stream,Charsets.UTF_8));
  MD5 md5=new MD5();
  String line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.version=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  Matcher commandlineMatch=commandLinePattern.matcher(line);
  if (commandlineMatch.matches()) {
    md5.commandline=commandlineMatch.group(1);
  }
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numJoints=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  line=MD5ParserCommon.readToLine(reader,"String_Node_Str");
  md5.numMeshes=Integer.parseInt(line.split("String_Node_Str",3)[1]);
  MD5ParserCommon.readToLine(reader,"String_Node_Str");
  readJoints(reader,md5);
  md5.meshes=new MD5Mesh[md5.numMeshes];
  for (int i=0; i < md5.numMeshes; ++i) {
    MD5ParserCommon.readToLine(reader,"String_Node_Str");
    md5.meshes[i]=readMesh(reader);
  }
  return md5;
}
Program: 975
Project: 975
Buggy source:
@ReceiveEvent(components=ClientComponent.class,priority=EventPriority.PRIORITY_CRITICAL) public void keyEvent(KeyEvent event,EntityRef entity){
  if (focus != null) {
    focus.onKeyEvent(event);
  }
  if (event.isDown() && !event.isConsumed() && event.getKey() == Keyboard.Key.ESCAPE) {
    if (!screens.isEmpty() && screens.peek().isQuickCloseAllowed()) {
      popScreen();
      event.consume();
    }
  }
}

Fixed version (ground truth):
@ReceiveEvent(components=ClientComponent.class,priority=EventPriority.PRIORITY_CRITICAL) public void keyEvent(KeyEvent event,EntityRef entity){
  if (focus != null) {
    focus.onKeyEvent(event);
  }
  if (event.isDown() && !event.isConsumed() && event.getKey() == Keyboard.Key.ESCAPE) {
    if (!screens.isEmpty() && screens.peek().isEscapeToCloseAllowed()) {
      popScreen();
      event.consume();
    }
  }
}
Program: 976
Project: 976
Buggy source:
public void receiveFamilyRegistration(BlockUri familyUri,Map<String,Integer> registration){
  BlockFamily family;
  if (isFreeformFamily(familyUri)) {
    family=blockLoader.loadWithShape(familyUri);
  }
 else {
    family=getAvailableBlockFamily(familyUri);
  }
  if (family != null) {
    for (    Block block : family.getBlocks()) {
      Integer id=registration.get(block.getURI().toString());
      if (id != null) {
        block.setId((byte)id.intValue());
      }
 else {
        logger.error("String_Node_Str",block.getURI(),familyUri);
        block.setId(UNKNOWN_ID);
      }
      registerFamily(family);
    }
  }
 else {
    logger.error("String_Node_Str",familyUri);
  }
}

Fixed version (ground truth):
public void receiveFamilyRegistration(BlockUri familyUri,Map<String,Integer> registration){
  BlockFamily family;
  if (isFreeformFamily(familyUri)) {
    family=blockLoader.loadWithShape(familyUri);
  }
 else {
    family=getAvailableBlockFamily(familyUri);
  }
  if (family != null) {
    for (    Block block : family.getBlocks()) {
      Integer id=registration.get(block.getURI().toString());
      if (id != null) {
        block.setId((short)id.intValue());
      }
 else {
        logger.error("String_Node_Str",block.getURI(),familyUri);
        block.setId(UNKNOWN_ID);
      }
      registerFamily(family);
    }
  }
 else {
    logger.error("String_Node_Str",familyUri);
  }
}
Program: 977
Project: 977
Buggy source:
private byte getNextId(){
  if (nextId > MAX_ID) {
    return UNKNOWN_ID;
  }
  return (byte)nextId++;
}

Fixed version (ground truth):
private short getNextId(){
  if (nextId > MAX_ID) {
    return UNKNOWN_ID;
  }
  return (short)nextId++;
}
Program: 979
Project: 979
Buggy source:
@Override public void update(float delta){
  if (speed > 0) {
    speed-=delta;
    return;
  }
  speed=0.1f;
  for (  Map.Entry<BehaviorTree,List<Interpreter>> entry : interpreters.entrySet()) {
    for (    Interpreter interpreter : entry.getValue()) {
      interpreter.tick(0.1f);
    }
  }
}

Fixed version (ground truth):
@Override public void update(float delta){
  for (  Map.Entry<BehaviorTree,List<Interpreter>> entry : interpreters.entrySet()) {
    for (    Interpreter interpreter : entry.getValue()) {
      interpreter.tick(delta);
    }
  }
}
Program: 980
Project: 980
Buggy source:
public <T extends Component>T component(Class<T> type){
  T component=minion.getComponent(type);
  if (component == null) {
    ComponentMetadata<T> metadata=CoreRegistry.get(ComponentLibrary.class).getMetadata(type);
    if (metadata == null) {
      throw new RuntimeException("String_Node_Str" + type);
    }
    component=metadata.newInstance();
    minion.addComponent(component);
  }
  return component;
}

Fixed version (ground truth):
public <T extends Component>T component(Class<T> type){
  T component=minion.getComponent(type);
  if (component == null) {
    ComponentMetadata<T> metadata=CoreRegistry.get(ComponentLibrary.class).getMetadata(type);
    if (metadata == null || !metadata.isConstructable()) {
      throw new RuntimeException("String_Node_Str" + type);
    }
    component=metadata.newInstance();
    minion.addComponent(component);
  }
  return component;
}
Program: 981
Project: 981
Buggy source:
@Override public void handle(Status result){
  if (result == Status.SUCCESS) {
    successCount++;
    if (getNode().successPolicy == Policy.RequireOne) {
      interpreter().stop(this,Status.SUCCESS);
    }
  }
  if (result == Status.FAILURE) {
    failureCount++;
    if (getNode().failurePolicy == Policy.RequireOne) {
      interpreter().stop(this,Status.FAILURE);
    }
  }
  if (getNode().failurePolicy == Policy.RequireAll && failureCount == getNode().children().size()) {
    interpreter().stop(this,Status.FAILURE);
  }
  if (getNode().successPolicy == Policy.RequireAll && successCount == getNode().children().size()) {
    interpreter().stop(this,Status.SUCCESS);
  }
}

Fixed version (ground truth):
@Override public void handle(Status result){
  if (this.getStatus() != Status.RUNNING) {
    return;
  }
  if (result == Status.SUCCESS) {
    successCount++;
    if (getNode().successPolicy == Policy.RequireOne) {
      interpreter().stop(this,Status.SUCCESS);
    }
  }
  if (result == Status.FAILURE) {
    failureCount++;
    if (getNode().failurePolicy == Policy.RequireOne) {
      interpreter().stop(this,Status.FAILURE);
    }
  }
  if (getNode().failurePolicy == Policy.RequireAll && failureCount == getNode().children().size()) {
    interpreter().stop(this,Status.FAILURE);
  }
  if (getNode().successPolicy == Policy.RequireAll && successCount == getNode().children().size()) {
    interpreter().stop(this,Status.SUCCESS);
  }
}
Program: 982
Project: 982
Buggy source:
@Override public void drawBackground(Rect2i region){
  UIStyle style=getCurrentStyle();
  if (style.getBackground() != null) {
    if (style.getBackgroundBorder().isEmpty()) {
      drawTextureRaw(style.getBackground(),region,style.getBackgroundScaleMode());
    }
 else {
      drawTextureRawBordered(style.getBackground(),region,style.getBackgroundBorder(),style.getBackgroundScaleMode() == ScaleMode.TILED);
    }
  }
}

Fixed version (ground truth):
@Override public void drawBackground(Rect2i region){
  if (region.isEmpty()) {
    return;
  }
  UIStyle style=getCurrentStyle();
  if (style.getBackground() != null) {
    if (style.getBackgroundBorder().isEmpty()) {
      drawTextureRaw(style.getBackground(),region,style.getBackgroundScaleMode());
    }
 else {
      drawTextureRawBordered(style.getBackground(),region,style.getBackgroundBorder(),style.getBackgroundScaleMode() == ScaleMode.TILED);
    }
  }
}
Program: 983
Project: 983
Buggy source:
@Override public void postRender(){
  for (  DrawOperation operation : drawOnTopOperations) {
    operation.draw();
  }
  drawOnTopOperations.clear();
  if (!subregionStack.isEmpty()) {
    logger.error("String_Node_Str");
    while (!subregionStack.isEmpty()) {
      subregionStack.pop().close();
    }
  }
  Iterator<Map.Entry<TextCacheKey,Map<Material,Mesh>>> textIterator=cachedText.entrySet().iterator();
  while (textIterator.hasNext()) {
    Map.Entry<TextCacheKey,Map<Material,Mesh>> entry=textIterator.next();
    if (!usedText.contains(entry.getKey())) {
      for (      Mesh mesh : entry.getValue().values()) {
        Assets.dispose(mesh);
      }
      textIterator.remove();
    }
  }
  usedText.clear();
  renderer.postRender();
}

Fixed version (ground truth):
@Override public void postRender(){
  for (  DrawOperation operation : drawOnTopOperations) {
    operation.draw();
  }
  drawOnTopOperations.clear();
  Iterator<Map.Entry<TextCacheKey,Map<Material,Mesh>>> textIterator=cachedText.entrySet().iterator();
  while (textIterator.hasNext()) {
    Map.Entry<TextCacheKey,Map<Material,Mesh>> entry=textIterator.next();
    if (!usedText.contains(entry.getKey())) {
      for (      Mesh mesh : entry.getValue().values()) {
        Assets.dispose(mesh);
      }
      textIterator.remove();
    }
  }
  usedText.clear();
  renderer.postRender();
}
Program: 984
Project: 984
Buggy source:
@Override public SubRegion subRegion(Rect2i region,boolean crop){
  return new LwjglSubRegion(region,crop);
}

Fixed version (ground truth):
@Override public SubRegion subRegion(Rect2i region,boolean crop){
  return new SubRegionImpl(region,crop);
}
Program: 985
Project: 985
Buggy source:
@Override public void close(){
  if (!disposed) {
    disposed=true;
    LwjglSubRegion region=subregionStack.pop();
    while (!region.equals(this)) {
      logger.error("String_Node_Str");
      region.close();
      region=subregionStack.pop();
    }
    if (croppingRegion) {
      crop(previousState.cropRegion);
    }
    state=previousState;
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (!disposed) {
    disposed=true;
    if (croppingRegion) {
      crop(previousState.cropRegion);
    }
    state=previousState;
  }
}
Program: 986
Project: 986
Buggy source:
@Override public void onDraw(Canvas canvas){
  if (text.get() == null) {
    text.set("String_Node_Str");
  }
  lastFont=canvas.getCurrentStyle().getFont();
  lastWidth=canvas.size().x;
  canvas.addInteractionRegion(interactionListener,canvas.getRegion());
  correctCursor();
  try (SubRegion ignored=canvas.subRegion(canvas.getRegion(),true)){
    try (SubRegion ignored2=canvas.subRegion(Rect2i.createFromMinAndSize(-offset,0,lastFont.getWidth(getText()) + 1,lastFont.getLineHeight()),false)){
      canvas.drawText(text.get(),canvas.getRegion());
      if (isFocused()) {
        if (hasSelection()) {
          drawSelection(canvas);
        }
 else {
          drawCursor(canvas);
        }
      }
    }
   }
 }

Fixed version (ground truth):
@Override public void onDraw(Canvas canvas){
  if (text.get() == null) {
    text.set("String_Node_Str");
  }
  lastFont=canvas.getCurrentStyle().getFont();
  lastWidth=canvas.size().x;
  canvas.addInteractionRegion(interactionListener,canvas.getRegion());
  correctCursor();
  try (SubRegion ignored=canvas.subRegion(canvas.getRegion(),true);SubRegion ignored2=canvas.subRegion(Rect2i.createFromMinAndSize(-offset,0,lastFont.getWidth(getText()) + 1,lastFont.getLineHeight()),false)){
    canvas.drawText(text.get(),canvas.getRegion());
    if (isFocused()) {
      if (hasSelection()) {
        drawSelection(canvas);
      }
 else {
        drawCursor(canvas);
      }
    }
  }
 }
Program: 989
Project: 989
Buggy source:
public void setRelativeWidth(float relativeWidth){
  this.relativeWidth=relativeWidth;
}

Fixed version (ground truth):
public RowLayoutHint setRelativeWidth(float width){
  this.relativeWidth=width;
  return this;
}
Program: 990
Project: 990
Buggy source:
public void setUseContentWidth(boolean useContentWidth){
  this.useContentWidth=useContentWidth;
}

Fixed version (ground truth):
public RowLayoutHint setUseContentWidth(boolean value){
  this.useContentWidth=value;
  return this;
}
Program: 991
Project: 991
Buggy source:
public void setPositionTop(VerticalInfo positionTop){
  this.positionTop=positionTop;
}

Fixed version (ground truth):
public RelativeLayoutHint setPositionTop(VerticalInfo value){
  this.positionTop=value;
  return this;
}
Program: 992
Project: 992
Buggy source:
public void setPositionCenterHorizontal(HorizontalInfo positionCenterHorizontal){
  this.positionCenterHorizontal=positionCenterHorizontal;
}

Fixed version (ground truth):
public RelativeLayoutHint setPositionCenterHorizontal(HorizontalInfo value){
  this.positionCenterHorizontal=value;
  return this;
}
Program: 993
Project: 993
Buggy source:
public void setPositionBottom(VerticalInfo positionBottom){
  this.positionBottom=positionBottom;
}

Fixed version (ground truth):
public RelativeLayoutHint setPositionBottom(VerticalInfo value){
  this.positionBottom=value;
  return this;
}
Program: 994
Project: 994
Buggy source:
public void setWidth(int width){
  this.width=width;
}

Fixed version (ground truth):
public RelativeLayoutHint setWidth(int value){
  this.width=value;
  return this;
}
Program: 995
Project: 995
Buggy source:
public void setHeight(int height){
  this.height=height;
}

Fixed version (ground truth):
public RelativeLayoutHint setHeight(int value){
  this.height=value;
  return this;
}
Program: 996
Project: 996
Buggy source:
public void setPositionLeft(HorizontalInfo positionLeft){
  this.positionLeft=positionLeft;
}

Fixed version (ground truth):
public RelativeLayoutHint setPositionLeft(HorizontalInfo value){
  this.positionLeft=value;
  return this;
}
Program: 997
Project: 997
Buggy source:
public void setUsingContentWidth(boolean usingContentWidth){
  this.usingContentWidth=usingContentWidth;
}

Fixed version (ground truth):
public RelativeLayoutHint setUsingContentWidth(boolean value){
  this.usingContentWidth=value;
  return this;
}
Program: 998
Project: 998
Buggy source:
public void setPositionCenterVertical(VerticalInfo positionCenterVertical){
  this.positionCenterVertical=positionCenterVertical;
}

Fixed version (ground truth):
public RelativeLayoutHint setPositionCenterVertical(VerticalInfo value){
  this.positionCenterVertical=value;
  return this;
}
Program: 999
Project: 999
Buggy source:
public void setPositionRight(HorizontalInfo positionRight){
  this.positionRight=positionRight;
}

Fixed version (ground truth):
public RelativeLayoutHint setPositionRight(HorizontalInfo value){
  this.positionRight=value;
  return this;
}
Program: 1000
Project: 1000
Buggy source:
public void setUsingContentHeight(boolean usingContentHeight){
  this.usingContentHeight=usingContentHeight;
}

Fixed version (ground truth):
public RelativeLayoutHint setUsingContentHeight(boolean value){
  this.usingContentHeight=value;
  return this;
}
Program: 1001
Project: 1001
Buggy source:
/** 
 * Registers an object as a command provider - all methods annotated with @Command will be made available on the console.
 * @param provider
 */
@Override public void registerCommandProvider(Object provider){
  Predicate<? super Method> predicate=Predicates.<Method>and(withModifier(Modifier.PUBLIC),ReflectionUtils.withAnnotation(Command.class));
  Set<Method> commandMethods=ReflectionUtils.getAllMethods(provider.getClass(),predicate);
  if (!commandMethods.isEmpty()) {
    for (    Method method : commandMethods) {
      CommandInfo command=new CommandInfo(method,provider);
      commands.add(command);
      commandLookup.put(command.getName(),command.getParameterCount(),command);
    }
    commandsSorted=false;
  }
}

Fixed version (ground truth):
/** 
 * Registers an object as a command provider - all methods annotated with @Command will be made available on the console.
 * @param provider
 */
@Override public void registerCommandProvider(Object provider){
  Predicate<? super Method> predicate=Predicates.<Method>and(withModifier(Modifier.PUBLIC),ReflectionUtils.withAnnotation(Command.class));
  Set<Method> commandMethods=ReflectionUtils.getAllMethods(provider.getClass(),predicate);
  if (!commandMethods.isEmpty()) {
    for (    Method method : commandMethods) {
      CommandInfo command=new CommandInfo(method,provider);
      if (commandLookup.contains(command.getName(),command.getParameterCount())) {
        logger.warn("String_Node_Str",command.getName(),command.getParameterCount());
      }
 else {
        commands.add(command);
        commandLookup.put(command.getName(),command.getParameterCount(),command);
      }
    }
    commandsSorted=false;
  }
}
Program: 1002
Project: 1002
Buggy source:
private BehaviorTreeData buildSample(){
  SequenceNode sequence=new SequenceNode();
  sequence.children().add(new CounterNode(1));
  sequence.children().add(new RepeatNode(new CounterNode(2)));
  ParallelNode parallel=new ParallelNode(ParallelNode.Policy.RequireAll,ParallelNode.Policy.RequireAll);
  sequence.children().add(parallel);
  parallel.children().add(new MonitorNode());
  parallel.children().add(new CounterNode(3));
  BehaviorTreeData tree=new BehaviorTreeData();
  tree.setRoot(sequence);
  tree.createRenderable();
  return tree;
}

Fixed version (ground truth):
private BehaviorTreeData buildSample(){
  SequenceNode sequence=new SequenceNode();
  sequence.children().add(new CounterNode(1));
  sequence.children().add(new RepeatNode(new CounterNode(2)));
  ParallelNode parallel=new ParallelNode(ParallelNode.Policy.RequireAll,ParallelNode.Policy.RequireAll);
  sequence.children().add(parallel);
  parallel.children().add(new MonitorNode());
  parallel.children().add(new CounterNode(3));
  BehaviorTreeData tree=new BehaviorTreeData();
  tree.setRoot(sequence);
  tree.createRenderable();
  tree.layout(null);
  return tree;
}