nus-yam/ex-repair huggingface dataset:
Program: 7247
Project: 7247
Buggy source:
/** 
 * Adds Integrity CM Project info to the build variables  
 */
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  Logger.debug("String_Node_Str");
  env.put("String_Node_Str",configPath);
  env.put("String_Node_Str",hostName);
  env.put("String_Node_Str",String.valueOf(port));
  env.put("String_Node_Str",userName);
}

Fixed version (ground truth):
/** 
 * Adds Integrity CM Project info to the build variables  
 */
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  Logger.debug("String_Node_Str");
  env.put("String_Node_Str",IntegrityCheckpointAction.evalGroovyExpression(env,configPath));
  env.put("String_Node_Str",hostName);
  env.put("String_Node_Str",String.valueOf(port));
  env.put("String_Node_Str",userName);
}
Program: 7248
Project: 7248
Buggy source:
/** 
 * Primes the Integrity Project Member metadata information
 * @param api Integrity API Session
 * @return response Integrity API Response
 * @throws APIException
 * @throws SQLException 
 */
private Response initializeCMProjectMembers(APISession api) throws APIException, SQLException {
  Command siViewProjectCmd=new Command(Command.SI,"String_Node_Str");
  siViewProjectCmd.addOption(new Option("String_Node_Str"));
  siViewProjectCmd.addOption(new Option("String_Node_Str",siProject.getConfigurationPath()));
  MultiValue mvFields=new MultiValue("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  siViewProjectCmd.addOption(new Option("String_Node_Str",mvFields));
  Logger.debug("String_Node_Str" + siProject.getConfigurationPath());
  Response viewRes=api.runCommandWithInterim(siViewProjectCmd);
  siProject.parseProject(viewRes.getWorkItems());
  return viewRes;
}

Fixed version (ground truth):
/** 
 * Primes the Integrity Project Member metadata information
 * @param api Integrity API Session
 * @return response Integrity API Response
 * @throws APIException
 * @throws SQLException 
 */
private Response initializeCMProjectMembers(APISession api) throws APIException, SQLException {
  Command siViewProjectCmd=new Command(Command.SI,"String_Node_Str");
  siViewProjectCmd.addOption(new Option("String_Node_Str"));
  siViewProjectCmd.addOption(new Option("String_Node_Str",siProject.getConfigurationPath()));
  MultiValue mvFields=new MultiValue("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  mvFields.add("String_Node_Str");
  siViewProjectCmd.addOption(new Option("String_Node_Str",mvFields));
  if (null != includeList && includeList.length() > 0) {
    siViewProjectCmd.addOption(new Option("String_Node_Str",parseIncludeExcludeList(includeList,true)));
  }
  if (null != excludeList && excludeList.length() > 0) {
    siViewProjectCmd.addOption(new Option("String_Node_Str",parseIncludeExcludeList(excludeList,false)));
  }
  Logger.debug("String_Node_Str" + siProject.getConfigurationPath());
  Response viewRes=api.runCommandWithInterim(siViewProjectCmd);
  siProject.parseProject(viewRes.getWorkItems());
  return viewRes;
}
Program: 7251
Project: 7251
Buggy source:
/** 
 * Primes the Integrity Project metadata information
 * @param api Integrity API Session
 * @return response Integrity API Response
 * @throws APIException
 */
private Response initializeCMProject(APISession api,File projectDB) throws APIException {
  Command siProjectInfoCmd=new Command(Command.SI,"String_Node_Str");
  siProjectInfoCmd.addOption(new Option("String_Node_Str",configPath));
  Logger.debug("String_Node_Str" + configPath);
  Response infoRes=api.runCommand(siProjectInfoCmd);
  Logger.debug(infoRes.getCommandString() + "String_Node_Str" + infoRes.getExitCode());
  siProject=new IntegrityCMProject(infoRes.getWorkItems().next(),projectDB);
  siProject.setLineTerminator(lineTerminator);
  siProject.setRestoreTimestamp(restoreTimestamp);
  siProject.setSkipAuthorInfo(skipAuthorInfo);
  return infoRes;
}

Fixed version (ground truth):
/** 
 * Primes the Integrity Project metadata information
 * @param api Integrity API Session
 * @return response Integrity API Response
 * @throws APIException
 */
private Response initializeCMProject(APISession api,File projectDB,String resolvedConfigPath) throws APIException {
  Command siProjectInfoCmd=new Command(Command.SI,"String_Node_Str");
  siProjectInfoCmd.addOption(new Option("String_Node_Str",resolvedConfigPath));
  Logger.debug("String_Node_Str" + resolvedConfigPath);
  Response infoRes=api.runCommand(siProjectInfoCmd);
  Logger.debug(infoRes.getCommandString() + "String_Node_Str" + infoRes.getExitCode());
  siProject=new IntegrityCMProject(infoRes.getWorkItems().next(),projectDB);
  siProject.setLineTerminator(lineTerminator);
  siProject.setRestoreTimestamp(restoreTimestamp);
  siProject.setSkipAuthorInfo(skipAuthorInfo);
  return infoRes;
}
Program: 7256
Project: 7256
Buggy source:
public XBeeAddress queryRemoteDestination(XBeeAddress destination,int attempts) throws IOException {
  final XBeeAddress[] result=new XBeeAddress[1];
  int status;
  do {
    status=queryRemoteDestination(destination,new XBeeTerminatingDestinationVisitor(){
      @Override public boolean isTerminated(){
        return result[0] != null;
      }
      @Override public void visitNodeDestination(      XBeeAddress node,      XBeeAddress nodeDestination){
        result[0]=nodeDestination;
      }
    }
);
  }
 while (result[0] != null && --attempts > 0);
  if (status != XBeeAtResponseFrame.STATUS_OK)   throw new XBeeException(XBeeUtil.formatStatus(status));
  return result[0];
}

Fixed version (ground truth):
public XBeeAddress queryRemoteDestination(XBeeAddress destination,int attempts) throws IOException {
  final XBeeAddress[] result=new XBeeAddress[1];
  int status;
  do {
    status=queryRemoteDestination(destination,new XBeeTerminatingDestinationVisitor(){
      @Override public boolean isTerminated(){
        return result[0] != null;
      }
      @Override public void visitNodeDestination(      XBeeAddress node,      XBeeAddress nodeDestination){
        result[0]=nodeDestination;
      }
    }
);
  }
 while (result[0] == null && --attempts > 0);
  if (status != XBeeAtResponseFrame.STATUS_OK)   throw new XBeeException(XBeeUtil.formatStatus(status));
  return result[0];
}
Program: 7257
Project: 7257
Buggy source:
public void split(){
  leaf=false;
  physEnable();
  if (type != Block.WATER && type != Block.EMPTY) {
    world.remove(body);
    physDisable();
  }
  for (int i=0; i < 4; i++) {
    children[i]=new Node(level + 1,tree,world);
    children[i].parent=this;
    children[i].type=type;
  }
  children[0].physrect.setLocation(physrect.getX(),physrect.getY());
  children[1].physrect.setLocation(physrect.getX() + physrect.getWidth() * 0.5f,physrect.getY());
  children[2].physrect.setLocation(physrect.getX(),physrect.getY() + physrect.getHeight() * 0.5f);
  children[3].physrect.setLocation(physrect.getX() + physrect.getWidth() * 0.5f,physrect.getY() + physrect.getHeight() * 0.5f);
  children[0].rect.setLocation(rect.getX(),rect.getY());
  children[1].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY());
  children[2].rect.setLocation(rect.getX(),rect.getY() + rect.getHeight() * 0.5f);
  children[3].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY() + rect.getHeight() * 0.5f);
  for (  Node child : children) {
  }
  for (int i=0; i < 4; i++) {
    if (children[i].type == Block.EMPTY || children[i].type == Block.WATER) {
      physDisable();
    }
 else {
      physEnable();
    }
  }
}

Fixed version (ground truth):
public void split(){
  leaf=false;
  physEnable();
  if (type != Block.WATER && type != Block.ACID && type != Block.EMPTY) {
    world.remove(body);
    physDisable();
  }
  for (int i=0; i < 4; i++) {
    children[i]=new Node(level + 1,tree,world);
    children[i].parent=this;
    children[i].type=type;
  }
  children[0].physrect.setLocation(physrect.getX(),physrect.getY());
  children[1].physrect.setLocation(physrect.getX() + physrect.getWidth() * 0.5f,physrect.getY());
  children[2].physrect.setLocation(physrect.getX(),physrect.getY() + physrect.getHeight() * 0.5f);
  children[3].physrect.setLocation(physrect.getX() + physrect.getWidth() * 0.5f,physrect.getY() + physrect.getHeight() * 0.5f);
  children[0].rect.setLocation(rect.getX(),rect.getY());
  children[1].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY());
  children[2].rect.setLocation(rect.getX(),rect.getY() + rect.getHeight() * 0.5f);
  children[3].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY() + rect.getHeight() * 0.5f);
  for (  Node child : children) {
  }
  for (int i=0; i < 4; i++) {
    if (children[i].type == Block.EMPTY || children[i].type == Block.WATER || children[i].type == Block.ACID) {
      physDisable();
    }
 else {
      physEnable();
    }
  }
}
Program: 7259
Project: 7259
Buggy source:
public void update(){
  for (int i=0; i < waternodes.size(); i++) {
    float x=waternodes.get(i).physrect.getX();
    float y=waternodes.get(i).physrect.getY();
    float width=waternodes.get(i).physrect.getWidth();
    float height=waternodes.get(i).physrect.getHeight();
    Node leaf=getLeaf(x,y + height);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x,y + height,Block.WATER);
        emptyCell(x,y);
      }
 else       if (getLeaf(x + width,y).type == Block.EMPTY) {
        fillCell(x + width,y,Block.WATER);
        emptyCell(x,y);
      }
 else       if (getLeaf(x - width,y).type == Block.EMPTY) {
        fillCell(x - width,y,Block.WATER);
        emptyCell(x,y);
      }
    }
  }
  for (int i=0; i < acidnodes.size(); i++) {
    float x=acidnodes.get(i).physrect.getX();
    float y=acidnodes.get(i).physrect.getY();
    float width=acidnodes.get(i).physrect.getWidth();
    float height=acidnodes.get(i).physrect.getHeight();
    Node leaf=getLeaf(x,y + height);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x,y + height,Block.ACID);
        emptyCell(x,y);
      }
 else       if (getLeaf(x + width,y).type == Block.EMPTY) {
        fillCell(x + width,y,Block.ACID);
        emptyCell(x,y);
      }
 else       if (getLeaf(x - width,y).type == Block.EMPTY) {
        fillCell(x - width,y,Block.ACID);
        emptyCell(x,y);
      }
    }
  }
}

Fixed version (ground truth):
public void update(){
  for (int i=0; i < waternodes.size(); i++) {
    float x=waternodes.get(i).physrect.getX();
    float y=waternodes.get(i).physrect.getY();
    float width=waternodes.get(i).physrect.getWidth();
    float height=waternodes.get(i).physrect.getHeight();
    Node leaf=getLeaf(x,y + height);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x,y + height,Block.WATER);
        emptyCell(x,y);
        continue;
      }
    }
    leaf=getLeaf(x + width,y);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x + width,y,Block.WATER);
        emptyCell(x,y);
        continue;
      }
    }
    leaf=getLeaf(x - width,y);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x - width,y,Block.WATER);
        emptyCell(x,y);
        continue;
      }
    }
  }
  for (int i=0; i < acidnodes.size(); i++) {
    float x=acidnodes.get(i).physrect.getX();
    float y=acidnodes.get(i).physrect.getY();
    float width=acidnodes.get(i).physrect.getWidth();
    float height=acidnodes.get(i).physrect.getHeight();
    Node leaf=getLeaf(x,y + height);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x,y + height,Block.ACID);
        emptyCell(x,y);
        continue;
      }
    }
    leaf=getLeaf(x + width,y);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x + width,y,Block.ACID);
        emptyCell(x,y);
        continue;
      }
    }
    leaf=getLeaf(x - width,y);
    if (leaf != null) {
      if (leaf.type == Block.EMPTY) {
        fillCell(x - width,y,Block.ACID);
        emptyCell(x,y);
        continue;
      }
    }
  }
}
Program: 7261
Project: 7261
Buggy source:
public void init(GameContainer container,StateBasedGame game) throws SlickException {
  gameworld=new GameWorld("String_Node_Str");
  player=new Player(gameworld,Main.GU,Main.GU,Main.GU * 5,Main.GU * 5,1);
  gameworld.add(player.getCharacter());
  gameworld.add(player.getBody());
  timer=0;
}

Fixed version (ground truth):
public void init(GameContainer container,StateBasedGame game) throws SlickException {
  gameworld=new GameWorld("String_Node_Str");
  player=new Player(gameworld,Main.GU,Main.GU,Main.GU * 3,Main.GU * 4,1);
  gameworld.add(player.getCharacter());
  gameworld.add(player.getBody());
  timer=0;
}
Program: 7262
Project: 7262
Buggy source:
public void update(GameContainer container,StateBasedGame game,int delta){
  timer+=delta;
  while (timer > 20) {
    this.game=game;
    if (Main.KEYDOWN[Input.KEY_ESCAPE]) {
      game.enterState(0);
    }
    player.update(container,game,1);
    gameworld.update(container,game,1);
    timer-=20;
  }
}

Fixed version (ground truth):
public void update(GameContainer container,StateBasedGame game,int delta){
  timer+=delta;
  while (timer > 20) {
    this.game=game;
    if (Main.KEYDOWN[Input.KEY_ESCAPE]) {
      game.enterState(0);
    }
    player.update(container,game,delta);
    gameworld.update(container,game,delta);
    timer-=20;
  }
}
Program: 7263
Project: 7263
Buggy source:
public void update(GameContainer container,StateBasedGame game,int delta){
  terrain.update();
  world.step();
  for (  GameEntity entity : entities) {
    entity.update(container,game,delta);
  }
  if (viewportgoal.getX() != viewport.getX() || viewportgoal.getY() != viewport.getY()) {
    viewport.setLocation(viewport.getX() - (viewport.getX() - viewportgoal.getX()) * 0.5f,viewport.getY() - (viewport.getY() - viewportgoal.getY()) * 0.5f);
  }
}

Fixed version (ground truth):
public void update(GameContainer container,StateBasedGame game,int delta){
  terrain.update();
  world.step();
  System.out.println("String_Node_Str" + terrain.getNumberOfNodes());
  System.out.println("String_Node_Str" + terrain.getNumberOfLeaves());
  System.out.println("String_Node_Str" + world.getBodies().size());
  for (  GameEntity entity : entities) {
    entity.update(container,game,delta);
  }
  if (viewportgoal.getX() != viewport.getX() || viewportgoal.getY() != viewport.getY()) {
    viewport.setLocation(viewport.getX() - (viewport.getX() - viewportgoal.getX()) * 0.5f,viewport.getY() - (viewport.getY() - viewportgoal.getY()) * 0.5f);
  }
}
Program: 7264
Project: 7264
Buggy source:
public GameWorld(String level) throws SlickException {
  world=new World(Main.GRAVITY,Main.ITERATIONS);
  bg=new Image("String_Node_Str");
  terrain=new QuadTree(0,0,1280 * Main.GU,8,world);
  load(level);
  viewport=new Rectangle(0,0,Main.SCREEN_W,Main.SCREEN_H);
  viewportgoal=new Vector2f(viewport.getX(),viewport.getY());
  viewportzoom=1;
  entities=new ArrayList<GameEntity>();
  music=new Music("String_Node_Str");
}

Fixed version (ground truth):
public GameWorld(String level) throws SlickException {
  world=new World(Main.GRAVITY,Main.ITERATIONS,new QuadSpaceStrategy(16,4));
  bg=new Image("String_Node_Str");
  terrain=new QuadTree(0,0,320 * Main.GU,6,world);
  load(level);
  viewport=new Rectangle(0,0,Main.SCREEN_W,Main.SCREEN_H);
  viewportgoal=new Vector2f(viewport.getX(),viewport.getY());
  viewportzoom=1;
  entities=new ArrayList<GameEntity>();
}
Program: 7265
Project: 7265
Buggy source:
public void load(String s){
  BufferedReader bufferedReader;
  try {
    bufferedReader=new BufferedReader(new FileReader(s));
    String level=bufferedReader.readLine();
    for (    String node : level.split("String_Node_Str")) {
      String[] n=node.split("String_Node_Str");
      terrain.fillCell(Float.parseFloat(n[0]),Float.parseFloat(n[1]),Block.valueOf(n[2]));
    }
    bufferedReader.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void load(String s){
  BufferedReader bufferedReader;
  try {
    bufferedReader=new BufferedReader(new FileReader(s));
    String level=bufferedReader.readLine();
    for (    String node : level.split("String_Node_Str")) {
      String[] n=node.split("String_Node_Str");
      terrain.fillCell(Float.parseFloat(n[0]),Float.parseFloat(n[1]),Block.valueOf(n[3]),Integer.parseInt(n[2]));
    }
    bufferedReader.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 7266
Project: 7266
Buggy source:
public void leave(){
  music.stop();
}

Fixed version (ground truth):
public void leave(){
}
Program: 7267
Project: 7267
Buggy source:
public void reset(){
  for (  GameEntity e : entities) {
    e.reset();
  }
  viewport=new Rectangle(0,0,Main.SCREEN_W,Main.SCREEN_H);
  music.play();
  viewportzoom=1;
}

Fixed version (ground truth):
public void reset(){
  for (  GameEntity e : entities) {
    e.reset();
  }
  viewport=new Rectangle(0,0,Main.SCREEN_W,Main.SCREEN_H);
  viewportzoom=1;
}
Program: 7268
Project: 7268
Buggy source:
public Character(GameWorld gw,float _x,float _y,float _width,float _height,float _mass){
  super.init(gw,_x,_y,_width,_height,_mass);
  body.setCanRest(false);
  try {
    runningAnimation=new Animation(new SpriteSheet("String_Node_Str",50,50),0,0,4,0,true,50,true);
  }
 catch (  SlickException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public Character(GameWorld gw,float _x,float _y,float _width,float _height,float _mass){
  super.init(gw,_x,_y,_width,_height,_mass);
  body.setCanRest(true);
  try {
    runningLeftAnimation=new Animation(new SpriteSheet("String_Node_Str",50,50),0,0,4,0,true,50,true);
    runningRightAnimation=new Animation(new SpriteSheet("String_Node_Str",50,50),0,0,4,0,true,50,true);
  }
 catch (  SlickException e) {
    e.printStackTrace();
  }
}
Program: 7269
Project: 7269
Buggy source:
public void render(Graphics g){
  g.pushTransform();
  g.translate(-gameworld.viewport.getX(),-gameworld.viewport.getY());
  runningAnimation.draw(boundingBox.getX(),boundingBox.getY());
  g.popTransform();
  super.render(g);
}

Fixed version (ground truth):
public void render(Graphics g){
  g.pushTransform();
  g.translate(-gameworld.viewport.getX(),-gameworld.viewport.getY());
  if (facingRight)   runningRightAnimation.draw(boundingBox.getX(),boundingBox.getY());
 else   runningLeftAnimation.draw(boundingBox.getX(),boundingBox.getY());
  g.popTransform();
  super.render(g);
}
Program: 7270
Project: 7270
Buggy source:
public void init(GameWorld gw,float _x,float _y,float _width,float _height,float _mass){
  body=new Body(new Box(_width,_height),_mass);
  body.setUserData(this);
  body.setRestitution(0);
  body.setFriction(Main.mu);
  body.setRotatable(false);
  body.setPosition(_x + _width * 0.5f,_y + _height * 0.5f);
  gameworld=gw;
  boundingBox=new Rectangle(_x,_y,_width,_height);
}

Fixed version (ground truth):
public void init(GameWorld gw,float _x,float _y,float _width,float _height,float _mass){
  body=new Body(new Box(_width,_height),_mass);
  body.setUserData(this);
  body.setRestitution(0);
  body.setFriction(Main.mu);
  body.setMaxVelocity(40 * Main.GU,80 * Main.GU);
  body.setRotatable(false);
  body.setPosition(_x + _width * 0.5f,_y + _height * 0.5f);
  gameworld=gw;
  boundingBox=new Rectangle(_x,_y,_width,_height);
}
Program: 7271
Project: 7271
Buggy source:
public void update(GameContainer container,StateBasedGame game,int delta){
  boundingBox.setLocation(body.getPosition().getX() - boundingBox.getWidth() * 0.5f,body.getPosition().getY() - boundingBox.getHeight() * 0.5f);
}

Fixed version (ground truth):
public void update(GameContainer container,StateBasedGame game,int delta){
  grounded=onGroundImpl(body);
  if (grounded && body.getVelocity().getY() > 0) {
    body.adjustVelocity(new net.phys2d.math.Vector2f(0,-body.getVelocity().getY()));
  }
  if (grounded && !moving) {
    body.adjustVelocity(new net.phys2d.math.Vector2f(-body.getVelocity().getY() * 0.1f,0));
  }
  boundingBox.setLocation(body.getPosition().getX() - boundingBox.getWidth() * 0.5f,body.getPosition().getY() - boundingBox.getHeight() * 0.5f);
  moving=false;
}
Program: 7273
Project: 7273
Buggy source:
public void split(){
  leaf=false;
  body.setEnabled(false);
  for (int i=0; i < 4; i++) {
    children[i]=new Node(level + 1,tree,world);
    children[i].parent=this;
    children[i].type=type;
    if (children[i].type == Block.EMPTY || children[i].type == Block.WATER)     children[i].body.setEnabled(false);
 else     children[i].body.setEnabled(true);
  }
  children[0].body.setPosition(rect.getX(),rect.getY());
  children[1].body.setPosition(rect.getX() + rect.getWidth() * 0.5f,rect.getY());
  children[2].body.setPosition(rect.getX(),rect.getY() + rect.getHeight() * 0.5f);
  children[3].body.setPosition(rect.getX() + rect.getWidth() * 0.5f,rect.getY() + rect.getHeight() * 0.5f);
  children[0].rect.setLocation(rect.getX(),rect.getY());
  children[1].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY());
  children[2].rect.setLocation(rect.getX(),rect.getY() + rect.getHeight() * 0.5f);
  children[3].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY() + rect.getHeight() * 0.5f);
  for (  Node child : children) {
    child.body.adjustPosition(new Vector2f(child.rect.getWidth() * 0.5f,child.rect.getHeight() * 0.5f));
  }
}

Fixed version (ground truth):
public void split(){
  leaf=false;
  body.setEnabled(false);
  world.remove(body);
  for (int i=0; i < 4; i++) {
    children[i]=new Node(level + 1,tree,world);
    children[i].parent=this;
    children[i].type=type;
    if (children[i].type == Block.EMPTY || children[i].type == Block.WATER)     children[i].body.setEnabled(false);
 else     children[i].body.setEnabled(true);
    if (children[i].type == Block.RUBBER)     children[i].body.setRestitution(1);
 else     children[i].body.setRestitution(0);
  }
  children[0].body.setPosition(rect.getX(),rect.getY());
  children[1].body.setPosition(rect.getX() + rect.getWidth() * 0.5f,rect.getY());
  children[2].body.setPosition(rect.getX(),rect.getY() + rect.getHeight() * 0.5f);
  children[3].body.setPosition(rect.getX() + rect.getWidth() * 0.5f,rect.getY() + rect.getHeight() * 0.5f);
  children[0].rect.setLocation(rect.getX(),rect.getY());
  children[1].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY());
  children[2].rect.setLocation(rect.getX(),rect.getY() + rect.getHeight() * 0.5f);
  children[3].rect.setLocation(rect.getX() + rect.getWidth() * 0.5f,rect.getY() + rect.getHeight() * 0.5f);
  for (  Node child : children) {
    child.body.adjustPosition(new Vector2f(child.rect.getWidth() * 0.5f,child.rect.getHeight() * 0.5f));
  }
}
Program: 7274
Project: 7274
Buggy source:
public String toString(){
  String returnstring="String_Node_Str";
  if (leaf && type != Block.EMPTY) {
    returnstring=returnstring + "String_Node_Str" + body.getPosition().getX()+ "String_Node_Str"+ body.getPosition().getY()+ "String_Node_Str"+ type;
  }
  if (children[0] != null) {
    for (    Node c : children) {
      returnstring=returnstring + c.toString();
    }
  }
  return returnstring;
}

Fixed version (ground truth):
public String toString(){
  String returnstring="String_Node_Str";
  if (leaf && type != Block.EMPTY) {
    returnstring=returnstring + "String_Node_Str" + body.getPosition().getX()+ "String_Node_Str"+ body.getPosition().getY()+ "String_Node_Str"+ level+ "String_Node_Str"+ type;
  }
  if (children[0] != null) {
    for (    Node c : children) {
      returnstring=returnstring + c.toString();
    }
  }
  return returnstring;
}
Program: 7275
Project: 7275
Buggy source:
public void reset(){
  for (  GameEntity e : entities) {
    e.reset();
  }
  player.reset();
  viewport=new Rectangle(0,0,128 * Main.GU,72 * Main.GU);
  viewportzoom=1;
}

Fixed version (ground truth):
public void reset(){
  for (  GameEntity e : entities) {
    e.reset();
  }
  player.reset();
  viewport=new Rectangle(0,0,Main.SCREEN_W,Main.SCREEN_H);
  viewportzoom=1;
}
Program: 7276
Project: 7276
Buggy source:
public GameWorld() throws SlickException {
  terrain=new QuadTree(0,0,1280 * Main.GU,8);
  viewport=new Rectangle(0,0,128 * Main.GU,72 * Main.GU);
  viewportgoal=new Vector2f(viewport.getX(),viewport.getY());
  viewportzoom=1;
  player=new Player(this);
  entities=new ArrayList<GameEntity>();
  entities.add(player.getCharacter());
}

Fixed version (ground truth):
public GameWorld() throws SlickException {
  terrain=new QuadTree(0,0,1280 * Main.GU,8);
  viewport=new Rectangle(0,0,Main.SCREEN_W,Main.SCREEN_H);
  viewportgoal=new Vector2f(viewport.getX(),viewport.getY());
  viewportzoom=1;
  player=new Player(this);
  entities=new ArrayList<GameEntity>();
  entities.add(player.getCharacter());
}
Program: 7278
Project: 7278
Buggy source:
public void render(Graphics g,Rectangle viewport){
  dummy=0;
  depth=0;
  g.pushTransform();
  g.translate(-viewport.getX(),-viewport.getY());
  g.setDrawMode(g.MODE_NORMAL);
  g.setColor(Color.black);
  g.fill(viewport);
  traverseTree(startNode,g,viewport);
  if (Main.DEBUG) {
    g.setColor(Color.red);
    for (    Line n : nodelines) {
      if (n != null)       g.draw(n);
    }
    for (    Line m : movelines) {
      if (m != null)       g.draw(m);
    }
    for (    Polygon p : forwards) {
      if (p != null)       g.draw(p);
    }
    g.setColor(Color.white);
  }
  g.popTransform();
}

Fixed version (ground truth):
public void render(Graphics g,Rectangle viewport){
  dummy=0;
  depth=0;
  g.pushTransform();
  g.translate(-viewport.getX(),-viewport.getY());
  g.setDrawMode(g.MODE_NORMAL);
  g.setColor(Color.black);
  g.fill(viewport);
  traverseTree(startNode,g,viewport);
  if (Main.DEBUG) {
    g.setColor(Color.red);
    g.draw(viewport);
    for (    Line n : nodelines) {
      if (n != null)       g.draw(n);
    }
    for (    Line m : movelines) {
      if (m != null)       g.draw(m);
    }
    for (    Polygon p : forwards) {
      if (p != null)       g.draw(p);
    }
    g.setColor(Color.white);
  }
  g.popTransform();
}
Program: 7279
Project: 7279
Buggy source:
/** 
 * Method to play the game of placing the queens
 */
public void play(){
  for (int j=0; j < cols; j++) {
    board[0][j]=1;
    playRecursive(1);
    board[0][j]=0;
  }
}

Fixed version (ground truth):
/** 
 * Method to place the queens on the board
 */
public void play(){
  for (int j=0; j < cols; j++) {
    board[0][j]=1;
    playRecursive(1);
    board[0][j]=0;
  }
}
Program: 7280
Project: 7280
Buggy source:
private void playRecursive(int queenNum){
  if (queenNum >= rows)   return;
  for (int j=0; j < cols; j++) {
    board[queenNum][j]=1;
    if (isBoardSafe()) {
      if (queenNum == rows - 1) {
        System.out.println();
        System.out.println("String_Node_Str" + ++numSolutions);
        printBoard();
      }
 else       playRecursive(queenNum + 1);
    }
    board[queenNum][j]=0;
  }
}

Fixed version (ground truth):
/** 
 * Method implementing recursion
 */
private void playRecursive(int queenNum){
  if (queenNum >= rows)   return;
  for (int j=0; j < cols; j++) {
    board[queenNum][j]=1;
    if (isBoardSafe()) {
      if (queenNum == rows - 1) {
        System.out.println();
        System.out.println("String_Node_Str" + ++numSolutions);
        printBoard();
      }
 else       playRecursive(queenNum + 1);
    }
    board[queenNum][j]=0;
  }
}
Program: 7281
Project: 7281
Buggy source:
/** 
 * Method to play the game of placing the queens
 */
public void play(){
  for (int i=0; i < rows; i++)   board[i][0]=1;
  placeQueen(0);
}

Fixed version (ground truth):
/** 
 * Method to play the game of placing the queens
 */
public void play(){
  for (int j=0; j < cols; j++) {
    board[0][j]=1;
    playRecursive(1);
    board[0][j]=0;
  }
}
Program: 7282
Project: 7282
Buggy source:
/** 
 * Display current state of the board
 */
public void printBoard(){
  for (int i=0; i < rows; i++) {
    for (int j=0; j < cols; j++) {
      if (board[i][j] > 0)       System.out.print("String_Node_Str");
 else       System.out.print("String_Node_Str");
    }
    System.out.println();
  }
}

Fixed version (ground truth):
/** 
 * Display current state of the board
 */
public void printBoard(){
  System.out.println("String_Node_Str" + ++numSolutions);
  for (int i=0; i < rows; i++) {
    for (int j=0; j < cols; j++) {
      if (board[i][j] > 0)       System.out.print("String_Node_Str");
 else       System.out.print("String_Node_Str");
    }
    System.out.println();
  }
}
Program: 7283
Project: 7283
Buggy source:
public void findPaths(){
  int writePos=1;
  path[0]=matrix[0][0];
  findPathRec(writePos,1,0);
  findPathRec(writePos,0,1);
}

Fixed version (ground truth):
public void findPaths(){
  System.out.println("String_Node_Str");
  int writePos=1;
  path[0]=matrix[0][0];
  if (rows > 1)   findPathRec(writePos,1,0);
  if (cols > 1)   findPathRec(writePos,0,1);
}
Program: 7284
Project: 7284
Buggy source:
public synchronized void stop(){
  if (null == m_processStream || null == m_thread) {
    return;
  }
  Thread t=m_thread;
  m_thread=null;
  t.interrupt();
}

Fixed version (ground truth):
public synchronized void stop(){
  if (null == m_processStream || null == m_thread) {
    return;
  }
  try {
    byte[] cbuf=new byte[READ_BUFFER];
    while (m_in.available() != 0) {
      if (!readAndFlush(cbuf)) {
        break;
      }
      ;
    }
  }
 catch (  IOException e) {
  }
  Thread t=m_thread;
  m_thread=null;
  t.interrupt();
}
Program: 7285
Project: 7285
Buggy source:
public void run(){
  byte[] cbuf=new byte[8192];
  while (Thread.currentThread() == m_thread) {
    try {
      if (m_in.available() == 0) {
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
        continue;
      }
      int bytesRead=m_in.read(cbuf,0,8192);
      if (bytesRead == -1) {
        break;
      }
      m_out.write(cbuf,0,bytesRead);
      m_out.flush();
    }
 catch (    IOException e) {
      if (Thread.currentThread() == m_thread) {
        e.printStackTrace();
      }
    }
  }
  try {
    if (m_in == m_processStream) {
      m_in.close();
    }
  }
 catch (  IOException e) {
  }
 finally {
    m_processStream=null;
  }
}

Fixed version (ground truth):
public void run(){
  byte[] cbuf=new byte[READ_BUFFER];
  while (Thread.currentThread() == m_thread) {
    try {
      if (m_in.available() == 0) {
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
        continue;
      }
      if (!readAndFlush(cbuf)) {
        break;
      }
    }
 catch (    IOException e) {
      if (Thread.currentThread() == m_thread) {
        e.printStackTrace();
      }
    }
  }
  try {
    if (m_in == m_processStream) {
      m_in.close();
    }
  }
 catch (  IOException e) {
  }
 finally {
    m_processStream=null;
  }
}
Program: 7288
Project: 7288
Buggy source:
public void onClick(DialogInterface dialog,int which){
  dialog.dismiss();
  final ValuesDelta structuredName=allNames.get(which);
  structuredName.put(Data.IS_PRIMARY,1);
  structuredName.put(Data.IS_SUPER_PRIMARY,1);
}

Fixed version (ground truth):
public void onClick(DialogInterface dialog,int which){
  dialog.dismiss();
  final Account account=accountAdapter.getItem(which);
  createContact(account);
}
Program: 7289
Project: 7289
Buggy source:
@Override protected AlertDialog.Builder doInBackground(final EditContactActivity target,Void... params){
  final Sources sources=Sources.getInstance(target);
  final Context dialogContext=new ContextThemeWrapper(target,android.R.style.Theme_Light);
  final LayoutInflater dialogInflater=(LayoutInflater)dialogContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  final ArrayList<Account> writable=sources.getAccounts(true);
  if (writable.isEmpty()) {
    selectAccount(null);
    return null;
  }
  if (writable.size() == 1) {
    selectAccount(writable.get(0));
    return null;
  }
  final ArrayAdapter<Account> accountAdapter=new ArrayAdapter<Account>(target,android.R.layout.simple_list_item_2,writable){
    @Override public View getView(    int position,    View convertView,    ViewGroup parent){
      if (convertView == null) {
        convertView=dialogInflater.inflate(android.R.layout.simple_list_item_2,parent,false);
      }
      final TextView text1=(TextView)convertView.findViewById(android.R.id.text1);
      final TextView text2=(TextView)convertView.findViewById(android.R.id.text2);
      final Account account=this.getItem(position);
      final ContactsSource source=sources.getInflatedSource(account.type,ContactsSource.LEVEL_SUMMARY);
      text1.setText(account.name);
      text2.setText(source.getDisplayLabel(target));
      return convertView;
    }
  }
;
  final DialogInterface.OnClickListener clickListener=new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      dialog.dismiss();
      final Account account=accountAdapter.getItem(which);
      selectAccount(account);
      EditContactActivity target=mTarget.get();
      if (target != null) {
        target.bindEditors();
      }
    }
  }
;
  final DialogInterface.OnCancelListener cancelListener=new DialogInterface.OnCancelListener(){
    public void onCancel(    DialogInterface dialog){
      if (!target.hasValidState()) {
        target.finish();
      }
    }
  }
;
  final AlertDialog.Builder builder=new AlertDialog.Builder(target);
  builder.setTitle(R.string.dialog_new_contact_account);
  builder.setSingleChoiceItems(accountAdapter,0,clickListener);
  builder.setOnCancelListener(cancelListener);
  return builder;
}

Fixed version (ground truth):
@Override protected ArrayList<Account> doInBackground(final EditContactActivity target,Void... params){
  return Sources.getInstance(target).getAccounts(true);
}
Program: 7290
Project: 7290
Buggy source:
@Override protected void onPostExecute(EditContactActivity target,AlertDialog.Builder result){
  if (result != null) {
    target.showAndManageDialog(result.create());
  }
 else {
    target.bindEditors();
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(final EditContactActivity target,ArrayList<Account> accounts){
  target.selectAccountAndCreateContact(accounts);
}
Program: 7291
Project: 7291
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (convertView == null) {
    convertView=dialogInflater.inflate(android.R.layout.simple_list_item_1,parent,false);
  }
  final ValuesDelta structuredName=this.getItem(position);
  final String displayName=structuredName.getAsString(StructuredName.DISPLAY_NAME);
  ((TextView)convertView).setText(displayName);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (convertView == null) {
    convertView=dialogInflater.inflate(android.R.layout.simple_list_item_2,parent,false);
  }
  final TextView text1=(TextView)convertView.findViewById(android.R.id.text1);
  final TextView text2=(TextView)convertView.findViewById(android.R.id.text2);
  final Account account=this.getItem(position);
  final ContactsSource source=sources.getInflatedSource(account.type,ContactsSource.LEVEL_SUMMARY);
  text1.setText(account.name);
  text2.setText(source.getDisplayLabel(EditContactActivity.this));
  return convertView;
}
Program: 7292
Project: 7292
Buggy source:
public void onCancel(DialogInterface dialog){
  if (!target.hasValidState()) {
    target.finish();
  }
}

Fixed version (ground truth):
public void onCancel(DialogInterface dialog){
  if (!hasValidState()) {
    finish();
  }
}
Program: 7293
Project: 7293
Buggy source:
/** 
 * Return   {@link ContactsSource} for the given account type.
 */
public ContactsSource getInflatedSource(String accountType,int inflateLevel){
  ContactsSource source=mSources.get(accountType);
  if (source == null)   source=mFallbackSource;
  if (source.isInflated(inflateLevel)) {
    return source;
  }
 else {
    source.ensureInflated(mApplicationContext,inflateLevel);
    return source;
  }
}

Fixed version (ground truth):
/** 
 * Return   {@link ContactsSource} for the given account type.
 */
public ContactsSource getInflatedSource(String accountType,int inflateLevel){
  ContactsSource source=mSources.get(accountType);
  if (source == null)   source=mFallbackSource;
  if (source.isInflated(inflateLevel)) {
    return source;
  }
 else {
    source.ensureInflated(mContext,inflateLevel);
    return source;
  }
}
Program: 7294
Project: 7294
Buggy source:
public void readFromParcel(Parcel source){
  final int size=source.readInt();
  for (int i=0; i < size; i++) {
    this.add(source.<EntityDelta>readParcelable(null));
  }
}

Fixed version (ground truth):
public void readFromParcel(Parcel source){
  final ClassLoader loader=getClass().getClassLoader();
  final int size=source.readInt();
  for (int i=0; i < size; i++) {
    this.add(source.<EntityDelta>readParcelable(loader));
  }
}
Program: 7295
Project: 7295
Buggy source:
@Override public Object getItem(int pos){
  if (mSuggestionsCursorCount != 0 && pos <= mSuggestionsCursorCount) {
    mSuggestionsCursor.moveToPosition(getRealPosition(pos));
    return mSuggestionsCursor;
  }
 else {
    return super.getItem(getRealPosition(pos));
  }
}

Fixed version (ground truth):
@Override public Object getItem(int pos){
  if (mSuggestionsCursorCount != 0 && pos <= mSuggestionsCursorCount) {
    mSuggestionsCursor.moveToPosition(getRealPosition(pos));
    return mSuggestionsCursor;
  }
 else   if (isSearchAllContactsItemPosition(pos)) {
    return null;
  }
 else {
    return super.getItem(getRealPosition(pos));
  }
}
Program: 7296
Project: 7296
Buggy source:
@Override public long getItemId(int pos){
  if (mSuggestionsCursorCount != 0 && pos < mSuggestionsCursorCount + 2) {
    if (mSuggestionsCursor.moveToPosition(pos - 1)) {
      return mSuggestionsCursor.getLong(mRowIDColumn);
    }
 else {
      return 0;
    }
  }
  return super.getItemId(getRealPosition(pos));
}

Fixed version (ground truth):
@Override public long getItemId(int pos){
  if (mSuggestionsCursorCount != 0 && pos < mSuggestionsCursorCount + 2) {
    if (mSuggestionsCursor.moveToPosition(pos - 1)) {
      return mSuggestionsCursor.getLong(mRowIDColumn);
    }
 else {
      return 0;
    }
  }
 else   if (isSearchAllContactsItemPosition(pos)) {
    return 0;
  }
  return super.getItemId(getRealPosition(pos));
}
Program: 7299
Project: 7299
Buggy source:
private Bitmap loadContactPhoto(Uri lookupUri,BitmapFactory.Options options){
  Cursor cursor=null;
  Bitmap bm=null;
  try {
    Uri contactUri=Contacts.lookupContact(getContentResolver(),lookupUri);
    Uri photoUri=Uri.withAppendedPath(contactUri,Contacts.Photo.CONTENT_DIRECTORY);
    cursor=getContentResolver().query(photoUri,new String[]{Photo.PHOTO},null,null,null);
    if (cursor != null && cursor.moveToFirst()) {
      bm=ContactsUtils.loadContactPhoto(cursor,0,options);
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  if (bm == null) {
    final int[] fallbacks={R.drawable.ic_contact_picture,R.drawable.ic_contact_picture_2,R.drawable.ic_contact_picture_3};
    bm=BitmapFactory.decodeResource(getResources(),fallbacks[new Random().nextInt(fallbacks.length)]);
  }
  return bm;
}

Fixed version (ground truth):
private Bitmap loadContactPhoto(Uri selectedUri,BitmapFactory.Options options){
  Uri contactUri=null;
  if (Contacts.CONTENT_ITEM_TYPE.equals(getContentResolver().getType(selectedUri))) {
    contactUri=Contacts.lookupContact(getContentResolver(),selectedUri);
  }
 else {
    Cursor cursor=getContentResolver().query(selectedUri,new String[]{Data.CONTACT_ID},null,null,null);
    try {
      if (cursor != null && cursor.moveToFirst()) {
        final long contactId=cursor.getLong(0);
        contactUri=ContentUris.withAppendedId(Contacts.CONTENT_URI,contactId);
      }
    }
  finally {
      if (cursor != null)       cursor.close();
    }
  }
  Cursor cursor=null;
  Bitmap bm=null;
  try {
    Uri photoUri=Uri.withAppendedPath(contactUri,Contacts.Photo.CONTENT_DIRECTORY);
    cursor=getContentResolver().query(photoUri,new String[]{Photo.PHOTO},null,null,null);
    if (cursor != null && cursor.moveToFirst()) {
      bm=ContactsUtils.loadContactPhoto(cursor,0,options);
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  if (bm == null) {
    final int[] fallbacks={R.drawable.ic_contact_picture,R.drawable.ic_contact_picture_2,R.drawable.ic_contact_picture_3};
    bm=BitmapFactory.decodeResource(getResources(),fallbacks[new Random().nextInt(fallbacks.length)]);
  }
  return bm;
}
Program: 7302
Project: 7302
Buggy source:
private Bitmap loadContactPhoto(Uri lookupUri,BitmapFactory.Options options){
  Cursor cursor=null;
  Bitmap bm=null;
  try {
    Uri contactUri=Contacts.lookupContact(getContentResolver(),lookupUri);
    Uri photoUri=Uri.withAppendedPath(contactUri,Contacts.Photo.CONTENT_DIRECTORY);
    cursor=getContentResolver().query(photoUri,new String[]{Photo.PHOTO},null,null,null);
    if (cursor != null && cursor.moveToFirst()) {
      bm=ContactsUtils.loadContactPhoto(cursor,0,options);
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  if (bm == null) {
    final int[] fallbacks={R.drawable.ic_contact_picture,R.drawable.ic_contact_picture_2,R.drawable.ic_contact_picture_3};
    bm=BitmapFactory.decodeResource(getResources(),fallbacks[new Random().nextInt(fallbacks.length)]);
  }
  return bm;
}

Fixed version (ground truth):
private Bitmap loadContactPhoto(Uri selectedUri,BitmapFactory.Options options){
  Uri contactUri=null;
  if (Contacts.CONTENT_ITEM_TYPE.equals(getContentResolver().getType(selectedUri))) {
    contactUri=Contacts.lookupContact(getContentResolver(),selectedUri);
  }
 else {
    Cursor cursor=getContentResolver().query(selectedUri,new String[]{Data.CONTACT_ID},null,null,null);
    try {
      if (cursor != null && cursor.moveToFirst()) {
        final long contactId=cursor.getLong(0);
        contactUri=ContentUris.withAppendedId(Contacts.CONTENT_URI,contactId);
      }
    }
  finally {
      if (cursor != null)       cursor.close();
    }
  }
  Cursor cursor=null;
  Bitmap bm=null;
  try {
    Uri photoUri=Uri.withAppendedPath(contactUri,Contacts.Photo.CONTENT_DIRECTORY);
    cursor=getContentResolver().query(photoUri,new String[]{Photo.PHOTO},null,null,null);
    if (cursor != null && cursor.moveToFirst()) {
      bm=ContactsUtils.loadContactPhoto(cursor,0,options);
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  if (bm == null) {
    final int[] fallbacks={R.drawable.ic_contact_picture,R.drawable.ic_contact_picture_2,R.drawable.ic_contact_picture_3};
    bm=BitmapFactory.decodeResource(getResources(),fallbacks[new Random().nextInt(fallbacks.length)]);
  }
  return bm;
}
Program: 7303
Project: 7303
Buggy source:
private void sendFetchImageMessage(ImageView view){
  final PhotoInfo info=(PhotoInfo)view.getTag();
  if (info == null) {
    return;
  }
  final long photoId=info.photoId;
  if (photoId == 0) {
    return;
  }
  mImageFetcher=new ImageDbFetcher(photoId,view);
synchronized (ContactsListActivity.this) {
    if (sImageFetchThreadPool == null) {
      sImageFetchThreadPool=Executors.newFixedThreadPool(3);
    }
    sImageFetchThreadPool.execute(mImageFetcher);
  }
}

Fixed version (ground truth):
private void sendFetchImageMessage(ImageView view){
  final PhotoInfo info=(PhotoInfo)view.getTag();
  if (info == null) {
    return;
  }
  final long photoId=info.photoId;
  if (photoId == 0) {
    return;
  }
  mImageFetcher=new ImageDbFetcher(photoId,view);
synchronized (ContactsListActivity.this) {
    if (sImageFetchThreadPool == null) {
      sImageFetchThreadPool=Executors.newFixedThreadPool(1);
    }
    sImageFetchThreadPool.execute(mImageFetcher);
  }
}
Program: 7304
Project: 7304
Buggy source:
private void sendFetchImageMessage(ImageView view){
  final PhotoInfo info=(PhotoInfo)view.getTag();
  if (info == null) {
    return;
  }
  final long photoId=info.photoId;
  if (photoId == 0) {
    return;
  }
  mImageFetcher=new ImageDbFetcher(photoId,view);
synchronized (ContactsListActivity.this) {
    if (sImageFetchThreadPool == null) {
      sImageFetchThreadPool=Executors.newFixedThreadPool(3);
    }
    sImageFetchThreadPool.execute(mImageFetcher);
  }
}

Fixed version (ground truth):
private void sendFetchImageMessage(ImageView view){
  final PhotoInfo info=(PhotoInfo)view.getTag();
  if (info == null) {
    return;
  }
  final long photoId=info.photoId;
  if (photoId == 0) {
    return;
  }
  mImageFetcher=new ImageDbFetcher(photoId,view);
synchronized (ContactsListActivity.this) {
    if (sImageFetchThreadPool == null) {
      sImageFetchThreadPool=Executors.newFixedThreadPool(1);
    }
    sImageFetchThreadPool.execute(mImageFetcher);
  }
}
Program: 7305
Project: 7305
Buggy source:
/** 
 * @return true if the widget with the phone number digits is empty.
 */
private boolean isDigitsEmpty(){
  return mDigits.length() != 0;
}

Fixed version (ground truth):
/** 
 * @return true if the widget with the phone number digits is empty.
 */
private boolean isDigitsEmpty(){
  return mDigits.length() == 0;
}
Program: 7306
Project: 7306
Buggy source:
/** 
 * Set the visibility of secondary sections, along with header icon. <p>If the source is read-only and there's no secondary fields, the entire secondary section will be hidden.
 */
private void setSecondaryVisible(boolean makeVisible){
  mSecondaryVisible=makeVisible;
  if (!mIsSourceReadOnly && mSecondary.getChildCount() > 0) {
    mSecondary.setVisibility(makeVisible ? View.VISIBLE : View.GONE);
    mSecondaryHeader.setCompoundDrawablesWithIntrinsicBounds(makeVisible ? mSecondaryOpen : mSecondaryClosed,null,null,null);
  }
 else {
    mSecondaryHeader.setVisibility(View.GONE);
    mSecondary.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
/** 
 * Set the visibility of secondary sections, along with header icon. <p>If the source is read-only and there's no secondary fields, the entire secondary section will be hidden.
 */
private void setSecondaryVisible(boolean makeVisible){
  mSecondaryVisible=makeVisible;
  if (!mIsSourceReadOnly && mSecondary.getChildCount() > 0) {
    mSecondaryHeader.setVisibility(View.VISIBLE);
    mSecondaryHeader.setCompoundDrawablesWithIntrinsicBounds(makeVisible ? mSecondaryOpen : mSecondaryClosed,null,null,null);
    mSecondary.setVisibility(makeVisible ? View.VISIBLE : View.GONE);
  }
 else {
    mSecondaryHeader.setVisibility(View.GONE);
    mSecondary.setVisibility(View.GONE);
  }
}