nus-yam/ex-repair huggingface dataset:
Program: 59416
Project: 59416
Buggy source:
/** 
 * Read the values of GvNIXRelationsPattern and for each field defined as relation retrieve its java type.
 * @param mid Metadata identification string
 * @param controller Controller physical type metadata
 * @param entity Entity java type
 * @param webMetadataService Web metadata service
 * @return Map with java types and java type details
 */
private List<JavaType> getRelationFields(String mid,PhysicalTypeMetadata controller,JavaType entity,WebMetadataService webMetadataService){
  Set<String> relations=_patternService.getRelationsFields(controller);
  List<FieldMetadata> scaffoldFields=getScaffoldEligibleFields(entity,mid,webMetadataService);
  List<JavaType> validFields=new ArrayList<JavaType>();
  for (  FieldMetadata scaffoldEligibleField : scaffoldFields) {
    if (relations.contains(scaffoldEligibleField.getFieldName().getSymbolName())) {
      JavaType validField=scaffoldEligibleField.getFieldType();
      if (validField.isCommonCollectionType() && !validField.getParameters().isEmpty()) {
        validField=validField.getParameters().get(0);
      }
      validFields.add(validField);
    }
  }
  return validFields;
}

Fixed version (ground truth):
/** 
 * Read the values of GvNIXRelationsPattern and for each field defined as relation retrieve its java type.
 * @param mid Metadata identification string
 * @param controller Controller physical type metadata
 * @param entity Entity java type
 * @param webMetadataService Web metadata service
 * @return Map with java types and java type details
 */
private List<JavaType> getRelationFields(String mid,PhysicalTypeMetadata controller,JavaType entity,WebMetadataService webMetadataService){
  List<String> relations=_patternService.getControllerRelationsPatternsFields(controller);
  List<FieldMetadata> scaffoldFields=getScaffoldEligibleFields(entity,mid,webMetadataService);
  List<JavaType> validFields=new ArrayList<JavaType>();
  for (  FieldMetadata scaffoldEligibleField : scaffoldFields) {
    if (relations.contains(scaffoldEligibleField.getFieldName().getSymbolName())) {
      JavaType validField=scaffoldEligibleField.getFieldType();
      if (validField.isCommonCollectionType() && !validField.getParameters().isEmpty()) {
        validField=validField.getParameters().get(0);
      }
      validFields.add(validField);
    }
  }
  return validFields;
}
Program: 59418
Project: 59418
Buggy source:
/** 
 * Disables Roo MenuOperationsImpl service. <p> <em>IMPORTANT:</em> OSGi container will inject gvNIX MenuOperationsImpl service to clients.
 */
protected void disableRooMenuOperations(){
  logger.fine("String_Node_Str");
  ServiceReference rooServiceRef=componentContext.getBundleContext().getServiceReference(MenuOperations.class.getName());
  Long componentId=(Long)rooServiceRef.getProperty("String_Node_Str");
  try {
    executeFelixCommand("String_Node_Str".concat(componentId.toString()));
  }
 catch (  Exception e) {
    throw new IllegalStateException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void disableRooMenuOperations(){
  logger.fine("String_Node_Str");
  ServiceReference rooServiceRef=componentContext.getBundleContext().getServiceReference(MenuOperations.class.getName());
  Long componentId=(Long)rooServiceRef.getProperty("String_Node_Str");
  try {
    executeFelixCommand("String_Node_Str".concat(componentId.toString()));
  }
 catch (  Exception e) {
    throw new IllegalStateException("String_Node_Str",e);
  }
}
Program: 59419
Project: 59419
Buggy source:
/** 
 * {@inheritDoc} 
 */
protected void activate(ComponentContext context){
  componentContext=context;
  if (isGvNixMenuAvailable()) {
    disableRooMenuOperations();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
protected void activate(ComponentContext context){
  componentContext=context;
}
Program: 59421
Project: 59421
Buggy source:
/** 
 * <p> Generates file names for certificate file to copy into project resource folder until it find a unused one. </p> <p> The first try is <code>{target-folder}/{certificate_fileName}</code> </p> <p> Pattern: <code>{target-folder}/{certificate_name}_{counter}.{certificate_extension}</code> </p>
 * @param certificate
 * @param importedServiceClass
 * @return
 */
private File computeCertificateTargetName(File certificate,JavaType importedServiceClass){
  String certificateName=certificate.getName();
  String extension=certificateName.substring(certificateName.lastIndexOf('.'),certificateName.length());
  certificateName=certificateName.substring(0,certificateName.lastIndexOf('.'));
  String targetPath=WSServiceSecurityMetadata.getCertificatePath(importedServiceClass,certificate.getName());
  targetPath=projectOperations.getPathResolver().getIdentifier(Path.SRC_MAIN_RESOURCES,targetPath);
  int index=1;
  String baseNamePath=targetPath.replace(certificate.getName(),"String_Node_Str");
  while (fileManager.exists(targetPath)) {
    targetPath=baseNamePath.concat(certificateName).concat("String_Node_Str" + index).concat(extension);
    targetPath=projectOperations.getPathResolver().getIdentifier(Path.SRC_MAIN_RESOURCES,targetPath);
    index++;
  }
  return new File(targetPath);
}

Fixed version (ground truth):
/** 
 * <p> Generates file names for certificate file to copy into project resource folder until it find a unused one. </p> <p> The first try is <code>{target-folder}/{certificate_fileName}</code> </p> <p> Pattern: <code>{target-folder}/{certificate_name}_{counter}.{certificate_extension}</code> </p>
 * @param certificate
 * @param importedServiceClass
 * @return
 */
private File computeCertificateTargetName(File certificate,JavaType importedServiceClass){
  String certificateName=certificate.getName();
  String extension=certificateName.substring(certificateName.lastIndexOf('.'),certificateName.length());
  certificateName=certificateName.substring(0,certificateName.lastIndexOf('.'));
  String targetPath=WSServiceSecurityMetadata.getCertificatePath(importedServiceClass,certificate.getName());
  String baseNamePath=targetPath.replace(certificate.getName(),"String_Node_Str");
  targetPath=projectOperations.getPathResolver().getIdentifier(Path.SRC_MAIN_RESOURCES,targetPath);
  int index=1;
  while (fileManager.exists(targetPath)) {
    targetPath=baseNamePath.concat(certificateName).concat("String_Node_Str" + index).concat(extension);
    targetPath=projectOperations.getPathResolver().getIdentifier(Path.SRC_MAIN_RESOURCES,targetPath);
    index++;
  }
  return new File(targetPath);
}
Program: 59422
Project: 59422
Buggy source:
void draw(SpriteBatch batch,BitmapFont font){
  if (drawResource) {
    batch.draw(Assets.copperOre,x,y,width,height);
    if (closeEnough() && Player.move) {
      font.draw(batch,"String_Node_Str",50,50);
    }
  }
}

Fixed version (ground truth):
void draw(SpriteBatch batch,BitmapFont font){
  if (drawResource) {
    batch.draw(Assets.copperOre,x,y,width,height);
    if (closeEnough() && Player.ableToMove) {
      font.draw(batch,"String_Node_Str",50,50);
    }
  }
}
Program: 59423
Project: 59423
Buggy source:
void input(){
  if (Gdx.input.isKeyPressed(Keys.ESCAPE)) {
    Player.move=true;
    inventoryVisible=false;
  }
}

Fixed version (ground truth):
void input(){
  if (Gdx.input.isKeyPressed(Keys.ESCAPE)) {
    Player.ableToMove=true;
    inventoryVisible=false;
  }
}
Program: 59424
Project: 59424
Buggy source:
void draw(SpriteBatch batch,BitmapFont font){
  if (inventoryVisible) {
    batch.draw(Assets.inventory,0,0);
    Player.move=false;
    font.draw(batch,Tree.amountOfWoodString,350,290);
    font.draw(batch,Fishing.amountOfFishString,350,225);
  }
}

Fixed version (ground truth):
void draw(SpriteBatch batch,BitmapFont font){
  if (inventoryVisible) {
    batch.draw(Assets.inventory,0,0);
    Player.ableToMove=false;
    font.draw(batch,Tree.amountOfWoodString,350,290);
    font.draw(batch,Fishing.amountOfFishString,350,225);
  }
}
Program: 59425
Project: 59425
Buggy source:
void draw(SpriteBatch batch,BitmapFont font){
  if (drawResource) {
    batch.draw(Assets.ironOre,x,y,width,height);
    if (closeEnough() && Player.move) {
      font.draw(batch,"String_Node_Str",50,50);
    }
  }
}

Fixed version (ground truth):
void draw(SpriteBatch batch,BitmapFont font){
  if (drawResource) {
    batch.draw(Assets.ironOre,x,y,width,height);
    if (closeEnough() && Player.ableToMove) {
      font.draw(batch,"String_Node_Str",50,50);
    }
  }
}
Program: 59426
Project: 59426
Buggy source:
void input(){
  if (move) {
    if (!House.inHouse) {
      if (((Gdx.input.isKeyPressed(Keys.W)) || Android.up) && isAbleToMoveUp) {
        up=true;
        currentDirection=1;
      }
 else       up=false;
      if (((Gdx.input.isKeyPressed(Keys.A)) || Android.left) && isAbleToMoveLeft) {
        left=true;
        currentDirection=2;
      }
 else       left=false;
      if (((Gdx.input.isKeyPressed(Keys.S)) || Android.down) && isAbleToMoveDown) {
        currentDirection=0;
        down=true;
      }
 else       down=false;
      if (((Gdx.input.isKeyPressed(Keys.D)) || Android.right) && isAbleToMoveRight) {
        right=true;
        currentDirection=3;
      }
 else       right=false;
    }
 else {
      if ((Gdx.input.isKeyPressed(Keys.W))) {
        y+=playerSpeed;
        up=true;
      }
 else       up=false;
      if ((Gdx.input.isKeyPressed(Keys.A))) {
        x-=playerSpeed;
        left=true;
      }
 else       left=false;
      if ((Gdx.input.isKeyPressed(Keys.S))) {
        y-=playerSpeed;
        down=true;
      }
 else       down=false;
      if ((Gdx.input.isKeyPressed(Keys.D))) {
        x+=playerSpeed;
        right=true;
      }
 else       right=false;
    }
  }
}

Fixed version (ground truth):
void input(){
  if (ableToMove) {
    if (!House.inHouse) {
      if (((Gdx.input.isKeyPressed(Keys.W)) || Android.up) && isAbleToMoveUp) {
        up=true;
        currentDirection=1;
      }
 else       up=false;
      if (((Gdx.input.isKeyPressed(Keys.A)) || Android.left) && isAbleToMoveLeft) {
        left=true;
        currentDirection=2;
      }
 else       left=false;
      if (((Gdx.input.isKeyPressed(Keys.S)) || Android.down) && isAbleToMoveDown) {
        currentDirection=0;
        down=true;
      }
 else       down=false;
      if (((Gdx.input.isKeyPressed(Keys.D)) || Android.right) && isAbleToMoveRight) {
        right=true;
        currentDirection=3;
      }
 else       right=false;
    }
 else {
      if ((Gdx.input.isKeyPressed(Keys.W))) {
        y+=playerSpeed;
        up=true;
      }
 else       up=false;
      if ((Gdx.input.isKeyPressed(Keys.A))) {
        x-=playerSpeed;
        left=true;
      }
 else       left=false;
      if ((Gdx.input.isKeyPressed(Keys.S))) {
        y-=playerSpeed;
        down=true;
      }
 else       down=false;
      if ((Gdx.input.isKeyPressed(Keys.D))) {
        x+=playerSpeed;
        right=true;
      }
 else       right=false;
    }
  }
  if (Gdx.input.isButtonPressed(Keys.SHIFT_LEFT)) {
    playerSpeed=4;
  }
 else   playerSpeed=2;
}
Program: 59427
Project: 59427
Buggy source:
void move(){
  if (move) {
    if (up) {
      GameScreen.yRate=(playerSpeed);
      y+=playerSpeed;
      Level.grassY-=playerSpeed;
    }
 else     if (down) {
      GameScreen.yRate=-playerSpeed;
      y-=playerSpeed;
      Level.grassY+=playerSpeed;
    }
 else {
      GameScreen.yRate=0;
    }
    if (left) {
      GameScreen.xRate=-playerSpeed;
      x-=playerSpeed;
      Level.grassX+=playerSpeed;
    }
 else     if (right) {
      GameScreen.xRate=(playerSpeed);
      x+=playerSpeed;
      Level.grassX-=playerSpeed;
    }
 else {
      GameScreen.xRate=0;
    }
  }
}

Fixed version (ground truth):
void move(){
  if (ableToMove) {
    if (up) {
      GameScreen.yRate=(playerSpeed);
      y+=playerSpeed;
      Level.grassY-=playerSpeed;
    }
 else     if (down) {
      GameScreen.yRate=-playerSpeed;
      y-=playerSpeed;
      Level.grassY+=playerSpeed;
    }
 else {
      GameScreen.yRate=0;
    }
    if (left) {
      GameScreen.xRate=-playerSpeed;
      x-=playerSpeed;
      Level.grassX+=playerSpeed;
    }
 else     if (right) {
      GameScreen.xRate=(playerSpeed);
      x+=playerSpeed;
      Level.grassX-=playerSpeed;
    }
 else {
      GameScreen.xRate=0;
    }
  }
 else {
    GameScreen.yRate=0;
    GameScreen.xRate=0;
  }
}
Program: 59428
Project: 59428
Buggy source:
void draw(SpriteBatch batch,BitmapFont font){
  if (move)   batch.draw(Assets.mainChar,x,y);
}

Fixed version (ground truth):
void draw(SpriteBatch batch,BitmapFont font){
  if (ableToMove)   batch.draw(Assets.mainChar,x,y);
}
Program: 59429
Project: 59429
Buggy source:
void draw(SpriteBatch batch,BitmapFont font){
  if (drawResource) {
    batch.draw(Assets.material,x,y,width,height);
    if (closeEnough() && Player.move) {
      if (Gdx.app.getType() == ApplicationType.Android) {
        font.draw(batch,"String_Node_Str",Android.size + 10,50);
      }
 else       font.draw(batch,"String_Node_Str",50,50);
    }
  }
}

Fixed version (ground truth):
void draw(SpriteBatch batch,BitmapFont font){
  if (drawResource) {
    batch.draw(Assets.material,x,y,width,height);
    if (closeEnough() && Player.ableToMove) {
      if (Gdx.app.getType() == ApplicationType.Android) {
        font.draw(batch,"String_Node_Str",Android.size + 10,50);
      }
 else       font.draw(batch,"String_Node_Str",50,50);
    }
  }
}
Program: 59430
Project: 59430
Buggy source:
void gui(){
  robotTimer+=Gdx.graphics.getDeltaTime();
  if (robotTimer > 60) {
    robotResources+=1;
    robotTimer=0;
  }
  amountOfStoneString=Integer.toString(robotResources);
  if (bot.closeEnough() && Gdx.input.isKeyPressed(Keys.L)) {
    menuOpen=true;
  }
  if (menuOpen) {
    Player.move=false;
    if (Gdx.input.isKeyPressed(Keys.ESCAPE)) {
      Player.move=true;
      menuOpen=false;
    }
    if (Gdx.input.getX() > 406 && Gdx.input.getX() < 559 && Gdx.input.getY() > 406 && Gdx.input.getY() < 478) {
      if (Gdx.input.isTouched()) {
        Resource.amountOfStone+=robotResources;
        robotResources=0;
      }
    }
  }
}

Fixed version (ground truth):
void gui(){
  robotTimer+=Gdx.graphics.getDeltaTime();
  if (robotTimer > 60) {
    robotResources+=1;
    robotTimer=0;
  }
  amountOfStoneString=Integer.toString(robotResources);
  if (bot.closeEnough() && Gdx.input.isKeyPressed(Keys.L)) {
    menuOpen=true;
  }
  if (menuOpen) {
    Player.ableToMove=false;
    if (Gdx.input.isKeyPressed(Keys.ESCAPE)) {
      Player.ableToMove=true;
      menuOpen=false;
    }
    if (Gdx.input.getX() > 406 && Gdx.input.getX() < 559 && Gdx.input.getY() > 406 && Gdx.input.getY() < 478) {
      if (Gdx.input.isTouched()) {
        Resource.amountOfStone+=robotResources;
        robotResources=0;
      }
    }
  }
}
Program: 59431
Project: 59431
Buggy source:
void update(){
  timer+=Gdx.graphics.getDeltaTime();
  if (Tutorial.step == 4 && closeEnough()) {
    timer=0;
    Tutorial.step=5;
  }
  if (Tutorial.step == 6 && closeEnough()) {
    timer=0;
    Tutorial.step=7;
  }
}

Fixed version (ground truth):
void update(){
  timer+=Gdx.graphics.getDeltaTime();
  if (Tutorial.step == 4 && closeEnough()) {
    timer=0;
    TradeShop.cash-=50;
    Tutorial.step=5;
  }
  if (Tutorial.step == 6 && closeEnough()) {
    timer=0;
    Tutorial.step=7;
  }
}
Program: 59432
Project: 59432
Buggy source:
void update(){
  timer+=Gdx.graphics.getDeltaTime();
  if (Fishing.amountOfFish >= 5 && Tutorial.step == 2) {
    Tutorial.step=3;
  }
  if (cash >= 50 && Tutorial.step == 3) {
    Tutorial.step=4;
  }
}

Fixed version (ground truth):
void update(){
  timer+=Gdx.graphics.getDeltaTime();
  if (Fishing.amountOfFish >= 5 && Tutorial.step == 2) {
    Tutorial.step=3;
  }
  if (cash >= 50 && Tutorial.step == 3) {
    Fishing.amountOfFish-=5;
    Tutorial.step=4;
  }
}
Program: 59433
Project: 59433
Buggy source:
void handleInput(){
  if (Tutorial.step == 3 && closeEnough()) {
    if (Gdx.input.getX() > 785 && Gdx.input.getX() < 836 && Gdx.input.getY() > 470 && Gdx.input.getY() < 515 && Gdx.input.isTouched()) {
      Messages.messagesArray.add(new Message("String_Node_Str",Messages.sec));
      timer=0;
      Tutorial.step+=1;
    }
  }
}

Fixed version (ground truth):
void handleInput(){
  if (Tutorial.step == 3 && closeEnough()) {
    if (Gdx.input.getX() > 785 && Gdx.input.getX() < 836 && Gdx.input.getY() > 470 && Gdx.input.getY() < 515 && Gdx.input.isTouched()) {
      Messages.messagesArray.add(new Message("String_Node_Str",Messages.sec));
      timer=0;
      cash-=50;
      Tutorial.step+=1;
    }
  }
}
Program: 59434
Project: 59434
Buggy source:
void draw(SpriteBatch batch,BitmapFont font){
  root.setX(x);
  root.setY(y);
  leaveRoot.setX(x);
  leaveRoot.setY(y);
  renderer.draw(batch,leavesSkel);
  renderer.draw(batch,treeSkel);
  if (closeEnough() && Player.move && !treeDone)   font.draw(batch,"String_Node_Str",50,50);
  treeSkel.updateWorldTransform();
  leavesSkel.updateWorldTransform();
}

Fixed version (ground truth):
void draw(SpriteBatch batch,BitmapFont font){
  root.setX(x);
  root.setY(y);
  leaveRoot.setX(x);
  leaveRoot.setY(y);
  renderer.draw(batch,leavesSkel);
  renderer.draw(batch,treeSkel);
  if (closeEnough() && Player.ableToMove && !treeDone)   font.draw(batch,"String_Node_Str",50,50);
  treeSkel.updateWorldTransform();
  leavesSkel.updateWorldTransform();
}
Program: 59436
Project: 59436
Buggy source:
public GameScreen(Game game){
  this.game=game;
  float w=Gdx.graphics.getWidth();
  float h=Gdx.graphics.getHeight();
  batch=new SpriteBatch();
  camera=new OrthographicCamera(w,h);
  mapCamera=new OrthographicCamera(w,h);
  camera.update();
  mapCamera.update();
  mapRenderer=new OrthogonalTiledMapRenderer(Assets.mainTiledMap,batch);
  camera.translate(w / 2,h / 2);
  mapCamera.translate(1422 + 16,3562 + 24);
  shapeRenderer=new ShapeRenderer();
  level=new Level();
  player=new Player();
  resource=new Resource();
  arrays=new ArrayListsz();
  topMenu=new TopMenu();
  iron=new Iron();
  inv=new Inventory();
  fps=new FPSLogger();
  android=new Android();
  points=new Points();
  collision=new CollisionDetection();
  message=new Messages();
  swordShop=new SwordShop();
  fishing=new Fishing();
  trade=new TradeShop();
  arrays.treeArrayEstablisher();
  if (Gdx.app.getType() == ApplicationType.Android) {
    currentFont=Assets.cgfFont;
  }
 else   currentFont=new BitmapFont();
  world=new World(new Vector2(0,0),true);
  rayHandler=new RayHandler(world);
  rayHandler.setCombinedMatrix(mapCamera.combined);
  Time.createLights(rayHandler);
}

Fixed version (ground truth):
public GameScreen(Game game){
  this.game=game;
  float w=Gdx.graphics.getWidth();
  float h=Gdx.graphics.getHeight();
  batch=new SpriteBatch();
  camera=new OrthographicCamera(w,h);
  mapCamera=new OrthographicCamera(w,h);
  camera.update();
  mapCamera.update();
  mapRenderer=new OrthogonalTiledMapRenderer(Assets.mainTiledMap,batch);
  camera.translate(w / 2,h / 2);
  mapCamera.translate(1422 + 16,3562 + 24);
  shapeRenderer=new ShapeRenderer();
  level=new Level();
  player=new Player();
  resource=new Resource();
  arrays=new ArrayListsz();
  topMenu=new TopMenu();
  iron=new Iron();
  inv=new Inventory();
  fps=new FPSLogger();
  android=new Android();
  points=new Points();
  collision=new CollisionDetection();
  message=new Messages();
  swordShop=new SwordShop();
  fishing=new Fishing();
  trade=new TradeShop();
  arrays.treeArrayEstablisher();
  if (Gdx.app.getType() == ApplicationType.Android) {
    currentFont=Assets.cgfFont;
  }
 else   currentFont=new BitmapFont();
  world=new World(new Vector2(0,0),true);
  rayHandler=new RayHandler(world);
  Time.createLights(rayHandler);
}
Program: 59437
Project: 59437
Buggy source:
public void draw(float deltaTime){
  Gdx.gl.glClearColor(255f,255f,255f,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  batch.begin();
  batch.setProjectionMatrix(camera.combined);
  level.draw(batch);
  batch.end();
  batch.setProjectionMatrix(mapCamera.combined);
  mapCamera.translate(xRate,yRate);
  mapCamera.update();
  mapRenderer.setView(mapCamera);
  mapRenderer.render();
  batch.begin();
  batch.setProjectionMatrix(mapCamera.combined);
  swordShop.draw(batch);
  trade.draw(batch);
  arrays.drawTreeTrunk(batch);
  player.draw(batch,currentFont);
  arrays.drawBrush(batch,currentFont);
  batch.end();
  rayHandler.updateAndRender();
  batch.begin();
  batch.setProjectionMatrix(camera.combined);
  player.drawTools(batch);
  topMenu.draw(batch,currentFont);
  player.drawTools(batch);
  points.draw(batch);
  message.drawText(currentFont,batch);
  inv.draw(batch,currentFont);
  swordShop.drawInputText(batch,currentFont);
  trade.drawInputText(batch,currentFont);
  batch.end();
  points.drawBars(shapeRenderer);
}

Fixed version (ground truth):
public void draw(float deltaTime){
  Gdx.gl.glClearColor(255f,255f,255f,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  batch.begin();
  batch.setProjectionMatrix(camera.combined);
  level.draw(batch);
  batch.end();
  batch.setProjectionMatrix(mapCamera.combined);
  mapCamera.translate(xRate,yRate);
  mapCamera.update();
  mapRenderer.setView(mapCamera);
  mapRenderer.render();
  batch.begin();
  batch.setProjectionMatrix(mapCamera.combined);
  swordShop.draw(batch);
  trade.draw(batch);
  arrays.drawTreeTrunk(batch);
  player.draw(batch,currentFont);
  batch.setProjectionMatrix(camera.combined);
  player.drawCurrent(batch);
  batch.setProjectionMatrix(mapCamera.combined);
  arrays.drawBrush(batch,currentFont);
  batch.end();
  rayHandler.setCombinedMatrix(mapCamera.combined);
  rayHandler.updateAndRender();
  batch.begin();
  batch.setProjectionMatrix(camera.combined);
  player.drawTools(batch);
  topMenu.draw(batch,currentFont);
  player.drawTools(batch);
  points.draw(batch);
  message.drawText(currentFont,batch);
  inv.draw(batch,currentFont);
  swordShop.drawInputText(batch,currentFont);
  trade.drawInputText(batch,currentFont);
  batch.end();
  shapeRenderer.setProjectionMatrix(camera.combined);
  points.drawBars(shapeRenderer);
}
Program: 59438
Project: 59438
Buggy source:
private void handleInput(){
  if (Gdx.input.isKeyPressed(Input.Keys.O)) {
    camera.zoom+=0.02;
    mapCamera.zoom+=0.02;
  }
  if (Gdx.input.isKeyPressed(Input.Keys.I)) {
    camera.zoom-=0.02;
    mapCamera.zoom-=0.02;
  }
}

Fixed version (ground truth):
/** 
 * Handle input for zooming in and out 
 */
private void handleInput(){
  if (Gdx.input.isKeyPressed(Input.Keys.O)) {
    camera.zoom+=0.02;
    mapCamera.zoom+=0.02;
  }
  if (Gdx.input.isKeyPressed(Input.Keys.I)) {
    camera.zoom-=0.02;
    mapCamera.zoom-=0.02;
  }
  if (Gdx.input.isKeyPressed(Input.Keys.U)) {
    camera.zoom=1;
    mapCamera.zoom=1;
  }
}
Program: 59439
Project: 59439
Buggy source:
public static void update(RayHandler rayHandler){
  timeOfDay+=Gdx.graphics.getDeltaTime();
  if (timeOfDay > 840)   timeOfDay=0;
  sunset();
  sunrise();
  rayHandler.setAmbientLight(getAmbientLight());
}

Fixed version (ground truth):
public static void update(RayHandler rayHandler){
  timeOfDay+=Gdx.graphics.getDeltaTime();
  if (timeOfDay > 840)   timeOfDay=0;
  sunset();
  sunrise();
  rayHandler.setAmbientLight(getAmbientLight());
  if (isNight() || isDay()) {
    lightColor.set(255,237,138,colorAlpha);
    for (int i=0; i < pointLights.size; i++) {
      pointLights.get(i).setColor(lightColor);
    }
  }
}
Program: 59440
Project: 59440
Buggy source:
void draw(SpriteBatch batch){
  if (Tutorial.step >= 7) {
    batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (3 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,70,70);
  }
  batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (0 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,50,50);
  if (Tutorial.step >= 5) {
    batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (2 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,50,50);
  }
  if (Tutorial.step >= 2) {
    batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (1 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,80,80);
  }
  if ((Player.currentDirection == 2 || Player.currentDirection == 3) && !(TopMenu.currentTool == 5) && !(TopMenu.currentTool == 4)) {
    if (Gdx.input.isKeyPressed(Keys.B)) {
      isTooling=true;
      renderer.draw(batch,toolSkel);
    }
 else {
      isTooling=false;
    }
  }
}

Fixed version (ground truth):
void draw(SpriteBatch batch){
  if (Tutorial.step >= 7) {
    batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (3 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,70,70);
  }
  batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (0 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,50,50);
  if (Tutorial.step >= 5) {
    batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (2 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,50,50);
  }
  if (Tutorial.step >= 2) {
    batch.draw(Assets.toolsMasterAtlas.findRegion("String_Node_Str"),(startOfTopBar + (1 * boxWidth)) + toolX,Gdx.graphics.getHeight() - toolY,80,80);
  }
}
Program: 59441
Project: 59441
Buggy source:
/** 
 * Scans class for JPA annotations and determines the access type. If no JPA access type can be figured, defaults to AccessType.PROPERTY.
 * @param clazz
 * @return @Nonnull
 */
private AccessType determineAccessType(final Class<?> clazz){
  final Access access=clazz.getAnnotation(Access.class);
  if (access != null) {
    return access.value();
  }
  for (  Method m : clazz.getMethods()) {
    if (Modifier.isStatic(m.getModifiers())) {
      continue;
    }
    String methodName=m.getName();
    if (methodName.startsWith("String_Node_Str") && methodName.length() > 3 && m.getParameterTypes().length == 0) {
      if (m.getAnnotation(Id.class) != null) {
        return AccessType.PROPERTY;
      }
    }
  }
  for (Class<?> c=clazz; c != null; c=c.getSuperclass()) {
    for (    Field f : c.getDeclaredFields()) {
      if (Modifier.isStatic(f.getModifiers()) || Modifier.isFinal(f.getModifiers())) {
        continue;
      }
      if (f.getAnnotation(Id.class) != null) {
        return AccessType.FIELD;
      }
    }
  }
  return AccessType.PROPERTY;
}

Fixed version (ground truth):
/** 
 * Scans class for JPA annotations and determines the access type. If no JPA access type can be figured, defaults to AccessType.PROPERTY.
 * @param clazz
 * @return @Nonnull
 */
private AccessType determineAccessType(final Class<?> clazz){
  final Access access=clazz.getAnnotation(Access.class);
  if (access != null) {
    return access.value();
  }
  for (  Method m : clazz.getMethods()) {
    if (Modifier.isStatic(m.getModifiers())) {
      continue;
    }
    String methodName=m.getName();
    if ((methodName.startsWith("String_Node_Str") && methodName.length() > 3 && m.getParameterTypes().length == 0) || (methodName.startsWith("String_Node_Str") && methodName.length() > 2 && m.getParameterTypes().length == 0)) {
      if (m.getAnnotation(Id.class) != null) {
        return AccessType.PROPERTY;
      }
    }
  }
  for (Class<?> c=clazz; c != null; c=c.getSuperclass()) {
    for (    Field f : c.getDeclaredFields()) {
      if (Modifier.isStatic(f.getModifiers()) || Modifier.isFinal(f.getModifiers())) {
        continue;
      }
      if (f.getAnnotation(Id.class) != null) {
        return AccessType.FIELD;
      }
    }
  }
  return AccessType.PROPERTY;
}
Program: 59442
Project: 59442
Buggy source:
/** 
 * Get a list of recent trades.
 * @see http://www.reddit.com/r/Bitcoin/comments/1qteyu/any_apis_for_chinese_exchanges/
 * @param since_micros The GMT-relative epoch in microseconds.
 * @param currencyPair The currency pair to query.
 * @return The trades as a list of Trade objects.
 * @throws TradeDataNotAvailableException if the ticker is not available.
 */
public CryptoCoinTrade[] getTrades(long since_micros,CurrencyPair currencyPair) throws TradeDataNotAvailableException {
  if (!isSupportedCurrencyPair(currencyPair)) {
    throw new CurrencyNotSupportedException("String_Node_Str" + currencyPair.toString() + "String_Node_Str"+ this._name);
  }
  String url="String_Node_Str" + "String_Node_Str" + DOMAIN + "String_Node_Str"+ getBtcChinaCurrencyPairName(currencyPair);
  throw new NotYetImplementedException("String_Node_Str" + this._name);
}

Fixed version (ground truth):
/** 
 * Get a list of recent trades.
 * @see http://www.reddit.com/r/Bitcoin/comments/1qteyu/any_apis_for_chinese_exchanges/
 * @param since_micros The GMT-relative epoch in microseconds.
 * @param currencyPair The currency pair to query.
 * @return The trades as a list of Trade objects.
 * @throws TradeDataNotAvailableException if the trades are not available.
 */
public CryptoCoinTrade[] getTrades(long since_micros,CurrencyPair currencyPair) throws TradeDataNotAvailableException {
  if (!isSupportedCurrencyPair(currencyPair)) {
    throw new CurrencyNotSupportedException("String_Node_Str" + currencyPair.toString() + "String_Node_Str"+ this._name);
  }
  String url="String_Node_Str" + "String_Node_Str" + DOMAIN + "String_Node_Str"+ getBtcChinaCurrencyPairName(currencyPair);
  throw new NotYetImplementedException("String_Node_Str" + this._name);
}
Program: 59443
Project: 59443
Buggy source:
/** 
 * Create a new btcchina.com depth object from the JSON response from the server.
 * @param jsonResponse The jsonResponse from the btc-e.com server.
 * @param currencyPair The currency pair, that was queried.
 * @param tradeSite The trade site, that delivered the data.
 */
public BtcChinaDepth(JSONObject jsonResponse,CurrencyPair currencyPair,TradeSite tradeSite){
  super(currencyPair,tradeSite);
  parseJSONDepthArrays(jsonResponse);
}

Fixed version (ground truth):
/** 
 * Create a new btcchina.com depth object from the JSON response from the server.
 * @param jsonResponse The jsonResponse from the server.
 * @param currencyPair The currency pair, that was queried.
 * @param tradeSite The trade site, that delivered the data.
 */
public BtcChinaDepth(JSONObject jsonResponse,CurrencyPair currencyPair,TradeSite tradeSite){
  super(currencyPair,tradeSite);
  parseJSONDepthArrays(jsonResponse);
}
Program: 59446
Project: 59446
Buggy source:
/** 
 * Get the market depth as a Depth object.
 * @param currencyPair The queried currency pair.
 * @throws TradeDataNotAvailableException if the depth is not available.
 */
public Depth getDepth(CurrencyPair currencyPair) throws TradeDataNotAvailableException {
  if (!isSupportedCurrencyPair(currencyPair)) {
    throw new CurrencyNotSupportedException("String_Node_Str" + currencyPair.toString() + "String_Node_Str"+ _name);
  }
  String url=_url + "String_Node_Str" + currencyPair.getPaymentCurrency().getName()+ "String_Node_Str"+ currencyPair.getCurrency().getName()+ "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    try {
      JSONObject jsonResult=JSONObject.fromObject(requestResult);
      boolean successFlag=jsonResult.getBoolean("String_Node_Str");
      if (successFlag) {
        return new BittrexDepth(jsonResult.getJSONObject("String_Node_Str"),currencyPair,this);
      }
 else {
        LogUtils.getInstance().getLogger().error("String_Node_Str" + _name + "String_Node_Str"+ currencyPair.toString()+ "String_Node_Str"+ jsonResult.getString("String_Node_Str"));
        return null;
      }
    }
 catch (    JSONException je) {
      System.err.println("String_Node_Str" + this._name + "String_Node_Str"+ je.toString());
      throw new TradeDataNotAvailableException("String_Node_Str" + this._name);
    }
  }
  throw new TradeDataNotAvailableException(this._name + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get the market depth as a Depth object.
 * @param currencyPair The queried currency pair.
 * @throws TradeDataNotAvailableException if the depth is not available.
 */
public Depth getDepth(CurrencyPair currencyPair) throws TradeDataNotAvailableException {
  if (!isSupportedCurrencyPair(currencyPair)) {
    throw new CurrencyNotSupportedException("String_Node_Str" + currencyPair.toString() + "String_Node_Str"+ _name);
  }
  String url=_url + "String_Node_Str" + currencyPair.getPaymentCurrency().toString()+ "String_Node_Str"+ currencyPair.getCurrency().toString()+ "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    try {
      JSONObject jsonResult=JSONObject.fromObject(requestResult);
      boolean successFlag=jsonResult.getBoolean("String_Node_Str");
      if (successFlag) {
        return new BittrexDepth(jsonResult.getJSONObject("String_Node_Str"),currencyPair,this);
      }
 else {
        LogUtils.getInstance().getLogger().error("String_Node_Str" + _name + "String_Node_Str"+ currencyPair.toString()+ "String_Node_Str"+ jsonResult.getString("String_Node_Str"));
        return null;
      }
    }
 catch (    JSONException je) {
      System.err.println("String_Node_Str" + this._name + "String_Node_Str"+ je.toString());
      throw new TradeDataNotAvailableException("String_Node_Str" + this._name);
    }
  }
  throw new TradeDataNotAvailableException(this._name + "String_Node_Str");
}
Program: 59447
Project: 59447
Buggy source:
/** 
 * Create a new connection to the btc-e.com website.
 */
public KrakenClient(){
  super();
  _name="String_Node_Str";
  _url="String_Node_Str";
  requestSupportedCurrencyPairs();
}

Fixed version (ground truth):
/** 
 * Create a new connection to the btc-e.com website.
 */
public KrakenClient(){
  super();
  _name="String_Node_Str";
  _url="String_Node_Str";
  if (requestSupportedCurrencyPairs()) {
    _supportedCurrencyPairs=_registeredCurrencyPairNames.keySet().toArray(new CurrencyPair[_registeredCurrencyPairNames.size()]);
  }
 else {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + _name);
    _supportedCurrencyPairs=new CurrencyPair[0];
  }
}
Program: 59448
Project: 59448
Buggy source:
/** 
 * Fetch the supported currency pairs from the Kraken server.
 */
private boolean requestSupportedCurrencyPairs(){
  String url=_url + "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    JSONObject jsonResult=JSONObject.fromObject(requestResult);
    if (jsonResult.containsKey("String_Node_Str")) {
      JSONObject pairListJSON=jsonResult.getJSONObject("String_Node_Str");
      for (Iterator keyIterator=pairListJSON.keys(); keyIterator.hasNext(); ) {
        String krakenPairName=(String)keyIterator.next();
        JSONObject currentCurrencyPairJSON=pairListJSON.getJSONObject(krakenPairName);
        de.andreas_rueckert.trade.Currency currency=CurrencySymbolMapper.getCurrencyForIso4217Name(currentCurrencyPairJSON.getString("String_Node_Str"));
        de.andreas_rueckert.trade.Currency paymentCurrency=CurrencySymbolMapper.getCurrencyForIso4217Name(currentCurrencyPairJSON.getString("String_Node_Str"));
        de.andreas_rueckert.trade.CurrencyPair currentPair=new de.andreas_rueckert.trade.CurrencyPairImpl(currency,paymentCurrency);
        addCurrencyPairName(currentPair,krakenPairName);
        System.out.println("String_Node_Str" + currentPair.toString());
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Fetch the supported currency pairs from the Kraken server.
 */
private boolean requestSupportedCurrencyPairs(){
  String url=_url + "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    JSONObject jsonResult=JSONObject.fromObject(requestResult);
    if (jsonResult.containsKey("String_Node_Str")) {
      JSONObject pairListJSON=jsonResult.getJSONObject("String_Node_Str");
      for (Iterator keyIterator=pairListJSON.keys(); keyIterator.hasNext(); ) {
        String krakenPairName=(String)keyIterator.next();
        JSONObject currentCurrencyPairJSON=pairListJSON.getJSONObject(krakenPairName);
        de.andreas_rueckert.trade.Currency currency=CurrencySymbolMapper.getCurrencyForIso4217Name(currentCurrencyPairJSON.getString("String_Node_Str"));
        de.andreas_rueckert.trade.Currency paymentCurrency=CurrencySymbolMapper.getCurrencyForIso4217Name(currentCurrencyPairJSON.getString("String_Node_Str"));
        de.andreas_rueckert.trade.CurrencyPair currentPair=new de.andreas_rueckert.trade.CurrencyPairImpl(currency,paymentCurrency);
        addCurrencyPairName(currentPair,krakenPairName);
      }
      return true;
    }
  }
  return false;
}
Program: 59449
Project: 59449
Buggy source:
/** 
 * Get the market depth as a Depth object.
 * @param currencyPair The queried currency pair.
 * @throws TradeDataNotAvailableException if the depth is not available.
 */
public Depth getDepth(CurrencyPair currencyPair) throws TradeDataNotAvailableException {
  if (!isSupportedCurrencyPair(currencyPair)) {
    throw new CurrencyNotSupportedException("String_Node_Str" + currencyPair.toString() + "String_Node_Str"+ _name);
  }
  String url=_url + "String_Node_Str" + currencyPair.getCurrency().getName()+ "String_Node_Str"+ currencyPair.getPaymentCurrency().getName()+ "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    try {
      JSONObject jsonResult=JSONObject.fromObject(requestResult);
      boolean successFlag=jsonResult.getBoolean("String_Node_Str");
      if (successFlag) {
        return new BittrexDepth(jsonResult.getJSONObject("String_Node_Str"),currencyPair,this);
      }
 else {
        LogUtils.getInstance().getLogger().error("String_Node_Str" + _name + "String_Node_Str"+ jsonResult.getString("String_Node_Str"));
        return null;
      }
    }
 catch (    JSONException je) {
      System.err.println("String_Node_Str" + this._name + "String_Node_Str"+ je.toString());
      throw new TradeDataNotAvailableException("String_Node_Str" + this._name);
    }
  }
  throw new TradeDataNotAvailableException(this._name + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get the market depth as a Depth object.
 * @param currencyPair The queried currency pair.
 * @throws TradeDataNotAvailableException if the depth is not available.
 */
public Depth getDepth(CurrencyPair currencyPair) throws TradeDataNotAvailableException {
  if (!isSupportedCurrencyPair(currencyPair)) {
    throw new CurrencyNotSupportedException("String_Node_Str" + currencyPair.toString() + "String_Node_Str"+ _name);
  }
  String url=_url + "String_Node_Str" + currencyPair.getPaymentCurrency().getName()+ "String_Node_Str"+ currencyPair.getCurrency().getName()+ "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    try {
      JSONObject jsonResult=JSONObject.fromObject(requestResult);
      boolean successFlag=jsonResult.getBoolean("String_Node_Str");
      if (successFlag) {
        return new BittrexDepth(jsonResult.getJSONObject("String_Node_Str"),currencyPair,this);
      }
 else {
        LogUtils.getInstance().getLogger().error("String_Node_Str" + _name + "String_Node_Str"+ currencyPair.toString()+ "String_Node_Str"+ jsonResult.getString("String_Node_Str"));
        return null;
      }
    }
 catch (    JSONException je) {
      System.err.println("String_Node_Str" + this._name + "String_Node_Str"+ je.toString());
      throw new TradeDataNotAvailableException("String_Node_Str" + this._name);
    }
  }
  throw new TradeDataNotAvailableException(this._name + "String_Node_Str");
}
Program: 59451
Project: 59451
Buggy source:
/** 
 * Get the shortest allowed requet interval in microseconds. This is just a dummy implementation to compile the code. API implementations overwrite this method.
 * @return The shortest allowed request interval in microseconds.
 */
public long getMinimumRequestInterval(){
  throw new NotYetImplementedException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get the shortest allowed requet interval in microseconds. This is just a dummy implementation to compile the code. API implementations overwrite this method.
 * @return The shortest allowed request interval in microseconds.
 */
public long getMinimumRequestInterval(){
  throw new NotYetImplementedException("String_Node_Str" + _name);
}
Program: 59452
Project: 59452
Buggy source:
/** 
 * Request the markets from the website.
 */
private final Map<CurrencyPair,String> requestMarketIDs(){
  Map<CurrencyPair,String> resultBuffer=new HashMap<CurrencyPair,String>();
  JSONArray JSONresult=(JSONArray)authenticatedHTTPRequest("String_Node_Str",null,null);
  for (int i=0; i < JSONresult.size(); i++) {
    JSONObject currentMarket=JSONresult.getJSONObject(i);
    String marketID="String_Node_Str" + currentMarket.getInt("String_Node_Str");
    Currency currency=CurrencyImpl.findByString(currentMarket.getString("String_Node_Str"));
    Currency paymentCurrency=CurrencyImpl.findByString(currentMarket.getString("String_Node_Str"));
    resultBuffer.put(new CurrencyPairImpl(currency,paymentCurrency),marketID);
  }
  return resultBuffer;
}

Fixed version (ground truth):
/** 
 * Request the markets from the website.
 */
private final Map<CurrencyPair,String> requestMarketIDs(){
  Map<CurrencyPair,String> resultBuffer=new HashMap<CurrencyPair,String>();
  JSONArray JSONresult=(JSONArray)authenticatedHTTPRequest("String_Node_Str",null,null);
  for (int i=0; i < JSONresult.size(); i++) {
    JSONObject currentMarket=JSONresult.getJSONObject(i);
    String marketID="String_Node_Str" + currentMarket.getInt("String_Node_Str");
    Currency currency=CurrencyImpl.findByString(currentMarket.getString("String_Node_Str").toUpperCase());
    Currency paymentCurrency=CurrencyImpl.findByString(currentMarket.getString("String_Node_Str").toUpperCase());
    resultBuffer.put(new CurrencyPairImpl(currency,paymentCurrency),marketID);
  }
  return resultBuffer;
}
Program: 59454
Project: 59454
Buggy source:
/** 
 * Request the supported currency pairs from the bittrex server.
 * @return true, if the currencies were returned, false in case of an error.
 */
private final boolean requestSupportedCurrencyPairs(){
  String url=_url + "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    try {
      JSONArray jsonResult=JSONArray.fromObject(requestResult);
      List<CurrencyPair> resultBuffer=new ArrayList<CurrencyPair>();
      for (int currentPairIndex=0; currentPairIndex < jsonResult.size(); ++currentPairIndex) {
        JSONObject currentPairJSON=jsonResult.getJSONObject(currentPairIndex);
        de.andreas_rueckert.trade.Currency currency=de.andreas_rueckert.trade.CurrencyImpl.findByString(currentPairJSON.getString("String_Node_Str"));
        de.andreas_rueckert.trade.Currency paymentCurrency=de.andreas_rueckert.trade.CurrencyImpl.findByString(currentPairJSON.getString("String_Node_Str"));
        de.andreas_rueckert.trade.CurrencyPair currentPair=new de.andreas_rueckert.trade.CurrencyPairImpl(currency,paymentCurrency);
        resultBuffer.add(currentPair);
      }
      _supportedCurrencyPairs=resultBuffer.toArray(new CurrencyPair[resultBuffer.size()]);
      return true;
    }
 catch (    JSONException je) {
      LogUtils.getInstance().getLogger().error("String_Node_Str" + this._name + "String_Node_Str"+ je.toString());
      return false;
    }
  }
 else {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + _name + "String_Node_Str");
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Request the supported currency pairs from the bittrex server.
 * @return true, if the currencies were returned, false in case of an error.
 */
private final boolean requestSupportedCurrencyPairs(){
  String url=_url + "String_Node_Str";
  String requestResult=HttpUtils.httpGet(url);
  if (requestResult != null) {
    try {
      JSONArray jsonResult=JSONArray.fromObject(requestResult);
      List<CurrencyPair> resultBuffer=new ArrayList<CurrencyPair>();
      for (int currentPairIndex=0; currentPairIndex < jsonResult.size(); ++currentPairIndex) {
        JSONObject currentPairJSON=jsonResult.getJSONObject(currentPairIndex);
        de.andreas_rueckert.trade.Currency currency=de.andreas_rueckert.trade.CurrencyImpl.findByString(currentPairJSON.getString("String_Node_Str").toUpperCase());
        de.andreas_rueckert.trade.Currency paymentCurrency=de.andreas_rueckert.trade.CurrencyImpl.findByString(currentPairJSON.getString("String_Node_Str").toUpperCase());
        de.andreas_rueckert.trade.CurrencyPair currentPair=new de.andreas_rueckert.trade.CurrencyPairImpl(currency,paymentCurrency);
        resultBuffer.add(currentPair);
      }
      _supportedCurrencyPairs=resultBuffer.toArray(new CurrencyPair[resultBuffer.size()]);
      return true;
    }
 catch (    JSONException je) {
      LogUtils.getInstance().getLogger().error("String_Node_Str" + this._name + "String_Node_Str"+ je.toString());
      return false;
    }
  }
 else {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + _name + "String_Node_Str");
  }
  return false;
}
Program: 59455
Project: 59455
Buggy source:
/** 
 * Create a new MintPal depth object from the JSON responses from the server.
 * @param jsonBuy The buy orders as a JSON object.
 * @param jsonSell The sell orders as a JSON object.
 * @param currencyPair The currency pair, that was queried.
 * @param tradeSite The trade site, that delivered the data.
 */
public MintPalDepth(JSONObject jsonBuy,JSONObject jsonSell,CurrencyPair currencyPair,TradeSite tradeSite){
  super(currencyPair,tradeSite);
  JSONArray buys=jsonBuy.getJSONArray("String_Node_Str");
  for (int i=0; i < buys.size(); ++i) {
    JSONObject buyOrder=buys.getJSONObject(i);
    _buys.add(new DepthOrderImpl(OrderType.BUY,new Price(buyOrder.getDouble("String_Node_Str")),_currencyPair,new Amount(buyOrder.getString("String_Node_Str"))));
  }
  Collections.sort(_buys);
  JSONArray sells=jsonSell.getJSONArray("String_Node_Str");
  for (int i=0; i < sells.size(); ++i) {
    JSONObject sellOrder=buys.getJSONObject(i);
    _sells.add(new DepthOrderImpl(OrderType.SELL,new Price(sellOrder.getDouble("String_Node_Str")),_currencyPair,new Amount(sellOrder.getString("String_Node_Str"))));
  }
  Collections.sort(_sells);
}

Fixed version (ground truth):
/** 
 * Create a new MintPal depth object from the JSON responses from the server.
 * @param jsonBuy The buy orders as a JSON object.
 * @param jsonSell The sell orders as a JSON object.
 * @param currencyPair The currency pair, that was queried.
 * @param tradeSite The trade site, that delivered the data.
 */
public MintPalDepth(JSONObject jsonBuy,JSONObject jsonSell,CurrencyPair currencyPair,TradeSite tradeSite){
  super(currencyPair,tradeSite);
  JSONArray buys=jsonBuy.getJSONArray("String_Node_Str");
  for (int i=0; i < buys.size(); ++i) {
    JSONObject buyOrder=buys.getJSONObject(i);
    _buys.add(new DepthOrderImpl(OrderType.BUY,new Price(buyOrder.getDouble("String_Node_Str")),_currencyPair,new Amount(buyOrder.getString("String_Node_Str"))));
  }
  Collections.sort(_buys);
  JSONArray sells=jsonSell.getJSONArray("String_Node_Str");
  for (int i=0; i < sells.size(); ++i) {
    JSONObject sellOrder=sells.getJSONObject(i);
    _sells.add(new DepthOrderImpl(OrderType.SELL,new Price(sellOrder.getDouble("String_Node_Str")),_currencyPair,new Amount(sellOrder.getString("String_Node_Str"))));
  }
  Collections.sort(_sells);
}
Program: 59457
Project: 59457
Buggy source:
/** 
 * Gets the fee for a currency pair trade, 
 * @param the fee
 * @return
 */
public BigDecimal getFeeForCurrencyPairTrade(CurrencyPair pair){
  for (  CurrencyPair currencyPair : _supportedCurrencyPairs) {
    if (currencyPair.getCurrency().equals(pair.getCurrency()) && currencyPair.getPaymentCurrency().equals(pair.getPaymentCurrency())) {
      return currencyPairFeeTrade.get(pair);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the fee for a currency pair trade, 
 * @param the fee
 * @return
 */
public BigDecimal getFeeForCurrencyPairTrade(CurrencyPair pair){
  for (  CurrencyPair currencyPair : _supportedCurrencyPairs) {
    if (currencyPair.getCurrency().equals(pair.getCurrency()) && currencyPair.getPaymentCurrency().equals(pair.getPaymentCurrency())) {
      return currencyPairFeeTrade.get(currencyPair);
    }
  }
  return null;
}