nus-yam/ex-repair huggingface dataset:
Program: 13878
Project: 13878
Buggy source:
@Override public void shiftLine(boolean horizontal,int row,int steps){
  gameFieldService.shiftLine(level,horizontal,row,steps);
  solvedPuzzle=gameFieldService.solvedPuzzle(level);
  notifyAllObserver();
}

Fixed version (ground truth):
@Override public void shiftLine(boolean horizontal,int row,int steps,boolean silent){
  gameFieldService.shiftLine(level,horizontal,row,steps);
  solvedPuzzle=gameFieldService.solvedPuzzle(level);
  if (!silent) {
    notifyAllObserver();
  }
}
Program: 13879
Project: 13879
Buggy source:
public void oneStep(final boolean horizontal,int row,final int direction){
  if (row < 0) {
    return;
  }
  this.horizontal=horizontal;
  this.row=row;
  this.direction=direction;
  row++;
  if (horizontal) {
    if (row > tileSprites.length - 2) {
      return;
    }
    this.countModifier=tileSprites.length - 2;
    this.modifierFinished=0;
    for (int x=1; x < tileSprites.length - 1; x++) {
      TileSprite tileSprite=tileSprites[x][row];
      tileSprite.registerEntityModifier(new MoveXModifier(0.3f,tileSprite.getX(),tileSprite.getX() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished();
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
 else {
    if (row > tileSprites[0].length - 2) {
      return;
    }
    this.countModifier=tileSprites[row].length - 2;
    this.modifierFinished=0;
    for (int y=1; y < tileSprites[row].length - 1; y++) {
      TileSprite tileSprite=tileSprites[row][y];
      tileSprite.registerEntityModifier(new MoveYModifier(0.3f,tileSprite.getY(),tileSprite.getY() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished();
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void oneStep(final boolean horizontal,int row,final int direction){
  if (row < 0) {
    return;
  }
  this.horizontal=horizontal;
  this.row=row;
  this.direction=direction;
  row++;
  if (horizontal) {
    if (row > tileSprites.length - 2) {
      return;
    }
    gameService.shiftLine(true,row - 1,direction,true);
    this.countModifier=tileSprites.length - 2;
    this.modifierFinished=0;
    for (int x=1; x < tileSprites.length - 1; x++) {
      TileSprite tileSprite=tileSprites[x][row];
      tileSprite.registerEntityModifier(new MoveXModifier(0.3f,tileSprite.getX(),tileSprite.getX() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished();
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
 else {
    if (row > tileSprites[0].length - 2) {
      return;
    }
    gameService.shiftLine(false,row - 1,direction,true);
    this.countModifier=tileSprites[row].length - 2;
    this.modifierFinished=0;
    for (int y=1; y < tileSprites[row].length - 1; y++) {
      TileSprite tileSprite=tileSprites[row][y];
      tileSprite.registerEntityModifier(new MoveYModifier(0.3f,tileSprite.getY(),tileSprite.getY() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished();
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
}
Program: 13880
Project: 13880
Buggy source:
private void oneModifierFinished(){
  modifierFinished++;
  if (modifierFinished == countModifier) {
    active=false;
    gameService.shiftLine(horizontal,row,direction);
  }
}

Fixed version (ground truth):
private void oneModifierFinished(){
  modifierFinished++;
  if (modifierFinished == countModifier) {
    active=false;
    gameService.notifyAllObserver();
  }
}
Program: 13882
Project: 13882
Buggy source:
@Override protected void onModifierFinished(IEntity pItem){
  oneModifierFinished();
  super.onModifierFinished(pItem);
}

Fixed version (ground truth):
@Override protected void onModifierFinished(IEntity pItem){
  oneModifierFinished(false);
  super.onModifierFinished(pItem);
}
Program: 13883
Project: 13883
Buggy source:
public void oneStep(final boolean horizontal,int row,final int direction){
  if (row < 0) {
    return;
  }
  row++;
  if (horizontal) {
    if (row > tileSprites.length - 2) {
      return;
    }
    gameService.shiftLine(true,row - 1,direction,true);
    this.countModifier=tileSprites.length - 2;
    this.modifierFinished=0;
    for (int x=1; x < tileSprites.length - 1; x++) {
      TileSprite tileSprite=tileSprites[x][row];
      tileSprite.registerEntityModifier(new MoveXModifier(0.3f,tileSprite.getX(),tileSprite.getX() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished();
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
 else {
    if (row > tileSprites[0].length - 2) {
      return;
    }
    gameService.shiftLine(false,row - 1,direction,true);
    this.countModifier=tileSprites[row].length - 2;
    this.modifierFinished=0;
    for (int y=1; y < tileSprites[row].length - 1; y++) {
      TileSprite tileSprite=tileSprites[row][y];
      tileSprite.registerEntityModifier(new MoveYModifier(0.3f,tileSprite.getY(),tileSprite.getY() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished();
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void oneStep(final boolean horizontal,int row,final int direction){
  if (row < 0) {
    return;
  }
  row++;
  if (horizontal) {
    if (row > tileSprites.length - 2) {
      return;
    }
    gameService.shiftLine(true,row - 1,direction,true);
    active=true;
    this.countModifier=tileSprites.length - 2;
    this.modifierFinished=0;
    for (int x=1; x < tileSprites.length - 1; x++) {
      TileSprite tileSprite=tileSprites[x][row];
      tileSprite.registerEntityModifier(new MoveXModifier(0.3f,tileSprite.getX(),tileSprite.getX() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished(false);
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
 else {
    if (row > tileSprites[0].length - 2) {
      return;
    }
    gameService.shiftLine(false,row - 1,direction,true);
    active=true;
    this.countModifier=tileSprites[row].length - 2;
    this.modifierFinished=0;
    for (int y=1; y < tileSprites[row].length - 1; y++) {
      TileSprite tileSprite=tileSprites[row][y];
      tileSprite.registerEntityModifier(new MoveYModifier(0.3f,tileSprite.getY(),tileSprite.getY() + tileSprite.getWidth() * direction,EaseQuadInOut.getInstance()){
        @Override protected void onModifierFinished(        IEntity pItem){
          oneModifierFinished(false);
          super.onModifierFinished(pItem);
        }
      }
);
    }
  }
}
Program: 13884
Project: 13884
Buggy source:
private void oneModifierFinished(){
  modifierFinished++;
  if (modifierFinished == countModifier) {
    active=false;
    gameService.notifyAllObserver();
  }
}

Fixed version (ground truth):
private void oneModifierFinished(boolean now){
  modifierFinished++;
  if (modifierFinished == countModifier | now) {
    active=false;
    gameService.notifyAllObserver();
  }
}
Program: 13885
Project: 13885
Buggy source:
private void registerTouchHandler(){
  GameSceneSingleMoveDetector gameSceneSingleMoveDetector=new GameSceneSingleMoveDetector(0,getTileSceneStartY() + spacePerTile,spacePerTile,gameFieldView);
  continuousHoldDetector=new ContinuousHoldDetector(0,100,0.01f,gameSceneSingleMoveDetector);
  setOnSceneTouchListener(continuousHoldDetector);
}

Fixed version (ground truth):
private void registerTouchHandler(){
  GameSceneSingleMoveDetector gameSceneSingleMoveDetector=new GameSceneSingleMoveDetector(0,getTileSceneStartY() + spacePerTile,spacePerTile,gameFieldView,gameService);
  continuousHoldDetector=new ContinuousHoldDetector(0,100,0.01f,gameSceneSingleMoveDetector);
  setOnSceneTouchListener(continuousHoldDetector);
}
Program: 13886
Project: 13886
Buggy source:
@Override public void onHoldFinished(HoldDetector pHoldDetector,long pHoldTimeMilliseconds,int pPointerID,float pHoldX,float pHoldY){
  int row;
  if (!isMoved) {
    if (Math.abs(pHoldX - firstX) > Math.abs(pHoldY - firstY)) {
      if (pHoldX - firstX > SWIPE_SENSITIVITY) {
        row=(int)((firstY - fieldStartY) / widthPerTile);
        gameFieldView.oneStep(true,row,1);
        isMoved=true;
      }
 else       if (firstX - pHoldX > SWIPE_SENSITIVITY) {
        row=(int)((firstY - fieldStartY) / widthPerTile);
        gameFieldView.oneStep(true,row,-1);
        isMoved=true;
      }
    }
 else     if (pHoldY - firstY > SWIPE_SENSITIVITY) {
      row=(int)((firstX - fieldStartX) / widthPerTile);
      gameFieldView.oneStep(false,row,1);
      isMoved=true;
    }
 else     if (firstY - pHoldY > SWIPE_SENSITIVITY) {
      row=(int)((firstX - fieldStartX) / widthPerTile);
      gameFieldView.oneStep(false,row,-1);
      isMoved=true;
    }
  }
}

Fixed version (ground truth):
@Override public void onHoldFinished(HoldDetector pHoldDetector,long pHoldTimeMilliseconds,int pPointerID,float pHoldX,float pHoldY){
  if (!gameService.solvedPuzzle()) {
    int row;
    if (!isMoved) {
      if (Math.abs(pHoldX - firstX) > Math.abs(pHoldY - firstY)) {
        if (pHoldX - firstX > SWIPE_SENSITIVITY) {
          row=(int)((firstY - fieldStartY) / widthPerTile);
          gameFieldView.oneStep(true,row,1);
          isMoved=true;
        }
 else         if (firstX - pHoldX > SWIPE_SENSITIVITY) {
          row=(int)((firstY - fieldStartY) / widthPerTile);
          gameFieldView.oneStep(true,row,-1);
          isMoved=true;
        }
      }
 else       if (pHoldY - firstY > SWIPE_SENSITIVITY) {
        row=(int)((firstX - fieldStartX) / widthPerTile);
        gameFieldView.oneStep(false,row,1);
        isMoved=true;
      }
 else       if (firstY - pHoldY > SWIPE_SENSITIVITY) {
        row=(int)((firstX - fieldStartX) / widthPerTile);
        gameFieldView.oneStep(false,row,-1);
        isMoved=true;
      }
    }
  }
}
Program: 13887
Project: 13887
Buggy source:
@Override public void onHoldStarted(HoldDetector pHoldDetector,int pPointerID,float pHoldX,float pHoldY){
  firstX=pHoldX;
  firstY=pHoldY;
  isMoved=false;
}

Fixed version (ground truth):
@Override public void onHoldStarted(HoldDetector pHoldDetector,int pPointerID,float pHoldX,float pHoldY){
  if (!gameService.solvedPuzzle()) {
    firstX=pHoldX;
    firstY=pHoldY;
    isMoved=false;
  }
}
Program: 13888
Project: 13888
Buggy source:
@Override public void onHold(HoldDetector pHoldDetector,long pHoldTimeMilliseconds,int pPointerID,float pHoldX,float pHoldY){
  int row;
  if (!isMoved) {
    if (pHoldX - firstX > widthPerTile) {
      row=(int)((firstY - fieldStartY) / widthPerTile);
      gameFieldView.oneStep(true,row,1);
      isMoved=true;
    }
 else     if (firstX - pHoldX > widthPerTile) {
      row=(int)((firstY - fieldStartY) / widthPerTile);
      gameFieldView.oneStep(true,row,-1);
      isMoved=true;
    }
 else     if (pHoldY - firstY > widthPerTile) {
      row=(int)((firstX - fieldStartX) / widthPerTile);
      gameFieldView.oneStep(false,row,1);
      isMoved=true;
    }
 else     if (firstY - pHoldY > widthPerTile) {
      row=(int)((firstX - fieldStartX) / widthPerTile);
      gameFieldView.oneStep(false,row,-1);
      isMoved=true;
    }
  }
}

Fixed version (ground truth):
@Override public void onHold(HoldDetector pHoldDetector,long pHoldTimeMilliseconds,int pPointerID,float pHoldX,float pHoldY){
  if (!gameService.solvedPuzzle()) {
    int row;
    if (!isMoved) {
      if (pHoldX - firstX > widthPerTile) {
        row=(int)((firstY - fieldStartY) / widthPerTile);
        gameFieldView.oneStep(true,row,1);
        isMoved=true;
      }
 else       if (firstX - pHoldX > widthPerTile) {
        row=(int)((firstY - fieldStartY) / widthPerTile);
        gameFieldView.oneStep(true,row,-1);
        isMoved=true;
      }
 else       if (pHoldY - firstY > widthPerTile) {
        row=(int)((firstX - fieldStartX) / widthPerTile);
        gameFieldView.oneStep(false,row,1);
        isMoved=true;
      }
 else       if (firstY - pHoldY > widthPerTile) {
        row=(int)((firstX - fieldStartX) / widthPerTile);
        gameFieldView.oneStep(false,row,-1);
        isMoved=true;
      }
    }
  }
}
Program: 13889
Project: 13889
Buggy source:
public GameSceneSingleMoveDetector(float startX,float startY,float widthPerTile,GameFieldView gameFieldView){
  this.fieldStartX=startX;
  this.fieldStartY=startY;
  this.widthPerTile=widthPerTile;
  this.gameFieldView=gameFieldView;
  isMoved=false;
  SWIPE_SENSITIVITY=widthPerTile * 0.1f;
}

Fixed version (ground truth):
public GameSceneSingleMoveDetector(float startX,float startY,float widthPerTile,GameFieldView gameFieldView,GameService gameService){
  this.fieldStartX=startX;
  this.fieldStartY=startY;
  this.widthPerTile=widthPerTile;
  this.gameFieldView=gameFieldView;
  isMoved=false;
  SWIPE_SENSITIVITY=widthPerTile * 0.1f;
  this.gameService=gameService;
}
Program: 13890
Project: 13890
Buggy source:
@Override public void start(){
  engine.registerUpdateHandler(new TimerHandler(0.1f,new ITimerCallback(){
    @Override public void onTimePassed(    final TimerHandler pTimerHandler){
      engine.unregisterUpdateHandler(pTimerHandler);
      ResourcesManager.getInstance().loadLevelChoiceSceneResources();
      ResourcesManager.getInstance().loadScoreSceneResources();
      ResourcesManager.getInstance().loadTutorialSceneResources();
      ResourcesManager.getInstance().loadGameSceneResources();
      choiceScene=new LevelChoiceScene();
      setScene(choiceScene);
    }
  }
));
}

Fixed version (ground truth):
@Override public void start(){
  engine.registerUpdateHandler(new TimerHandler(0.1f,new ITimerCallback(){
    @Override public void onTimePassed(    final TimerHandler pTimerHandler){
      engine.unregisterUpdateHandler(pTimerHandler);
      ResourcesManager.getInstance().loadLevelChoiceSceneResources();
      ResourcesManager.getInstance().loadScoreSceneResources();
      ResourcesManager.getInstance().loadTutorialSceneResources();
      ResourcesManager.getInstance().loadGameSceneResources();
      ResourcesManager.getInstance().loadLevelModeCompleteResources();
      choiceScene=new LevelChoiceScene();
      setScene(choiceScene);
    }
  }
));
}
Program: 13891
Project: 13891
Buggy source:
public TimeBasedGameServiceImpl(Level level,int remainingTime){
  gameService=new GameServiceImpl(level);
  gameService.attach(this);
  this.remainingTime=remainingTime;
  observers=new ArrayList<>();
}

Fixed version (ground truth):
public TimeBasedGameServiceImpl(Level level,int remainingTime){
  gameService=new GameServiceImpl(level);
  this.remainingTime=remainingTime;
  observers=new ArrayList<>();
}
Program: 13892
Project: 13892
Buggy source:
@Override public void update(){
  updateTiles();
  scoreText.setText(String.valueOf(gameService.getLevel().getMovesCount()));
  if (gameService.solvedPuzzle()) {
    setOnSceneTouchListener(null);
    gameFieldView.setTubesState(1);
    baseScene.registerUpdateHandler(new TimerHandler(0.1f,new ITimerCallback(){
      public void onTimePassed(      final TimerHandler pTimerHandler){
        baseScene.unregisterUpdateHandler(pTimerHandler);
        onSolvedGame();
      }
    }
));
  }
  if (gameService.lostLevel()) {
    onLostGame();
  }
}

Fixed version (ground truth):
@Override public void update(){
  updateTiles();
  scoreText.setText(String.valueOf(gameService.getLevel().getMovesCount()));
  if (gameService.solvedPuzzle()) {
    setOnSceneTouchListener(null);
    gameFieldView.setTubesState(1);
    gameService.detatch(this);
    baseScene.registerUpdateHandler(new TimerHandler(0.1f,new ITimerCallback(){
      public void onTimePassed(      final TimerHandler pTimerHandler){
        baseScene.unregisterUpdateHandler(pTimerHandler);
        onSolvedGame();
      }
    }
));
  }
  if (gameService.lostLevel()) {
    onLostGame();
  }
}
Program: 13893
Project: 13893
Buggy source:
private void updateTiles(){
  detachChild(gameFieldView);
  gameFieldView.addTiles();
  attachChild(gameFieldView);
}

Fixed version (ground truth):
private void updateTiles(){
  baseScene.registerUpdateHandler(new TimerHandler(0.1f,new ITimerCallback(){
    public void onTimePassed(    final TimerHandler pTimerHandler){
      detachChild(gameFieldView);
      gameFieldView.addTiles();
      attachChild(gameFieldView);
    }
  }
));
}
Program: 13894
Project: 13894
Buggy source:
public GameScene(Level level){
  super();
  this.level=level;
  initializeLogic();
  calculateSpacePerTile(gameService.getLevel().getField().length - 2);
  levelBackup=new Level(gameService.getLevel());
  addBackground();
  addTiles();
  addButtons();
  addScoreText();
  addCustomLabels();
  registerTouchHandler();
  gameService.attach(this);
  resourcesManager.musicService.stopMusic();
}

Fixed version (ground truth):
public GameScene(Level level){
  super();
  this.level=level;
  initializeLogic();
  calculateSpacePerTile(gameService.getLevel().getField().length - 2);
  levelBackup=new Level(gameService.getLevel());
  addBackground();
  addTiles();
  addButtons();
  addScoreText();
  addCustomLabels();
  registerTouchHandler();
  resourcesManager.musicService.stopMusic();
}
Program: 13895
Project: 13895
Buggy source:
@Override protected void initializeLogic(){
  gameService=new GameServiceImpl(this.level);
}

Fixed version (ground truth):
@Override protected void initializeLogic(){
  gameService=new GameServiceImpl(this.level);
  gameService.attach(this);
}
Program: 13896
Project: 13896
Buggy source:
@Override protected void initializeLogic(){
  timeBasedGameService=new TimeBasedGameServiceImpl(level,10);
  gameService=timeBasedGameService;
  timeBasedGameService.start();
}

Fixed version (ground truth):
@Override protected void initializeLogic(){
  timeBasedGameService=new TimeBasedGameServiceImpl(level,10);
  gameService=timeBasedGameService;
  timeBasedGameService.start();
  gameService.attach(this);
}
Program: 13897
Project: 13897
Buggy source:
@Override public void onTimePassed(TimerHandler pTimerHandler){
  engine.unregisterUpdateHandler(pTimerHandler);
  storyService.loadJustPlayScoreSceneFromJustPlayScene(new JustPlayLevelResult(justPlayLevel.getLeftTime() - 12,gameService.getLevel().getMovesCount()));
}

Fixed version (ground truth):
@Override public void onTimePassed(TimerHandler pTimerHandler){
  leftTime.setText(String.valueOf(timeBasedGameService.getRemainingTime()));
}
Program: 13898
Project: 13898
Buggy source:
@Override public void update(){
  super.update();
  leftTime.setText(String.valueOf(timeBasedGameService.getRemainingTime()));
}

Fixed version (ground truth):
@Override public void update(){
  super.update();
  engine.registerUpdateHandler(new TimerHandler(0.1f,new ITimerCallback(){
    @Override public void onTimePassed(    TimerHandler pTimerHandler){
      leftTime.setText(String.valueOf(timeBasedGameService.getRemainingTime()));
    }
  }
));
}
Program: 13899
Project: 13899
Buggy source:
void moveRight();

Fixed version (ground truth):
void moveRight(int screen);
Program: 13900
Project: 13900
Buggy source:
@Override public void moveRight(){
  if (currentScreen < screenCount - 1) {
    currentScreen++;
  }
  updateAll();
}

Fixed version (ground truth):
@Override public void moveRight(int screen){
  if (screen < screenCount) {
    currentScreen=screen;
  }
  updateAll();
}
Program: 13901
Project: 13901
Buggy source:
private void moveToLastUnlocked(){
  LevelInfo lastUnlocked=levelService.getLastUnlocked();
  int screenToJumpTo=(int)(lastUnlocked.getLevelId() - 0.1) / 12;
  while (levelChoiceService.getCurrentScreen() < screenToJumpTo) {
    levelChoiceService.moveRight();
  }
}

Fixed version (ground truth):
private void moveToLastUnlocked(){
  LevelInfo lastUnlocked=levelService.getLastUnlocked();
  int screenToJumpTo=(int)(lastUnlocked.getLevelId() - 0.1) / 12;
  levelChoiceService.moveRight(screenToJumpTo);
}
Program: 13903
Project: 13903
Buggy source:
public String[] fromGameField(Level gameField){
  Tile tiles[][]=gameField.getField();
  String level[]=new String[tiles[0].length];
  for (int y=0; y < tiles[0].length; y++) {
    level[y]=new String();
    for (int x=0; x < tiles.length; x++) {
      level[y]=level[y] + String.valueOf(tiles[x][y].getShortcut());
    }
  }
  return level;
}

Fixed version (ground truth):
public String[] fromGameField(Level gameField){
  Tile tiles[][]=gameField.getField();
  int indexOfProperties=0;
  if (gameField.getId() == null) {
    gameField.setId(-1);
  }
  String level[]=new String[tiles[0].length + 3];
  level[0]=String.valueOf(gameField.getId());
  level[1]=String.valueOf(gameField.getMinimumMovesToSolve());
  level[2]="String_Node_Str";
  for (int y=0; y < tiles[0].length; y++) {
    level[y + 3]=new String();
    for (int x=0; x < tiles.length; x++) {
      level[y + 3]=level[y + 3] + String.valueOf(tiles[x][y].getShortcut());
    }
  }
  return level;
}
Program: 13904
Project: 13904
Buggy source:
public Level fromString(String[] string){
  Tile[][] field;
  Level level=new Level();
  field=new Tile[string[0].length()][string.length];
  for (int i=0; i < string[0].length(); i++) {
    for (int j=0; j < string.length; j++) {
      Tile currentTile=new Tile(characterTileHashMap.get(string[j].charAt(i)));
      if (currentTile.getTileType() != TileType.NONE) {
        if (i == 0) {
          checkInvalidTile(currentTile);
          currentTile.setRight(true);
        }
        if (i == string[0].length() - 1) {
          checkInvalidTile(currentTile);
          currentTile.setLeft(true);
        }
        if (j == 0) {
          checkInvalidTile(currentTile);
          currentTile.setBottom(true);
        }
        if (j == string.length - 1) {
          checkInvalidTile(currentTile);
          currentTile.setTop(true);
        }
      }
      field[i][j]=currentTile;
      if (currentTile.getTileType() == TileType.START) {
        level.setStartX(i);
        level.setStartY(j);
      }
    }
  }
  level.setField(field);
  return level;
}

Fixed version (ground truth):
public Level fromString(String[] string){
  Tile[][] field;
  Level level=new Level();
  int indexOfProperties=0;
  for (; string[indexOfProperties].charAt(0) != '#'; indexOfProperties++) {
switch (indexOfProperties) {
case 0:
      level.setId(Integer.parseInt(string[0]));
    break;
case 1:
  level.setMinimumMovesToSolve(Integer.parseInt(string[1]));
break;
default :
break;
}
}
ArrayList<String> stringsForField=new ArrayList<>();
for (int i=indexOfProperties + 1; i < string.length; i++) {
stringsForField.add(i - indexOfProperties - 1,string[i]);
}
field=getTiles(stringsForField.toArray(new String[stringsForField.size()]),level);
level.setField(field);
return level;
}
Program: 13906
Project: 13906
Buggy source:
public void addTiles(){
  tileGroup.detachChildren();
  Tile[][] field=gameService.getGameField().getField();
  int width=field.length;
  int heigth=field[0].length;
  spacePerTile=MainActivity.CAMERA_WIDTH / width;
  float tilesSceneStartY=getTileSceneStartY(spacePerTile);
  tileGroup.setPosition(0,tilesSceneStartY);
  int tilePositionY=0;
  tileSprites=new TileSprite[width][heigth];
  for (int y=0; y < heigth; y++) {
    int tilePositionX=0;
    for (int x=0; x < width; x++) {
      if (field[x][y].getShortcut() != 'n') {
        TextureRegion pTextureRegion=resourcesManager.regionTileMap.get(field[x][y].getShortcut());
        TileSprite tileSprite=new TileSprite(tilePositionX,tilePositionY,spacePerTile,spacePerTile,pTextureRegion,vbom);
        tileGroup.attachChild(tileSprite);
        if (field[x][y].getTileType() == TileType.PUZZLE) {
          tileSprites[x][y]=tileSprite;
        }
      }
      tilePositionX+=spacePerTile;
    }
    tilePositionY+=spacePerTile;
  }
  tileGroup.attachChild(new Sprite(spacePerTile,spacePerTile,spacePerTile * (width - 2),spacePerTile * (width - 2),resourcesManager.tilesBorderRegion,vbom));
  setSolved(gameService.solvedPuzzle());
}

Fixed version (ground truth):
public void addTiles(){
  tileGroup.detachChildren();
  Tile[][] field=gameService.getGameField().getField();
  int width=field.length;
  int heigth=field[0].length;
  spacePerTile=camera.getWidth() / width;
  float tilesSceneStartY=getTileSceneStartY(spacePerTile);
  tileGroup.setPosition(0,tilesSceneStartY);
  int tilePositionY=0;
  tileSprites=new TileSprite[width][heigth];
  for (int y=0; y < heigth; y++) {
    int tilePositionX=0;
    for (int x=0; x < width; x++) {
      if (field[x][y].getShortcut() != 'n') {
        TextureRegion pTextureRegion=resourcesManager.regionTileMap.get(field[x][y].getShortcut());
        TileSprite tileSprite=new TileSprite(tilePositionX,tilePositionY,spacePerTile,spacePerTile,pTextureRegion,vbom);
        tileGroup.attachChild(tileSprite);
        if (field[x][y].getTileType() == TileType.PUZZLE) {
          tileSprites[x][y]=tileSprite;
        }
      }
      tilePositionX+=spacePerTile;
    }
    tilePositionY+=spacePerTile;
  }
  tileGroup.attachChild(new Sprite(spacePerTile,spacePerTile,spacePerTile * (width - 2),spacePerTile * (width - 2),resourcesManager.tilesBorderRegion,vbom));
  setSolved(gameService.solvedPuzzle());
}
Program: 13907
Project: 13907
Buggy source:
@Override public void createScene(Object o){
  int foo=(MainActivity.CAMERA_HEIGHT - MainActivity.CAMERA_WIDTH) / 2;
  setBackground(new Background(Color.WHITE));
  this.attachChild(new Sprite(0,foo,MainActivity.CAMERA_WIDTH,MainActivity.CAMERA_WIDTH,ResourcesManager.getInstance().loadingScreenBackgroundRegion,vbom){
    @Override protected void preDraw(    GLState pGLState,    Camera pCamera){
      super.preDraw(pGLState,pCamera);
      pGLState.enableDither();
    }
  }
);
}

Fixed version (ground truth):
@Override public void createScene(Object o){
  float spriteSTartY=(camera.getHeight() - camera.getWidth()) / 2;
  setBackground(new Background(Color.WHITE));
  this.attachChild(new Sprite(0,spriteSTartY,camera.getWidth(),camera.getWidth(),ResourcesManager.getInstance().loadingScreenBackgroundRegion,vbom){
    @Override protected void preDraw(    GLState pGLState,    Camera pCamera){
      super.preDraw(pGLState,pCamera);
      pGLState.enableDither();
    }
  }
);
}
Program: 13908
Project: 13908
Buggy source:
private void createMenuChildScene(){
  Sprite playItemSprite=new Sprite(0,0,resourcesManager.play_region,vbom){
    @Override public boolean onAreaTouched(    TouchEvent pSceneTouchEvent,    float pTouchAreaLocalX,    float pTouchAreaLocalY){
      sceneService.loadGameScene();
      return true;
    }
  }
;
  playItemSprite.setPosition(MainActivity.CAMERA_WIDTH / 2 - playItemSprite.getWidthScaled() / 2,MainActivity.CAMERA_HEIGHT / 2 - playItemSprite.getHeightScaled());
  attachChild(playItemSprite);
  registerTouchArea(playItemSprite);
  Sprite levelItemSprite=new Sprite(0,0,resourcesManager.level_mode_region,vbom){
    @Override public boolean onAreaTouched(    TouchEvent pSceneTouchEvent,    float pTouchAreaLocalX,    float pTouchAreaLocalY){
      sceneService.loadLevelChoiceSceneFromMenuScene();
      return true;
    }
  }
;
  levelItemSprite.setPosition(MainActivity.CAMERA_WIDTH / 2 - levelItemSprite.getWidthScaled() / 2,MainActivity.CAMERA_HEIGHT / 2);
  attachChild(levelItemSprite);
  registerTouchArea(levelItemSprite);
}

Fixed version (ground truth):
private void createMenuChildScene(){
  Sprite playItemSprite=new Sprite(0,0,resourcesManager.play_region,vbom){
    @Override public boolean onAreaTouched(    TouchEvent pSceneTouchEvent,    float pTouchAreaLocalX,    float pTouchAreaLocalY){
      sceneService.loadGameScene();
      return true;
    }
  }
;
  playItemSprite.setPosition(camera.getWidth() / 2 - playItemSprite.getWidthScaled() / 2,camera.getHeight() / 2 - playItemSprite.getHeightScaled());
  attachChild(playItemSprite);
  registerTouchArea(playItemSprite);
  Sprite levelItemSprite=new Sprite(0,0,resourcesManager.level_mode_region,vbom){
    @Override public boolean onAreaTouched(    TouchEvent pSceneTouchEvent,    float pTouchAreaLocalX,    float pTouchAreaLocalY){
      sceneService.loadLevelChoiceSceneFromMenuScene();
      return true;
    }
  }
;
  levelItemSprite.setPosition(camera.getWidth() / 2 - levelItemSprite.getWidthScaled() / 2,camera.getHeight() / 2);
  attachChild(levelItemSprite);
  registerTouchArea(levelItemSprite);
}
Program: 13909
Project: 13909
Buggy source:
@Override public void onHold(HoldDetector pHoldDetector,long pHoldTimeMilliseconds,int pPointerID,float pHoldX,float pHoldY){
  if (!horizontal && !vertical) {
    if (Math.abs(moveStartX - pHoldX) > MainActivity.CAMERA_WIDTH / 100) {
      horizontal=true;
      row=(int)((moveStartY - startY) / widthPerTile);
    }
    if (Math.abs(moveStartY - pHoldY) > MainActivity.CAMERA_WIDTH / 100) {
      vertical=true;
      row=(int)((moveStartX - startX) / widthPerTile);
    }
  }
 else {
    if (horizontal) {
      float moveSize=pHoldX - moveStartX;
      if (moveSize > widthPerTile) {
        gameService.shiftLine(true,row,1);
        moveStartX=pHoldX;
        gameScene.moveTiles(true,row,0,true);
      }
 else       if (moveSize < (0 - widthPerTile)) {
        gameService.shiftLine(true,row,-1);
        moveStartX=pHoldX;
        gameScene.moveTiles(true,row,0,true);
      }
 else {
        gameScene.moveTiles(true,row,moveSize,false);
      }
    }
 else {
      float moveSize=pHoldY - moveStartY;
      if (moveSize > widthPerTile) {
        gameService.shiftLine(false,row,1);
        moveStartY=pHoldY;
        gameScene.moveTiles(false,row,0,true);
      }
 else       if (moveSize < (0 - widthPerTile)) {
        gameService.shiftLine(false,row,-1);
        moveStartY=pHoldY;
        gameScene.moveTiles(false,row,0,true);
      }
 else {
        gameScene.moveTiles(false,row,moveSize,false);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onHold(HoldDetector pHoldDetector,long pHoldTimeMilliseconds,int pPointerID,float pHoldX,float pHoldY){
  if (!horizontal && !vertical) {
    if (Math.abs(moveStartX - pHoldX) > gameScene.camera.getWidth() / 100) {
      horizontal=true;
      row=(int)((moveStartY - startY) / widthPerTile);
    }
    if (Math.abs(moveStartY - pHoldY) > gameScene.camera.getWidth() / 100) {
      vertical=true;
      row=(int)((moveStartX - startX) / widthPerTile);
    }
  }
 else {
    if (horizontal) {
      float moveSize=pHoldX - moveStartX;
      if (moveSize > widthPerTile) {
        gameService.shiftLine(true,row,1);
        moveStartX=pHoldX;
        gameScene.moveTiles(true,row,0,true);
      }
 else       if (moveSize < (0 - widthPerTile)) {
        gameService.shiftLine(true,row,-1);
        moveStartX=pHoldX;
        gameScene.moveTiles(true,row,0,true);
      }
 else {
        gameScene.moveTiles(true,row,moveSize,false);
      }
    }
 else {
      float moveSize=pHoldY - moveStartY;
      if (moveSize > widthPerTile) {
        gameService.shiftLine(false,row,1);
        moveStartY=pHoldY;
        gameScene.moveTiles(false,row,0,true);
      }
 else       if (moveSize < (0 - widthPerTile)) {
        gameService.shiftLine(false,row,-1);
        moveStartY=pHoldY;
        gameScene.moveTiles(false,row,0,true);
      }
 else {
        gameScene.moveTiles(false,row,moveSize,false);
      }
    }
  }
}
Program: 13910
Project: 13910
Buggy source:
public void shiftLine(GameField gameField,boolean horizontal,int row,int steps){
  if (horizontal) {
    Tile line[]=new Tile[gameField.getField().length - 2];
    for (int i=0; i < gameField.getField().length - 2; i++) {
      line[i]=gameField.getField()[i + 1][row + 1];
      gameField.getField()[i + 1][row + 1]=null;
    }
    for (int i=0; i < gameField.getField().length - 2; i++) {
      int newPosition=i + steps;
      newPosition=shiftToPositive(newPosition,gameField.getField().length - 2);
      newPosition=newPosition % (gameField.getField().length - 2);
      gameField.getField()[newPosition + 1][row + 1]=line[i];
    }
  }
 else {
    Tile line[]=new Tile[gameField.getField()[0].length - 2];
    for (int i=0; i < gameField.getField()[0].length - 2; i++) {
      line[i]=gameField.getField()[row + 1][i + 1];
      gameField.getField()[row + 1][i + 1]=null;
    }
    for (int i=0; i < gameField.getField()[0].length - 2; i++) {
      int newPosition=(i + steps);
      newPosition=shiftToPositive(newPosition,gameField.getField()[0].length - 2);
      newPosition=newPosition % (gameField.getField()[0].length - 2);
      gameField.getField()[row + 1][newPosition + 1]=line[i];
    }
  }
}

Fixed version (ground truth):
public void shiftLine(GameField gameField,boolean horizontal,int row,int steps){
  if (horizontal) {
    if (row < gameField.getField().length - 2) {
      Tile line[]=new Tile[gameField.getField().length - 2];
      for (int i=0; i < gameField.getField().length - 2; i++) {
        line[i]=gameField.getField()[i + 1][row + 1];
        gameField.getField()[i + 1][row + 1]=null;
      }
      for (int i=0; i < gameField.getField().length - 2; i++) {
        int newPosition=i + steps;
        newPosition=shiftToPositive(newPosition,gameField.getField().length - 2);
        newPosition=newPosition % (gameField.getField().length - 2);
        gameField.getField()[newPosition + 1][row + 1]=line[i];
      }
    }
  }
 else {
    if (row < gameField.getField()[0].length - 2) {
      Tile line[]=new Tile[gameField.getField()[0].length - 2];
      for (int i=0; i < gameField.getField()[0].length - 2; i++) {
        line[i]=gameField.getField()[row + 1][i + 1];
        gameField.getField()[row + 1][i + 1]=null;
      }
      for (int i=0; i < gameField.getField()[0].length - 2; i++) {
        int newPosition=(i + steps);
        newPosition=shiftToPositive(newPosition,gameField.getField()[0].length - 2);
        newPosition=newPosition % (gameField.getField()[0].length - 2);
        gameField.getField()[row + 1][newPosition + 1]=line[i];
      }
    }
  }
}
Program: 13911
Project: 13911
Buggy source:
public GameField destroyField(GameField gameField,int minShiftCount,int maxShiftCount,int maxValue){
  GameFieldService gameFieldService=new GameFieldService();
  GameEndService gameEndService=new GameEndService();
  int shiftCount=(int)(Math.random() * (maxShiftCount - minShiftCount + 1) + minShiftCount);
  for (int i=0; i < shiftCount; i++) {
    boolean horizontal=(Math.random() > 0.5f);
    int row;
    if (horizontal) {
      row=(int)(Math.random() * (gameField.getField()[0].length - 1));
    }
 else {
      row=(int)(Math.random() * (gameField.getField().length - 1));
    }
    gameFieldService.shiftLine(gameField,horizontal,row,(int)(Math.random() * (maxValue + 1)));
  }
  return gameField;
}

Fixed version (ground truth):
public GameField destroyField(GameField gameField,int minShiftCount,int maxShiftCount,int maxValue){
  GameFieldService gameFieldService=new GameFieldService();
  GameEndService gameEndService=new GameEndService();
  int shiftCount=(int)(Math.random() * (maxShiftCount - minShiftCount + 1) + minShiftCount);
  for (int i=0; i < shiftCount; i++) {
    boolean horizontal=(Math.random() > 0.5f);
    int row;
    if (horizontal) {
      row=(int)(Math.random() * (gameField.getField()[0].length - 2));
    }
 else {
      row=(int)(Math.random() * (gameField.getField().length - 2));
    }
    gameFieldService.shiftLine(gameField,horizontal,row,(int)(Math.random() * (maxValue + 1)));
  }
  return gameField;
}
Program: 13913
Project: 13913
Buggy source:
/** 
 * Returns an instance of this Chronology that operates in the UTC time zone. Chronologies that do not operate in a time zone or are already UTC must return themself.
 * @return a version of this chronology that ignores time zones
 */
public abstract Chronology withUTC();

Fixed version (ground truth):
/** 
 * Returns an instance of this Chronology that operates in the UTC time zone. Chronologies that do not operate in a time zone or are already UTC must return themselves.
 * @return a version of this chronology that ignores time zones
 */
public abstract Chronology withUTC();
Program: 13914
Project: 13914
Buggy source:
/** 
 * Returns a copy of this date with the century of era field updated. <p> DateMidnight is immutable, so there are no set methods. Instead, this method returns a new instance with the value of century of era changed.
 * @param centuryOfEra  the centurey of era to set
 * @return a copy of this object with the field set
 * @throws IllegalArgumentException if the value is invalid
 * @since 1.3
 */
public DateMidnight withCenturyOfEra(int centuryOfEra){
  return withMillis(getChronology().centuryOfEra().set(getMillis(),centuryOfEra));
}

Fixed version (ground truth):
/** 
 * Returns a copy of this date with the century of era field updated. <p> DateMidnight is immutable, so there are no set methods. Instead, this method returns a new instance with the value of century of era changed.
 * @param centuryOfEra  the century of era to set
 * @return a copy of this object with the field set
 * @throws IllegalArgumentException if the value is invalid
 * @since 1.3
 */
public DateMidnight withCenturyOfEra(int centuryOfEra){
  return withMillis(getChronology().centuryOfEra().set(getMillis(),centuryOfEra));
}
Program: 13915
Project: 13915
Buggy source:
/** 
 * Returns a new DateTime with this field set to the maximum value for this field. <p> This operation is useful for obtaining a DateTime on the last day of the month, as month lengths vary. <pre> DateTime lastDayOfMonth = dt.dayOfMonth().withMaximumValue(); </pre> <p> Where possible, the offset from UTC will be retained, thus applications may need to call   {@link DateTime#withLaterOffsetAtOverlap()} on the resultto force the later time during a DST overlap if desired. <p> From v2.2, this method handles a daylight svaings time gap, setting the time to the last instant before the gap. <p> The DateTime attached to this property is unchanged by this call.
 * @return a copy of the DateTime with this field set to its maximum
 * @since 1.2
 */
public DateTime withMaximumValue(){
  try {
    return setCopy(getMaximumValue());
  }
 catch (  RuntimeException ex) {
    if (IllegalInstantException.isIllegalInstant(ex)) {
      long beforeGap=getChronology().getZone().previousTransition(getMillis() + DateTimeConstants.MILLIS_PER_DAY);
      return new DateTime(beforeGap,getChronology());
    }
    throw ex;
  }
}

Fixed version (ground truth):
/** 
 * Returns a new DateTime with this field set to the maximum value for this field. <p> This operation is useful for obtaining a DateTime on the last day of the month, as month lengths vary. <pre> DateTime lastDayOfMonth = dt.dayOfMonth().withMaximumValue(); </pre> <p> Where possible, the offset from UTC will be retained, thus applications may need to call   {@link DateTime#withLaterOffsetAtOverlap()} on the resultto force the later time during a DST overlap if desired. <p> From v2.2, this method handles a daylight savings time gap, setting the time to the last instant before the gap. <p> The DateTime attached to this property is unchanged by this call.
 * @return a copy of the DateTime with this field set to its maximum
 * @since 1.2
 */
public DateTime withMaximumValue(){
  try {
    return setCopy(getMaximumValue());
  }
 catch (  RuntimeException ex) {
    if (IllegalInstantException.isIllegalInstant(ex)) {
      long beforeGap=getChronology().getZone().previousTransition(getMillis() + DateTimeConstants.MILLIS_PER_DAY);
      return new DateTime(beforeGap,getChronology());
    }
    throw ex;
  }
}
Program: 13916
Project: 13916
Buggy source:
/** 
 * Returns a new DateTime with this field set to the minimum value for this field. <p> Where possible, the offset from UTC will be retained, thus applications may need to call   {@link DateTime#withEarlierOffsetAtOverlap()} on the resultto force the earlier time during a DST overlap if desired. <p> From v2.2, this method handles a daylight svaings time gap, setting the time to the first instant after the gap. <p> The DateTime attached to this property is unchanged by this call.
 * @return a copy of the DateTime with this field set to its minimum
 * @since 1.2
 */
public DateTime withMinimumValue(){
  try {
    return setCopy(getMinimumValue());
  }
 catch (  RuntimeException ex) {
    if (IllegalInstantException.isIllegalInstant(ex)) {
      long afterGap=getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY);
      return new DateTime(afterGap,getChronology());
    }
    throw ex;
  }
}

Fixed version (ground truth):
/** 
 * Returns a new DateTime with this field set to the minimum value for this field. <p> Where possible, the offset from UTC will be retained, thus applications may need to call   {@link DateTime#withEarlierOffsetAtOverlap()} on the resultto force the earlier time during a DST overlap if desired. <p> From v2.2, this method handles a daylight savings time gap, setting the time to the first instant after the gap. <p> The DateTime attached to this property is unchanged by this call.
 * @return a copy of the DateTime with this field set to its minimum
 * @since 1.2
 */
public DateTime withMinimumValue(){
  try {
    return setCopy(getMinimumValue());
  }
 catch (  RuntimeException ex) {
    if (IllegalInstantException.isIllegalInstant(ex)) {
      long afterGap=getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY);
      return new DateTime(afterGap,getChronology());
    }
    throw ex;
  }
}
Program: 13917
Project: 13917
Buggy source:
/** 
 * Returns a copy of this datetime with the century of era field updated. <p> DateTime is immutable, so there are no set methods. Instead, this method returns a new instance with the value of century of era changed.
 * @param centuryOfEra  the centurey of era to set
 * @return a copy of this object with the field set
 * @throws IllegalArgumentException if the value is invalid
 * @since 1.3
 */
public DateTime withCenturyOfEra(int centuryOfEra){
  return withMillis(getChronology().centuryOfEra().set(getMillis(),centuryOfEra));
}

Fixed version (ground truth):
/** 
 * Returns a copy of this datetime with the century of era field updated. <p> DateTime is immutable, so there are no set methods. Instead, this method returns a new instance with the value of century of era changed.
 * @param centuryOfEra  the century of era to set
 * @return a copy of this object with the field set
 * @throws IllegalArgumentException if the value is invalid
 * @since 1.3
 */
public DateTime withCenturyOfEra(int centuryOfEra){
  return withMillis(getChronology().centuryOfEra().set(getMillis(),centuryOfEra));
}
Program: 13918
Project: 13918
Buggy source:
/** 
 * Adds a value (which may be negative) to the partial instant, wrapping the whole partial if the maximum size of the partial is reached. <p> The value will be added to this field, overflowing into larger fields if necessary. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range. <p> Partial instants only contain some fields. This may result in a maximum possible value, such as TimeOfDay normally being limited to 23:59:59:999. If ths limit is reached by the addition, this method will wrap back to 00:00:00.000. In fact, you would generally only use this method for classes that have a limitation such as this. <p> For example, in the ISO chronology:<br> 10:20:30 add 20 minutes is 10:40:30<br> 10:20:30 add 45 minutes is 11:05:30<br> 10:20:30 add 16 hours is 02:20:30<br>
 * @param instant  the partial instant
 * @param fieldIndex  the index of this field in the partial
 * @param values  the values of the partial instant which should be updated
 * @param valueToAdd  the value to add, in the units of the field
 * @return the passed in values
 * @throws IllegalArgumentException if the value is invalid or the maximum instant is reached
 */
public abstract int[] addWrapPartial(ReadablePartial instant,int fieldIndex,int[] values,int valueToAdd);

Fixed version (ground truth):
/** 
 * Adds a value (which may be negative) to the partial instant, wrapping the whole partial if the maximum size of the partial is reached. <p> The value will be added to this field, overflowing into larger fields if necessary. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range. <p> Partial instants only contain some fields. This may result in a maximum possible value, such as TimeOfDay normally being limited to 23:59:59:999. If this limit is reached by the addition, this method will wrap back to 00:00:00.000. In fact, you would generally only use this method for classes that have a limitation such as this. <p> For example, in the ISO chronology:<br> 10:20:30 add 20 minutes is 10:40:30<br> 10:20:30 add 45 minutes is 11:05:30<br> 10:20:30 add 16 hours is 02:20:30<br>
 * @param instant  the partial instant
 * @param fieldIndex  the index of this field in the partial
 * @param values  the values of the partial instant which should be updated
 * @param valueToAdd  the value to add, in the units of the field
 * @return the passed in values
 * @throws IllegalArgumentException if the value is invalid or the maximum instant is reached
 */
public abstract int[] addWrapPartial(ReadablePartial instant,int fieldIndex,int[] values,int valueToAdd);
Program: 13919
Project: 13919
Buggy source:
/** 
 * Constructor.
 * @param name  the name to use
 * @param ordinal  the byte value for the oridinal index
 * @param unitType  the unit duration type
 * @param rangeType  the range duration type
 */
StandardDateTimeFieldType(String name,byte ordinal,DurationFieldType unitType,DurationFieldType rangeType){
  super(name);
  iOrdinal=ordinal;
  iUnitType=unitType;
  iRangeType=rangeType;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param name  the name to use
 * @param ordinal  the byte value for the ordinal index
 * @param unitType  the unit duration type
 * @param rangeType  the range duration type
 */
StandardDateTimeFieldType(String name,byte ordinal,DurationFieldType unitType,DurationFieldType rangeType){
  super(name);
  iOrdinal=ordinal;
  iUnitType=unitType;
  iRangeType=rangeType;
}
Program: 13920
Project: 13920
Buggy source:
/** 
 * Gets a hash code compatable with equals.
 * @return suitable hashcode
 */
public int hashCode(){
  return 57 + getID().hashCode();
}

Fixed version (ground truth):
/** 
 * Gets a hash code compatible with equals.
 * @return suitable hashcode
 */
public int hashCode(){
  return 57 + getID().hashCode();
}
Program: 13921
Project: 13921
Buggy source:
/** 
 * Creates a <code>Days</code> representing the number of whole days in the specified interval. This method corectly handles any daylight savings time changes that may occur during the interval.
 * @param interval  the interval to extract days from, null returns zero
 * @return the period in days
 * @throws IllegalArgumentException if the partials are null or invalid
 */
public static Days daysIn(ReadableInterval interval){
  if (interval == null) {
    return Days.ZERO;
  }
  int amount=BaseSingleFieldPeriod.between(interval.getStart(),interval.getEnd(),DurationFieldType.days());
  return Days.days(amount);
}

Fixed version (ground truth):
/** 
 * Creates a <code>Days</code> representing the number of whole days in the specified interval. This method correctly handles any daylight savings time changes that may occur during the interval.
 * @param interval  the interval to extract days from, null returns zero
 * @return the period in days
 * @throws IllegalArgumentException if the partials are null or invalid
 */
public static Days daysIn(ReadableInterval interval){
  if (interval == null) {
    return Days.ZERO;
  }
  int amount=BaseSingleFieldPeriod.between(interval.getStart(),interval.getEnd(),DurationFieldType.days());
  return Days.days(amount);
}