nus-yam/ex-repair huggingface dataset:
Program: 37940
Project: 37940
Buggy source:
@Override protected boolean initialize(Vec2i screenSize){
  this.sm=new SaveManager("String_Node_Str");
  this.lg=new BSPLevelGenerator(configDir);
  RogueGame rg=null;
  try {
    Game g=sm.loadGame();
    if (g instanceof RogueGame)     rg=(RogueGame)g;
    tm=new CumulativeTurnManager(this,rg,POINTS_PER_TURN);
    this.layers.push(new MainLayer(this,rg,SCREEN_SIZE,"String_Node_Str"));
    return true;
  }
 catch (  Exception e) {
    this.newGame();
    return true;
  }
}

Fixed version (ground truth):
@Override protected boolean initialize(Vec2i screenSize){
  this.sm=new SaveManager("String_Node_Str");
  this.lg=new BSPLevelGenerator(configDir);
  RogueGame rg=null;
  try {
    Game g=sm.loadGame();
    if (g instanceof RogueGame)     rg=(RogueGame)g;
    tm=new CumulativeTurnManager(this,rg,POINTS_PER_TURN);
    this.layers.push(new MainLayer(this,rg,SCREEN_SIZE,"String_Node_Str"));
    return true;
  }
 catch (  Exception e) {
    rg=this.makeNewGame();
    this.layers.push(new MainLayer(this,rg,SCREEN_SIZE,"String_Node_Str"));
    return true;
  }
}
Program: 37942
Project: 37942
Buggy source:
public MainCharacter(String name){
  this.name=name;
  this.color=Color.DEFAULT;
  this.character='@';
  this.HP=100;
  this.startHP=this.HP;
  this.stats=new Stats(10,4);
  baseStats=stats;
  this.team=1;
}

Fixed version (ground truth):
public MainCharacter(String name){
  this.name=name;
  this.color=Color.DEFAULT;
  this.character='@';
  this.HP=100;
  this.startHP=this.HP;
  this.stats=new Stats(10,4);
  baseStats=stats;
  this.team=1;
  this.XP=0;
  nextLevelXP=6;
  playerLevel=1;
}
Program: 37943
Project: 37943
Buggy source:
@Override protected void onKillEntity(Combatable combatable){
}

Fixed version (ground truth):
@Override protected void onKillEntity(Combatable combatable){
  Announcer.announce("String_Node_Str" + combatable.getDescription());
  Monster m=(Monster)combatable;
  this.XP+=m.tier;
  if (XP >= nextLevelXP) {
    XP-=nextLevelXP;
    levelUp();
    Announcer.announce("String_Node_Str" + playerLevel);
  }
}
Program: 37944
Project: 37944
Buggy source:
public Monster(MonsterTemplate mt,Level level){
  this.level=level;
  this.character=mt.character;
  this.color=mt.color;
  this.HP=mt.startHp;
  this.startHP=mt.startHp;
  this.stats=new Stats(mt.attack,mt.defense);
  baseStats=stats;
  this.team=0;
  this.name=mt.name;
  this.moveCost=mt.moveCost;
  buildBrainz();
}

Fixed version (ground truth):
public Monster(MonsterTemplate mt,Level level){
  this.level=level;
  this.character=mt.character;
  this.color=mt.color;
  this.HP=mt.startHp;
  this.startHP=mt.startHp;
  this.stats=new Stats(mt.attack,mt.defense);
  baseStats=stats;
  this.team=0;
  this.name=mt.name;
  this.moveCost=mt.moveCost;
  this.tier=mt.tier;
  buildBrainz();
}
Program: 37945
Project: 37945
Buggy source:
public Stats invert(){
  return new Stats(attack * 1,defense * 1);
}

Fixed version (ground truth):
public Stats invert(){
  return new Stats(attack * -1,defense * -1);
}
Program: 37946
Project: 37946
Buggy source:
private Action getAction(){
  Level l=me.getLevel();
  EntityActionManager player=l.getManager().getEntity("String_Node_Str").get(0);
  Tile myTile=me.getLocation();
  Tile playerTile=player.getEntity().getLocation();
  AStar<Tile> pathfinder=new AStar<Tile>();
  List<Tile> path=pathfinder.computePath(myTile,playerTile);
  if (path.size() <= 1)   return new Wait();
  Tile dest=path.get(1);
  Vec2i curLoc=myTile.getLocation();
  Vec2i destLoc=dest.getLocation();
  Direction dir;
  if (destLoc.x < curLoc.x)   dir=Direction.LEFT;
 else   if (destLoc.x > curLoc.x)   dir=Direction.RIGHT;
 else   if (destLoc.y < curLoc.y)   dir=Direction.UP;
 else   dir=Direction.DOWN;
  return new Move(moveCost,me,dir);
}

Fixed version (ground truth):
private Action getAction(){
  Level l=me.getLevel();
  List<EntityActionManager> players=l.getManager().getEntity("String_Node_Str");
  if (players.size() == 0) {
    return new Move(0,me,Direction.RIGHT);
  }
  EntityActionManager player=players.get(0);
  Tile myTile=me.getLocation();
  Tile playerTile=player.getEntity().getLocation();
  AStar<Tile> pathfinder=new AStar<Tile>();
  List<Tile> path=pathfinder.computePath(myTile,playerTile);
  if (path.size() <= 1)   return new Wait();
  Tile dest=path.get(1);
  Vec2i curLoc=myTile.getLocation();
  Vec2i destLoc=dest.getLocation();
  Direction dir;
  if (destLoc.x < curLoc.x)   dir=Direction.LEFT;
 else   if (destLoc.x > curLoc.x)   dir=Direction.RIGHT;
 else   if (destLoc.y < curLoc.y)   dir=Direction.UP;
 else   dir=Direction.DOWN;
  return new Move(moveCost,me,dir);
}
Program: 37947
Project: 37947
Buggy source:
/** 
 * Initalizes the first level
 * @throws ConfigurationException 
 */
public void createInitalLevel(BSPLevelGenerator lg) throws ConfigurationException {
  this.currentLevel=lg.generateLevel(MAP_SIZE,1);
  levels.put(1,currentLevel);
  MainCharacter mc=new MainCharacter("String_Node_Str");
  currentLevel.getManager().register(mc);
  currentLevel.placeCharacter(mc,true);
}

Fixed version (ground truth):
/** 
 * Initalizes the first level
 * @throws ConfigurationException 
 */
public void createInitalLevel(BSPLevelGenerator lg) throws ConfigurationException {
  this.currentLevel=lg.generateLevel(MAP_SIZE,1);
  levels.put(1,currentLevel);
  MainCharacter mc=new MainCharacter("String_Node_Str");
  currentLevel.placeCharacter(mc,true);
}
Program: 37948
Project: 37948
Buggy source:
private void drawStats(ScreenWriter sw){
  Level currentLevel=game.getCurrentLevel();
  String divider="String_Node_Str";
  for (int i=0; i < size.x; i++) {
    divider+='_';
  }
  sw.drawString(0,ANNOUNCE_OFFSET + MAP_SIZE.y,divider);
  int statStart=ANNOUNCE_OFFSET + MAP_SIZE.y + 1;
  List<EntityActionManager> monsters=currentLevel.getManager().getEntity("String_Node_Str");
  List<EntityActionManager> main=currentLevel.getManager().getEntity("String_Node_Str");
  if (monsters.isEmpty()) {
    sw.drawString(0,statStart,"String_Node_Str");
    return;
  }
 else   if (main.isEmpty()) {
    sw.drawString(0,statStart,"String_Node_Str");
    return;
  }
  Combatable player=main.get(0).getEntity();
  String line1="String_Node_Str";
  line1+="String_Node_Str";
  line1+="String_Node_Str";
  line1+=player.getHP();
  line1+="String_Node_Str";
  line1+=player.getStartHP();
  sw.drawString(0,statStart,line1);
  String depthString="String_Node_Str" + currentLevel.getDepth();
  sw.drawString(size.x - depthString.length() - 2,statStart,depthString);
  String line2="String_Node_Str";
  line2+="String_Node_Str";
  line2+=player.getStats().getAttack();
  line2+="String_Node_Str";
  line2+=String.valueOf(player.getStats().getDefense());
  sw.drawString(0,statStart + 1,line2);
}

Fixed version (ground truth):
private void drawStats(ScreenWriter sw){
  Level currentLevel=game.getCurrentLevel();
  String divider="String_Node_Str";
  for (int i=0; i < size.x; i++) {
    divider+='_';
  }
  sw.drawString(0,ANNOUNCE_OFFSET + MAP_SIZE.y,divider);
  int statStart=ANNOUNCE_OFFSET + MAP_SIZE.y + 1;
  List<EntityActionManager> monsters=currentLevel.getManager().getEntity("String_Node_Str");
  List<EntityActionManager> main=currentLevel.getManager().getEntity("String_Node_Str");
  if (monsters.isEmpty()) {
    sw.drawString(0,statStart,"String_Node_Str");
    return;
  }
 else   if (main.isEmpty()) {
    sw.drawString(0,statStart,"String_Node_Str");
    return;
  }
  MainCharacter player=(MainCharacter)main.get(0).getEntity();
  String line1="String_Node_Str";
  line1+="String_Node_Str";
  line1+="String_Node_Str";
  line1+=player.getHP();
  line1+="String_Node_Str";
  line1+=player.getStartHP();
  line1+="String_Node_Str";
  line1+=player.getXP();
  line1+="String_Node_Str";
  line1+=player.getNextLevelXP();
  line1+="String_Node_Str";
  sw.drawString(0,statStart,line1);
  String depthString="String_Node_Str" + currentLevel.getDepth();
  sw.drawString(size.x - depthString.length() - 2,statStart,depthString);
  String line2="String_Node_Str";
  line2="String_Node_Str" + player.getPlayerLevel();
  line2+="String_Node_Str";
  line2+=player.getStats().getAttack();
  line2+="String_Node_Str";
  line2+=String.valueOf(player.getStats().getDefense());
  line2+="String_Node_Str";
  sw.drawString(0,statStart + 1,line2);
}
Program: 37949
Project: 37949
Buggy source:
@Override protected void applyItemEffect(Stackable item,EntityActionManager target){
  if (item.getType() == ItemType.WEAPON) {
    Weapon w=(Weapon)item;
    Weapon oldWeap=(Weapon)target.getEntity().getEquipment().get(EquipType.WEAPON);
    if (oldWeap != null) {
      oldWeap.getUnwieldAction().apply(target);
      target.getEntity().getInventory().add(oldWeap);
    }
    Announcer.announce("String_Node_Str" + w.getDescription());
    tm.takeTurn(w.getWieldAction());
    target.getEntity().getEquipment().put(EquipType.WEAPON,w);
    target.getEntity().getInventory().remove(item);
  }
}

Fixed version (ground truth):
@Override protected void applyItemEffect(Stackable item,EntityActionManager target){
  if (item.getType() == ItemType.WEAPON) {
    Weapon w=(Weapon)item;
    Weapon oldWeap=(Weapon)target.getEntity().getEquipment().get(EquipType.WEAPON);
    if (oldWeap != null) {
      tm.takeTurn(oldWeap.getUnwieldAction());
      target.getEntity().getInventory().add(oldWeap);
    }
    Announcer.announce("String_Node_Str" + w.getDescription());
    target.getEntity().getEquipment().put(EquipType.WEAPON,w);
    tm.takeTurn(w.getWieldAction());
    target.getEntity().getEquipment().put(EquipType.WEAPON,w);
    target.getEntity().getInventory().remove(item);
  }
}
Program: 37951
Project: 37951
Buggy source:
@Override public void doDraw(Section sw){
  sw.setForegroundColor(Color.YELLOW);
  sw.drawString(loc.getLocation().x,loc.getLocation().y + DefaultMainLayer.ANNOUNCE_OFFSET,"String_Node_Str");
  int startX=size.x - OFFSET;
  int currentY=0;
  if (loc.getLocation().x > size.x - OFFSET) {
    startX=0;
  }
  sw.setForegroundColor(Color.DEFAULT);
  if (loc.getEntity() != null) {
    sw.drawString(startX,currentY,loc.getEntity().getDescription());
    currentY++;
  }
  for (  Stackable s : loc.getStackables()) {
    sw.drawString(startX,currentY,s.getDescription());
    currentY++;
  }
  if (loc.getType().getDescription() != null) {
    sw.drawString(startX,currentY,loc.getType().getDescription());
    currentY++;
  }
  if (currentY == 0) {
    sw.drawString(startX,currentY,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void doDraw(Section sw){
  sw.setForegroundColor(Color.YELLOW);
  sw.drawString(loc.getLocation().x,loc.getLocation().y + DefaultMainLayer.ANNOUNCE_OFFSET,"String_Node_Str");
  int startX=size.x - OFFSET;
  int currentY=0;
  if (loc.getLocation().x > size.x - OFFSET) {
    startX=0;
  }
  sw.setForegroundColor(Color.DEFAULT);
  if (loc.getEntity() != null) {
    sw.drawString(startX,currentY,loc.getEntity().getDescription());
    currentY++;
  }
  for (  Stackable s : loc.getStackables()) {
    sw.drawString(startX,currentY,s.getDescription());
    currentY++;
  }
  if (loc.getType().getDescription() != null && loc.getReveal()) {
    sw.drawString(startX,currentY,loc.getType().getDescription());
    currentY++;
  }
  if (currentY == 0) {
    sw.drawString(startX,currentY,"String_Node_Str");
  }
}
Program: 37952
Project: 37952
Buggy source:
/** 
 * Generates a full level whose size is levelSize
 * @throws ConfigurationException 
 */
public Level generateLevel(Vec2i levelSize) throws ConfigurationException {
  rand=new RandomGen(System.nanoTime());
  tiles=new Tile[levelSize.x][levelSize.y];
  fillWithSolids(tiles);
  SubLevel fullLevel=new SubLevel(new Vec2i(0,0),levelSize,0);
  splitAndBuild(fullLevel);
  Level level=new Level(tiles,fullLevel.rooms,fullLevel.hallways);
  MonsterGenerator mg=new ProgressiveMonsterGenerator();
  mg.populateLevel(level);
  level.setDepth(3);
  return level;
}

Fixed version (ground truth):
/** 
 * Generates a full level whose size is levelSize
 * @throws ConfigurationException 
 */
public Level generateLevel(Vec2i levelSize) throws ConfigurationException {
  rand=new RandomGen(System.nanoTime());
  tiles=new Tile[levelSize.x][levelSize.y];
  fillWithSolids(tiles);
  SubLevel fullLevel=new SubLevel(new Vec2i(0,0),levelSize,0);
  splitAndBuild(fullLevel);
  Level level=new Level(tiles,fullLevel.rooms,fullLevel.hallways);
  level.setDepth(5);
  MonsterGenerator mg=new ProgressiveMonsterGenerator();
  mg.populateLevel(level);
  return level;
}
Program: 37953
Project: 37953
Buggy source:
/** 
 * Gets a random monster that is pplicable to the level: Roll Order: lower tier; higher tier; else base;
 * @return A random monster
 */
private Monster getRandomMonster(Level level){
  int tier=(int)(1 + Math.floor(level.depth / tierStepSize));
  int tierDiff=tierStepSize * tier - level.depth;
  if (Math.random() <= lowerChance / tierDiff)   tier-=1;
 else   if (Math.random() <= higherChance * tierDiff)   tier+=1;
  if (tier == 0) {
    tier=1;
  }
  if (tier > tiers.size()) {
    tier=tiers.size();
  }
  List<MonsterTemplate> tierList=tiers.get(tier);
  return (new Monster(tierList.get(rand.getRandom(tierList.size()))));
}

Fixed version (ground truth):
/** 
 * Gets a random monster that is pplicable to the level: Roll Order: lower tier; higher tier; else base;
 * @return A random monster
 */
private Monster getRandomMonster(Level level){
  int tier=(1 + (level.depth / tierStepSize));
  int tierDiff=tierStepSize * (tier - 1) - level.depth + 1;
  if (Math.random() <= lowerChance / tierDiff)   tier-=1;
 else   if (Math.random() <= higherChance * tierDiff)   tier+=1;
  if (tier == 0) {
    tier=1;
  }
  if (tier > tiers.size()) {
    tier=tiers.size();
  }
  List<MonsterTemplate> tierList=tiers.get(tier);
  return (new Monster(tierList.get(rand.getRandom(tierList.size()))));
}
Program: 37954
Project: 37954
Buggy source:
/** 
 * Generates a full level whose size is levelSize
 * @throws ConfigurationException 
 */
public Level generateLevel(Vec2i levelSize) throws ConfigurationException {
  rand=new RandomGen(System.nanoTime());
  tiles=new Tile[levelSize.x][levelSize.y];
  fillWithSolids(tiles);
  SubLevel fullLevel=new SubLevel(new Vec2i(0,0),levelSize,0);
  splitAndBuild(fullLevel);
  Level level=new Level(tiles,fullLevel.rooms,fullLevel.hallways);
  MonsterGenerator mg=new ProgressiveMonsterGenerator();
  mg.populateLevel(level);
  level.setDepth(3);
  return level;
}

Fixed version (ground truth):
/** 
 * Generates a full level whose size is levelSize
 * @throws ConfigurationException 
 */
public Level generateLevel(Vec2i levelSize) throws ConfigurationException {
  rand=new RandomGen(System.nanoTime());
  tiles=new Tile[levelSize.x][levelSize.y];
  fillWithSolids(tiles);
  SubLevel fullLevel=new SubLevel(new Vec2i(0,0),levelSize,0);
  splitAndBuild(fullLevel);
  Level level=new Level(tiles,fullLevel.rooms,fullLevel.hallways);
  level.setDepth(3);
  MonsterGenerator mg=new ProgressiveMonsterGenerator();
  mg.populateLevel(level);
  return level;
}
Program: 37955
Project: 37955
Buggy source:
/** 
 * Gets a random monster that is pplicable to the level: Roll Order: lower tier; higher tier; else base;
 * @return A random monster
 */
private Monster getRandomMonster(Level level){
  int tier=(int)(1 + Math.floor(level.depth / tierStepSize));
  int tierDiff=tierStepSize * tier - level.depth;
  if (Math.random() <= lowerChance / tierDiff)   tier-=1;
 else   if (Math.random() <= higherChance * tierDiff)   tier+=1;
  if (tier == 0) {
    tier=1;
  }
  if (tier > tiers.size()) {
    tier=tiers.size();
  }
  List<MonsterTemplate> tierList=tiers.get(tier);
  return (new Monster(tierList.get(rand.getRandom(tierList.size()))));
}

Fixed version (ground truth):
/** 
 * Gets a random monster that is pplicable to the level: Roll Order: lower tier; higher tier; else base;
 * @return A random monster
 */
private Monster getRandomMonster(Level level){
  int tier=(1 + (level.depth / tierStepSize));
  int tierDiff=level.depth + 1 - tierStepSize * (tier - 1);
  if (Math.random() <= lowerChance / tierDiff)   tier-=1;
 else   if (Math.random() <= higherChance * tierDiff)   tier+=1;
  if (tier == 0) {
    tier=1;
  }
  if (tier > tiers.size()) {
    tier=tiers.size();
  }
  List<MonsterTemplate> tierList=tiers.get(tier);
  return (new Monster(tierList.get(rand.getRandom(tierList.size()))));
}
Program: 37956
Project: 37956
Buggy source:
public MainCharacter(){
  this.character='@';
  this.color=Color.DEFAULT;
  this.HP=100;
  this.startHP=this.HP;
  this.stats=new Stats(.75f,6,2);
  this.team=1;
}

Fixed version (ground truth):
public MainCharacter(){
  this.character='@';
  this.color=Color.DEFAULT;
  this.HP=100;
  this.startHP=this.HP;
  this.stats=new Stats(.75f,10,4);
  this.team=1;
}
Program: 37957
Project: 37957
Buggy source:
public void apply(EntityActionManager queue){
  System.out.println("String_Node_Str");
  List<EntityActionManager> mains=this.manager.getEntity("String_Node_Str");
  if (mains.size() > 0) {
    Tile myLoc=queue.getLocation();
    Tile mainLoc=mains.get(0).getLocation();
    Direction dir=myLoc.dirTo(mainLoc);
    queue.sendMove(dir);
  }
}

Fixed version (ground truth):
public void apply(EntityActionManager queue){
  List<EntityActionManager> mains=this.manager.getEntity("String_Node_Str");
  if (mains.size() > 0) {
    Tile myLoc=queue.getLocation();
    Tile mainLoc=mains.get(0).getLocation();
    Direction dir=myLoc.dirTo(mainLoc);
    queue.sendMove(dir);
  }
}
Program: 37958
Project: 37958
Buggy source:
@Override public void doDraw(Section s){
  s=s.moveUpperLeft(new Vec2i(size.x - 30,0));
  Set<Stackable> inventory;
  inventory=currentLevel.getManager().getEntity("String_Node_Str").get(0).getEntity().getInventory();
  Iterator<Stackable> iter=inventory.iterator();
  int i;
  for (i=0; i < Math.min(size.y - 1,inventory.size()); i++) {
    String line="String_Node_Str";
    line+="String_Node_Str";
    line+=getLetter(i);
    line+="String_Node_Str";
    line+=iter.next().getDescription();
    s.drawString(0,i,line);
  }
  s.drawString(0,i,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void doDraw(Section s){
  s=s.moveUpperLeft(new Vec2i(size.x - 30,0));
  Set<Stackable> inventory;
  List<EntityActionManager> mains=currentLevel.getManager().getEntity("String_Node_Str");
  if (mains.size() > 0)   inventory=mains.get(0).getEntity().getInventory();
 else   inventory=new HashSet<Stackable>();
  Iterator<Stackable> iter=inventory.iterator();
  int i;
  for (i=0; i < Math.min(size.y - 1,inventory.size()); i++) {
    String line="String_Node_Str";
    line+="String_Node_Str";
    line+=getLetter(i);
    line+="String_Node_Str";
    line+=iter.next().getDescription();
    s.drawString(0,i,line);
  }
  s.drawString(0,i,"String_Node_Str");
}
Program: 37959
Project: 37959
Buggy source:
@Override public void propagateAction(GameAction action){
}

Fixed version (ground truth):
@Override public void propagateAction(GameAction action){
  if (action.getContextClassifier() != 1)   throw new Error("String_Node_Str");
  try {
switch (action.getActionClassifier()) {
case 0:
      break;
case 1:
    currentLevel=rg.generateLevel(levelSize);
  RandomGen rand=new RandomGen(System.nanoTime());
Room r1=currentLevel.getRooms().get(0);
break;
case 2:
sm.saveLevel(currentLevel);
break;
case 3:
currentLevel=sm.loadLevel();
break;
case 4:
app.shutdown();
break;
default :
throw new Error("String_Node_Str" + action.getActionClassifier() + "String_Node_Str");
}
}
 catch (SaveLoadException e) {
statusMsg=e.getMessage();
currentLevel=null;
}
catch (ConfigurationException e) {
statusMsg=e.getMessage();
currentLevel=null;
}
}
Program: 37960
Project: 37960
Buggy source:
/** 
 * Makes a room inside the sublevel
 * @param curr - the area to make the room in
 */
private void makeRoom(SubLevel curr){
  int maxWidth=curr.max.x - curr.min.x - 2 * minWallThickness;
  int maxHeight=curr.max.y - curr.min.y - 2 * minWallThickness;
  int minX=getRandom(minWallThickness,maxWidth - minRoomDim);
  int maxX=getRandom(minX + minRoomDim,maxWidth);
  int minY=getRandom(minWallThickness,maxHeight - minRoomDim);
  int maxY=getRandom(minY + minRoomDim,maxHeight);
  Vec2i min=curr.min.plus(minX,minY);
  Vec2i max=curr.min.plus(maxX,maxY);
  paintCellRectangle(min,max,true,TileType.FLOOR);
  Room r=new Room(min,max);
  curr.rooms.add(r);
  curr.intersectMin=min;
  curr.intersectMax=max;
}

Fixed version (ground truth):
/** 
 * Makes a room inside the sublevel
 * @param curr - the area to make the room in
 */
private void makeRoom(SubLevel curr){
  int maxWidth=curr.max.x - curr.min.x - 1 * minWallThickness;
  int maxHeight=curr.max.y - curr.min.y - 1 * minWallThickness;
  int minX=getRandom(minWallThickness,maxWidth - minRoomDim);
  int maxX=getRandom(minX + minRoomDim,maxWidth);
  int minY=getRandom(minWallThickness,maxHeight - minRoomDim);
  int maxY=getRandom(minY + minRoomDim,maxHeight);
  Vec2i min=curr.min.plus(minX,minY);
  Vec2i max=curr.min.plus(maxX,maxY);
  paintCellRectangle(min,max,true,TileType.FLOOR);
  Room r=new Room(min,max);
  curr.rooms.add(r);
  curr.intersectMin=min;
  curr.intersectMax=max;
}
Program: 37961
Project: 37961
Buggy source:
/** 
 * Makes a room inside the sublevel
 * @param curr - the area to make the room in
 */
private void makeRoom(SubLevel curr){
  int maxWidth=curr.max.x - curr.min.x - 2 * minWallThickness;
  int maxHeight=curr.max.y - curr.min.y - 2 * minWallThickness;
  int minX=getRandom(minWallThickness,maxWidth - minRoomDim);
  int maxX=getRandom(minX + minRoomDim,maxWidth);
  int minY=getRandom(minWallThickness,maxHeight - minRoomDim);
  int maxY=getRandom(minY + minRoomDim,maxHeight);
  Vec2i min=curr.min.plus(minX,minY);
  Vec2i max=curr.min.plus(maxX,maxY);
  paintCellRectangle(min,max,true,TileType.FLOOR);
  Room r=new Room(min,max);
  curr.rooms.add(r);
  curr.intersectMin=min.plus(1,1);
  curr.intersectMax=max.plus(-1,-1);
}

Fixed version (ground truth):
/** 
 * Makes a room inside the sublevel
 * @param curr - the area to make the room in
 */
private void makeRoom(SubLevel curr){
  int maxWidth=curr.max.x - curr.min.x - 2 * minWallThickness;
  int maxHeight=curr.max.y - curr.min.y - 2 * minWallThickness;
  int minX=getRandom(minWallThickness,maxWidth - minRoomDim);
  int maxX=getRandom(minX + minRoomDim,maxWidth);
  int minY=getRandom(minWallThickness,maxHeight - minRoomDim);
  int maxY=getRandom(minY + minRoomDim,maxHeight);
  Vec2i min=curr.min.plus(minX,minY);
  Vec2i max=curr.min.plus(maxX,maxY);
  paintCellRectangle(min,max,true,TileType.FLOOR);
  Room r=new Room(min,max);
  curr.rooms.add(r);
  curr.intersectMin=min;
  curr.intersectMax=max;
}
Program: 37964
Project: 37964
Buggy source:
/** 
 * Generated
 * @author liam
 */
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((connectedRooms == null) ? 0 : connectedRooms.hashCode());
  result=prime * result + ((max == null) ? 0 : max.hashCode());
  result=prime * result + ((min == null) ? 0 : min.hashCode());
  return result;
}

Fixed version (ground truth):
/** 
 * BEGIN hashCode and equals 
 */
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((connectedRooms == null) ? 0 : connectedRooms.hashCode());
  result=prime * result + (int)(id ^ (id >>> 32));
  result=prime * result + ((max == null) ? 0 : max.hashCode());
  result=prime * result + ((min == null) ? 0 : min.hashCode());
  return result;
}
Program: 37965
Project: 37965
Buggy source:
/** 
 * Generated
 * @author liam
 */
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Room other=(Room)obj;
  if (connectedRooms == null) {
    if (other.connectedRooms != null)     return false;
  }
 else   if (!connectedRooms.equals(other.connectedRooms))   return false;
  if (max == null) {
    if (other.max != null)     return false;
  }
 else   if (!max.equals(other.max))   return false;
  if (min == null) {
    if (other.min != null)     return false;
  }
 else   if (!min.equals(other.min))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Room other=(Room)obj;
  if (id == other.id) {
    return true;
  }
  if (max == null) {
    if (other.max != null)     return false;
  }
 else   if (!max.equals(other.max))   return false;
  if (min == null) {
    if (other.min != null)     return false;
  }
 else   if (!min.equals(other.min))   return false;
  if (connectedRooms == null) {
    if (other.connectedRooms != null)     return false;
  }
 else   if (!connectedRooms.equals(other.connectedRooms))   return false;
  return true;
}
Program: 37966
Project: 37966
Buggy source:
/** 
 * Round trip test succeeds
 * @author liam 
 * @throws IOException 
 * @throws ClassNotFoundException 
 */
@Test public void testRoundTripSerialization() throws IOException, ClassNotFoundException {
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  ObjectOutputStream oos=new ObjectOutputStream(out);
  oos.writeObject(r1);
  oos.close();
  byte[] raw=out.toByteArray();
  InputStream in=new ByteArrayInputStream(raw);
  ObjectInputStream ois=new ObjectInputStream(in);
  Object o=ois.readObject();
  ois.close();
  assertTrue(o instanceof Room);
  Room r1_ds=(Room)o;
  assertEquals(r1_ds.getConnectedRooms(),r1.getConnectedRooms());
}

Fixed version (ground truth):
/** 
 * Round trip test succeeds
 * @author liam 
 * @throws IOException 
 * @throws ClassNotFoundException 
 */
@Test public void testRoundTripSerialization() throws IOException, ClassNotFoundException {
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  ObjectOutputStream oos=new ObjectOutputStream(out);
  oos.writeObject(r1);
  oos.close();
  byte[] raw=out.toByteArray();
  InputStream in=new ByteArrayInputStream(raw);
  ObjectInputStream ois=new ObjectInputStream(in);
  Object o=ois.readObject();
  ois.close();
  assertTrue(o instanceof Room);
  Room r1_ds=(Room)o;
  assertEquals(r1_ds.getConnectedRooms(),r1.getConnectedRooms());
  assertEquals(r1_ds,r1);
}
Program: 37967
Project: 37967
Buggy source:
public Hallway(Vec2i startTile,Vec2i endTile){
  this.startTile=endTile;
  this.endTile=endTile;
  rooms=new ArrayList<Room>();
}

Fixed version (ground truth):
public Hallway(Vec2i startTile,Vec2i endTile){
  this.startTile=startTile;
  this.endTile=endTile;
  rooms=new ArrayList<Room>();
}
Program: 37968
Project: 37968
Buggy source:
public Flip3DAnimation(final float fromDegrees,final float toDegrees,final float centerX,final float centerY){
  mFromDegrees=fromDegrees;
  mToDegrees=toDegrees;
  mCenterX=centerX;
  mCenterY=centerY;
}

Fixed version (ground truth):
public Flip3DAnimation(final float fromDegrees,final float toDegrees,final float centerX,final float centerY){
  super();
  mFromDegrees=fromDegrees;
  mToDegrees=toDegrees;
  mCenterX=centerX;
  mCenterY=centerY;
}
Program: 37969
Project: 37969
Buggy source:
@Override public void onClick(final View view){
  if (isFirstView) {
    applyRotation(0,-90);
    isFirstView=!isFirstView;
  }
 else {
    applyRotation(0,90);
    isFirstView=!isFirstView;
  }
}

Fixed version (ground truth):
@Override public void onClick(final View view){
  if (isFirstView) {
    applyRotation(0,-90);
    isFirstView=false;
  }
 else {
    applyRotation(0,90);
    isFirstView=true;
  }
}
Program: 37970
Project: 37970
Buggy source:
void parseAttributes(final Context context,final AttributeSet attrs){
  final TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.Flip3DView);
  try {
    final Drawable front=a.getDrawable(R.styleable.Flip3DView_src_front);
    if (front != null) {
      setImageFrontDrawable(front);
    }
    final Drawable back=a.getDrawable(R.styleable.Flip3DView_src_back);
    if (back != null) {
      setImageBackDrawable(back);
    }
  }
  finally {
    a.recycle();
  }
}

Fixed version (ground truth):
private void parseAttributes(final Context context,final AttributeSet attrs){
  final TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.Flip3DView);
  try {
    final Drawable front=a.getDrawable(R.styleable.Flip3DView_src_front);
    if (front != null) {
      setImageFrontDrawable(front);
    }
    final Drawable back=a.getDrawable(R.styleable.Flip3DView_src_back);
    if (back != null) {
      setImageBackDrawable(back);
    }
  }
  finally {
    a.recycle();
  }
}
Program: 37971
Project: 37971
Buggy source:
private void setImageParameters(final ImageView imageView,final Drawable drawable){
  LayoutParams layoutParams=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,Gravity.CENTER);
  if (drawable instanceof ColorDrawable) {
    layoutParams=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,Gravity.CENTER);
  }
  imageView.setLayoutParams(layoutParams);
  imageView.setImageDrawable(drawable);
}

Fixed version (ground truth):
private final void setImageParameters(final ImageView imageView,final Drawable drawable){
  LayoutParams layoutParams=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,Gravity.CENTER);
  if (drawable instanceof ColorDrawable) {
    layoutParams=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,Gravity.CENTER);
  }
  imageView.setLayoutParams(layoutParams);
  imageView.setImageDrawable(drawable);
}
Program: 37972
Project: 37972
Buggy source:
public Flip3DView(final Context context){
  super(context);
  initializeViews(context);
}

Fixed version (ground truth):
public Flip3DView(final Context context){
  super(context);
  initializeViews();
}
Program: 37973
Project: 37973
Buggy source:
private void initializeViews(final Context context){
  setImageFrontDrawable(new ColorDrawable(Color.BLUE));
  setImageBackDrawable(new ColorDrawable(Color.RED));
}

Fixed version (ground truth):
private void initializeViews(){
  setImageFrontDrawable(new ColorDrawable(Color.BLUE));
  setImageBackDrawable(new ColorDrawable(Color.RED));
}
Program: 37974
Project: 37974
Buggy source:
/** 
 * Sets front view on the control.
 * @param viewFront front view
 */
public void setViewFront(final View viewFront){
  if (this.viewFront != null) {
    this.removeView(this.viewFront);
  }
  this.viewFront=viewFront;
  this.addView(viewFront);
}

Fixed version (ground truth):
/** 
 * Sets front view on the control.
 * @param viewFront front view
 */
public final void setViewFront(final View viewFront){
  if (this.viewFront != null) {
    this.removeView(this.viewFront);
  }
  this.viewFront=viewFront;
  this.addView(viewFront);
}
Program: 37975
Project: 37975
Buggy source:
/** 
 * Sets back view on the control.
 * @param viewBack back view
 */
public void setViewBack(final View viewBack){
  if (this.viewBack != null) {
    this.removeView(this.viewBack);
  }
  this.viewBack=viewBack;
  this.addView(viewBack);
}

Fixed version (ground truth):
/** 
 * Sets back view on the control.
 * @param viewBack back view
 */
public final void setViewBack(final View viewBack){
  if (this.viewBack != null) {
    this.removeView(this.viewBack);
  }
  this.viewBack=viewBack;
  this.addView(viewBack);
}
Program: 37976
Project: 37976
Buggy source:
private void incrementCommandTimeoutCount(){
  mCommandTimeoutCount++;
  if (mCommandTimeoutCount >= Config.kDeviceMaxTimeout) {
    Utils.log(TAG,"String_Node_Str" + Config.kDeviceMaxTimeout + "String_Node_Str");
    stopDevice();
  }
 else {
    Utils.log(TAG,"String_Node_Str" + mCommandTimeoutCount);
  }
}

Fixed version (ground truth):
private void incrementCommandTimeoutCount(){
  mCommandTimeoutCount++;
  if (mCommandTimeoutCount >= Config.kDeviceMaxTimeout) {
    Utils.log(TAG,"String_Node_Str" + Config.kDeviceMaxTimeout + "String_Node_Str");
    mServer.removeDevice(this);
  }
 else {
    Utils.log(TAG,"String_Node_Str" + mCommandTimeoutCount);
  }
}
Program: 37977
Project: 37977
Buggy source:
@Override public void run(){
  try {
    String line;
    while (!mStopThread) {
      if (sockSafeHaveData() && (line=sockSafeReadln()) != null && line.length() > 0) {
        if (line.equals(Config.kDeviceKeepAlive)) {
          replyToKeepAlive();
        }
 else {
          manageCommandReply(line);
        }
        resetCommandTimeoutCount();
      }
      if (isKeepAliveTimeout()) {
        Utils.log(TAG,"String_Node_Str" + "String_Node_Str");
        mStopThread=true;
        break;
      }
      sendUnsentCommands();
      try {
        Thread.sleep(500);
      }
 catch (      InterruptedException t) {
      }
    }
    Utils.log(TAG,"String_Node_Str");
  }
 catch (  Exception eex) {
    Utils.log(TAG,"String_Node_Str" + eex.getMessage());
  }
 finally {
    mServer.removeDevice(this);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    String line;
    while (!mStopThread) {
      if (sockSafeHaveData() && (line=sockSafeReadln()) != null && line.length() > 0) {
        if (line.equals(Config.kDeviceKeepAlive)) {
          replyToKeepAlive();
        }
 else {
          manageCommandReply(line);
        }
        resetCommandTimeoutCount();
      }
      if (isKeepAliveTimeout()) {
        Utils.log(TAG,"String_Node_Str" + "String_Node_Str");
        mStopThread=true;
        break;
      }
      sendUnsentCommands();
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException t) {
      }
    }
    Utils.log(TAG,"String_Node_Str");
  }
 catch (  Exception eex) {
    Utils.log(TAG,"String_Node_Str" + eex.getMessage());
  }
}
Program: 37978
Project: 37978
Buggy source:
synchronized public void stopDevice(){
  mStopThread=true;
}

Fixed version (ground truth):
/** 
 * Do not use directly. Instead use MainServer.removeDevice(this).
 */
synchronized public void stopDevice(){
  mStopThread=true;
}
Program: 37979
Project: 37979
Buggy source:
@Override public void run(){
  try {
    Utils.log(TAG,"String_Node_Str");
    try {
      String strJson=mNewDevice.sockReadln();
      Utils.log(TAG,"String_Node_Str" + strJson);
      mNewDevice.readWelcomeJSON(strJson);
    }
 catch (    JSONException ex) {
      abortDeviceConnection(ex.getMessage());
      return;
    }
catch (    IOException ex) {
      abortDeviceConnection(ex.getMessage());
      return;
    }
    if (!authenticateDevice()) {
      abortDeviceConnection("String_Node_Str");
      return;
    }
    Utils.log(TAG,"String_Node_Str" + "String_Node_Str");
    mServer.addDevice(mNewDevice);
  }
 catch (  Exception ex) {
    abortDeviceConnection("String_Node_Str" + ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Utils.log(TAG,"String_Node_Str");
    try {
      String strJson=mNewDevice.sockReadln();
      Utils.log(TAG,"String_Node_Str" + strJson);
      mNewDevice.parseWelcomeJSON(strJson);
    }
 catch (    JSONException ex) {
      abortDeviceConnection(ex.getMessage());
      return;
    }
catch (    IOException ex) {
      abortDeviceConnection(ex.getMessage());
      return;
    }
    if (!authenticateDevice()) {
      abortDeviceConnection("String_Node_Str");
      return;
    }
    Utils.log(TAG,"String_Node_Str" + "String_Node_Str");
    mServer.addDevice(mNewDevice);
  }
 catch (  Exception ex) {
    abortDeviceConnection("String_Node_Str" + ex.getMessage());
  }
}
Program: 37980
Project: 37980
Buggy source:
public int getDevicesCount(){
synchronized (mDevices) {
    return mDevices.size();
  }
}

Fixed version (ground truth):
synchronized public int getDevicesCount(){
  return mDevices.size();
}
Program: 37981
Project: 37981
Buggy source:
@Override public void run(){
  try {
    Utils.log(TAG,"String_Node_Str");
    try {
      mNewDevice.readWelcomeJSON();
    }
 catch (    JSONException ex) {
      abortDeviceConnection(ex.getMessage());
    }
catch (    IOException ex) {
      abortDeviceConnection(ex.getMessage());
    }
    if (!authenticateDevice()) {
      abortDeviceConnection("String_Node_Str");
    }
    Utils.log(TAG,"String_Node_Str" + "String_Node_Str");
    mServer.addDevice(mNewDevice);
  }
 catch (  Exception ex) {
    abortDeviceConnection("String_Node_Str" + ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Utils.log(TAG,"String_Node_Str");
    try {
      mNewDevice.readWelcomeJSON();
    }
 catch (    JSONException ex) {
      abortDeviceConnection(ex.getMessage());
      return;
    }
catch (    IOException ex) {
      abortDeviceConnection(ex.getMessage());
      return;
    }
    if (!authenticateDevice()) {
      abortDeviceConnection("String_Node_Str");
      return;
    }
    Utils.log(TAG,"String_Node_Str" + "String_Node_Str");
    mServer.addDevice(mNewDevice);
  }
 catch (  Exception ex) {
    abortDeviceConnection("String_Node_Str" + ex.getMessage());
  }
}
Program: 37982
Project: 37982
Buggy source:
private void testing(Context context,AttributeSet attrs){
  this.setBackground(getResources().getDrawable(R.drawable.background));
  if (attrs != null) {
    TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
    normalStatecolor=tA.getString(R.styleable.wingokuflatui_normalStateColor);
    pressedStateColor=tA.getString(R.styleable.wingokuflatui_pressedStateColor);
    tA.recycle();
  }
 else {
    normalStatecolor=pressedStateColor="String_Node_Str";
  }
  this.getBackground().setColorFilter(Color.parseColor(normalStatecolor),PorterDuff.Mode.DARKEN);
  this.setOnTouchListener(new OnTouchListener(){
    @Override public boolean onTouch(    View arg0,    MotionEvent event){
      final String color;
      if (event.getAction() == MotionEvent.ACTION_UP) {
        color=normalStatecolor;
      }
 else       color=pressedStateColor;
      new Handler().postDelayed(new Runnable(){
        @Override public void run(){
          WinGokuFlatButton.this.getBackground().setColorFilter(Color.parseColor(color),PorterDuff.Mode.DARKEN);
        }
      }
,30);
      return false;
    }
  }
);
}

Fixed version (ground truth):
private void testing(Context context,AttributeSet attrs){
  if (!isInEditMode()) {
    this.setBackground(getResources().getDrawable(R.drawable.background));
    if (attrs != null) {
      TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
      normalStatecolor=tA.getString(R.styleable.wingokuflatui_normalStateColor);
      pressedStateColor=tA.getString(R.styleable.wingokuflatui_pressedStateColor);
      tA.recycle();
    }
 else {
      normalStatecolor=pressedStateColor="String_Node_Str";
    }
    this.getBackground().setColorFilter(Color.parseColor(normalStatecolor),PorterDuff.Mode.DARKEN);
    this.setOnTouchListener(new OnTouchListener(){
      @Override public boolean onTouch(      View arg0,      MotionEvent event){
        final String color;
        if (event.getAction() == MotionEvent.ACTION_UP) {
          color=normalStatecolor;
        }
 else         color=pressedStateColor;
        new Handler().postDelayed(new Runnable(){
          @Override public void run(){
            WinGokuFlatButton.this.getBackground().setColorFilter(Color.parseColor(color),PorterDuff.Mode.DARKEN);
          }
        }
,30);
        return false;
      }
    }
);
  }
}
Program: 37983
Project: 37983
Buggy source:
private void initializeShit(Context context,AttributeSet attrs){
  setText("String_Node_Str");
  this.setBackground(getResources().getDrawable(R.drawable.checkbox_background));
  TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
  final String userColor=tA.getString(R.styleable.wingokuflatui_cbColor);
  tA.recycle();
  if (userColor == null || userColor.isEmpty()) {
    throw new NullPointerException("String_Node_Str");
  }
  final GradientDrawable gDrawable=(GradientDrawable)this.getBackground();
  gDrawable.setStroke(width,Color.parseColor(userColor));
  gDrawable.setCornerRadius(cornerRadii);
  this.setBackground(gDrawable);
  setInsides(Color.TRANSPARENT);
  this.setOnTouchListener(new OnTouchListener(){
    @Override public boolean onTouch(    View arg0,    MotionEvent event){
      isCheckBoxEnabled();
      if (event.getAction() == MotionEvent.ACTION_DOWN) {
        if (!isChecked) {
          isChecked=true;
          setInsides(Color.parseColor(userColor));
          WinGokuFlatCheckBox.this.invalidate();
        }
 else {
          isChecked=false;
          setInsides(Color.TRANSPARENT);
          WinGokuFlatCheckBox.this.invalidate();
        }
      }
      return false;
    }
  }
);
}

Fixed version (ground truth):
private void initializeShit(Context context,AttributeSet attrs){
  if (!isInEditMode()) {
    setText("String_Node_Str");
    this.setBackground(getResources().getDrawable(R.drawable.checkbox_background));
    TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
    final String userColor=tA.getString(R.styleable.wingokuflatui_cbColor);
    tA.recycle();
    if (userColor == null || userColor.isEmpty()) {
      throw new NullPointerException("String_Node_Str");
    }
    final GradientDrawable gDrawable=(GradientDrawable)this.getBackground();
    gDrawable.setStroke(width,Color.parseColor(userColor));
    gDrawable.setCornerRadius(cornerRadii);
    this.setBackground(gDrawable);
    setInsides(Color.TRANSPARENT);
    this.setOnTouchListener(new OnTouchListener(){
      @Override public boolean onTouch(      View arg0,      MotionEvent event){
        isCheckBoxEnabled();
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
          if (!isChecked) {
            isChecked=true;
            setInsides(Color.parseColor(userColor));
            WinGokuFlatCheckBox.this.invalidate();
          }
 else {
            isChecked=false;
            setInsides(Color.TRANSPARENT);
            WinGokuFlatCheckBox.this.invalidate();
          }
        }
        return false;
      }
    }
);
  }
}
Program: 37984
Project: 37984
Buggy source:
private void initialize(Context context,AttributeSet attrs){
  this.setBackground(getResources().getDrawable(R.drawable.background));
  TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
  backgroundColor=tA.getString(R.styleable.wingokuflatui_backgroundColor);
  tA.recycle();
  this.getBackground().setColorFilter(Color.parseColor(backgroundColor),PorterDuff.Mode.DARKEN);
}

Fixed version (ground truth):
private void initialize(Context context,AttributeSet attrs){
  if (!isInEditMode()) {
    this.setBackground(getResources().getDrawable(R.drawable.background));
    TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
    backgroundColor=tA.getString(R.styleable.wingokuflatui_backgroundColor);
    tA.recycle();
    this.getBackground().setColorFilter(Color.parseColor(backgroundColor),PorterDuff.Mode.DARKEN);
  }
}
Program: 37985
Project: 37985
Buggy source:
private void initializeShit(Context context,AttributeSet attrs){
  if (!isInEditMode()) {
    setText("String_Node_Str");
    this.setBackground(getResources().getDrawable(R.drawable.checkbox_background));
    TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
    final String userColor=tA.getString(R.styleable.wingokuflatui_cbColor);
    tA.recycle();
    if (userColor == null || userColor.isEmpty()) {
      throw new NullPointerException("String_Node_Str");
    }
    final GradientDrawable gDrawable=(GradientDrawable)this.getBackground();
    gDrawable.setStroke(width,Color.parseColor(userColor));
    gDrawable.setCornerRadius(cornerRadii);
    this.setBackground(gDrawable);
    setInsides(Color.TRANSPARENT);
    this.setOnTouchListener(new OnTouchListener(){
      @Override public boolean onTouch(      View arg0,      MotionEvent event){
        isCheckBoxEnabled();
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
          if (!isChecked) {
            isChecked=true;
            setInsides(Color.parseColor(userColor));
            WinGokuFlatCheckBox.this.invalidate();
          }
 else {
            isChecked=false;
            setInsides(Color.TRANSPARENT);
            WinGokuFlatCheckBox.this.invalidate();
          }
        }
        return false;
      }
    }
);
  }
}

Fixed version (ground truth):
private void initializeShit(Context context,AttributeSet attrs){
  if (!isInEditMode()) {
    TypedArray tA=context.obtainStyledAttributes(attrs,R.styleable.wingokuflatui);
    final String userColor=tA.getString(R.styleable.wingokuflatui_cbColor);
    tA.recycle();
    if (userColor == null || userColor.isEmpty()) {
      throw new NullPointerException("String_Node_Str");
    }
    setDrawables(userColor);
  }
}
Program: 37990
Project: 37990
Buggy source:
public static int licenseRound(double licenseC){
  String numString=new Double(licenseC).toString();
  if (numString.contains("String_Node_Str")) {
    String decimalValue=numString.split("String_Node_Str")[1];
    String integerValue=numString.split("String_Node_Str")[0];
    try {
      Double decimalDouble=new Double(decimalValue);
      Integer value=new Integer(integerValue);
      if (decimalDouble > 0)       return (value + 1);
    }
 catch (    Exception e) {
    }
  }
  return new Double(licenseC).intValue();
}

Fixed version (ground truth):
public static int licenseRound(double licenseC){
  String numString=Double.toString(licenseC);
  if (numString.contains("String_Node_Str")) {
    String decimalValue=numString.split("String_Node_Str")[1];
    String integerValue=numString.split("String_Node_Str")[0];
    try {
      Double decimalDouble=new Double(decimalValue);
      Integer value=new Integer(integerValue);
      if (decimalDouble > 0)       return (value + 1);
    }
 catch (    Exception e) {
    }
  }
  return new Double(licenseC).intValue();
}
Program: 37991
Project: 37991
Buggy source:
public String getAgentName(int agentId){
  String val=s.AGENT_NAME_JAVA;
switch (agentId) {
case 1:
    val=s.AGENT_NAME_DOTNET;
  break;
case 2:
val=s.AGENT_NAME_PHP;
break;
case 3:
val=s.AGENT_NAME_NODEJS;
break;
case 4:
val=s.AGENT_NAME_MACHINE_AGENT;
break;
case 5:
val=LicenseS.AGENT_NAME_OTHER_AGENT;
break;
default :
break;
}
return val;
}

Fixed version (ground truth):
public String getAgentName(int agentId){
  String val=s.AGENT_NAME_JAVA;
switch (agentId) {
case 1:
    val=s.AGENT_NAME_DOTNET;
  break;
case 2:
val=s.AGENT_NAME_PHP;
break;
case 3:
val=s.AGENT_NAME_NODEJS;
break;
case 4:
val=s.AGENT_NAME_MACHINE_AGENT;
break;
case 5:
val=LicenseS.AGENT_NAME_OTHER_AGENT;
break;
case 6:
val=s.AGENT_NAME_WEB_SERVER;
default :
break;
}
return val;
}
Program: 37992
Project: 37992
Buggy source:
public boolean checkIfNotJava(RESTAccess access,String app,long start,long end){
  if (s.debugLevel >= 2)   logger.log(Level.INFO,new StringBuilder().append("String_Node_Str").append(node.getName()).append("String_Node_Str").append(node.getTierName()).toString());
  MetricDatas mds=access.getRESTMetricQuery(25,app,node.getTierName(),node.getName(),start,end);
  if (mds != null && mds.getMetric_data() != null && mds.getMetric_data().size() == 0)   return true;
  return false;
}

Fixed version (ground truth):
public boolean checkIfNotJava(RESTAccess access,String app,long start,long end){
  MetricDatas mds=access.getRESTMetricQuery(25,app,node.getTierName(),node.getName(),start,end);
  if (s.debugLevel >= 2)   logger.log(Level.INFO,new StringBuilder().append("String_Node_Str").append(node.getName()).append("String_Node_Str").append(node.getTierName()).toString());
  if (mds != null && mds.getMetric_data() != null && mds.getMetric_data().size() == 0)   return true;
  return false;
}
Program: 37994
Project: 37994
Buggy source:
public NodeLicenseCount addNodeRange(Node node){
  NodeLicenseCount nodeL=new NodeLicenseCount(node);
  nodeCount++;
  nodeLicenseCount.add(nodeL);
  return nodeL;
}

Fixed version (ground truth):
public NodeLicenseCount addNodeRange(Node node){
  NodeLicenseCount nodeL=null;
  try {
    nodeL=new NodeLicenseCount(node);
    nodeCount++;
    nodeLicenseCount.add(nodeL);
  }
 catch (  Exception e) {
    StringBuilder bud=new StringBuilder();
    bud.append("String_Node_Str").append(node.toString()).append("String_Node_Str");
    logger.log(Level.SEVERE,bud.toString());
  }
  return nodeL;
}