nus-yam/ex-repair huggingface dataset:
Program: 40169
Project: 40169
Buggy source:
public void removeTail(){
  body.getPositions().removeLast();
}

Fixed version (ground truth):
public void removeTail(){
  if (!body.getPositions().isEmpty()) {
    body.getPositions().removeLast();
  }
}
Program: 40170
Project: 40170
Buggy source:
public void removeHead(){
  head.getPositions().removeLast();
}

Fixed version (ground truth):
public void removeHead(){
  if (!head.getPositions().isEmpty()) {
    head.getPositions().removeLast();
  }
}
Program: 40171
Project: 40171
Buggy source:
public GameScreen(){
  gameMaster=new GameMaster();
}

Fixed version (ground truth):
public GameScreen(){
  gameMaster=new GameMaster(GameBoard.getINSTANCE());
}
Program: 40173
Project: 40173
Buggy source:
public void gameLoop(){
  for (  Agent agent : agents) {
    agent.updatePlayerState();
  }
  this.playerController.updatePlayerState(new GlobalGameState());
  for (  Agent agent : agents) {
    agent.generateMove();
  }
  Map<PlayerHandler,AgentChoice> playerStatus=this.playerController.getPlayerStatus();
  for (  PlayerHandler playerHandler : playerStatus.keySet()) {
  }
  for (  Agent agent : agents) {
    validateEvents(agent);
  }
  for (  Agent agent : agents) {
    List<GameEvent> gameEvents=agent.getGameEvents();
    int collectedPoints=0;
    for (    GameEvent gameEvent : gameEvents) {
switch (gameEvent) {
case DIEDED:
        agent.kill();
      deadAgents.add(agent);
    break;
case MOVED:
  agent.moveToNextPosition();
break;
case COLLISION_WITH_LEVEL:
agent.setConfused(true);
collectedPoints--;
break;
case HIT_HIMSELF:
collectedPoints--;
agent.setGhostMode();
break;
case HIT_AGENT:
agent.setConfused(true);
collectedPoints++;
break;
case HIT_BY_AGENT:
if (!agent.isGhostMode()) {
collectedPoints--;
}
agent.setGhostMode();
break;
case CONSUMED_POINT:
collectedPoints++;
break;
}
}
if (collectedPoints <= 0) {
agent.removeTail();
if (collectedPoints <= -1) {
agent.removeTail();
}
}
agent.endround();
}
for (Agent agent : deadAgents) {
agents.remove(agent);
}
level.spreadPoints();
}

Fixed version (ground truth):
public void gameLoop(){
  for (  Agent agent : agents) {
    agent.updatePlayerState();
  }
  this.playerController.updatePlayerState(new GlobalGameState());
  for (  Agent agent : agents) {
    agent.generateMove();
  }
  Map<PlayerHandler,AgentChoice> playerStatus=this.playerController.getPlayerStatus();
  for (  PlayerHandler playerHandler : playerStatus.keySet()) {
    playerHandler.getGameObject();
    AgentChoice agentChoice=playerStatus.get(playerHandler);
    boolean hasChosen=agentChoice.isHasChosen();
    AgentMovement agentMovement=agentChoice.getAgentMovement();
  }
  for (  Agent agent : agents) {
    validateEvents(agent);
  }
  for (  Agent agent : agents) {
    List<GameEvent> gameEvents=agent.getGameEvents();
    int collectedPoints=0;
    for (    GameEvent gameEvent : gameEvents) {
switch (gameEvent) {
case DIEDED:
        agent.kill();
      deadAgents.add(agent);
    break;
case MOVED:
  agent.moveToNextPosition();
break;
case COLLISION_WITH_LEVEL:
agent.setConfused(true);
collectedPoints--;
break;
case HIT_HIMSELF:
collectedPoints--;
agent.setGhostMode();
break;
case HIT_AGENT:
agent.setConfused(true);
collectedPoints++;
break;
case HIT_BY_AGENT:
if (!agent.isGhostMode()) {
collectedPoints--;
}
agent.setGhostMode();
break;
case CONSUMED_POINT:
collectedPoints++;
break;
}
}
if (collectedPoints <= 0) {
agent.removeTail();
if (collectedPoints <= -1) {
agent.removeTail();
}
}
agent.endround();
}
for (Agent agent : deadAgents) {
agents.remove(agent);
}
level.spreadPoints();
}
Program: 40174
Project: 40174
Buggy source:
public GameMaster(Level level){
  this.level=level;
  brainySnakePlayers.add(playerOne);
  brainySnakePlayers.add(playerTwo);
  brainySnakePlayers.add(playerThree);
  brainySnakePlayers.add(playerFour);
  Map<Orientation,Snake> brainySnakePlayersUiModel=new HashMap<Orientation,Snake>();
  brainySnakePlayersUiModel.put(UP,level.createStartingGameObject(UP,Config.INITIAL_PLAYER_LENGTH));
  brainySnakePlayersUiModel.put(DOWN,level.createStartingGameObject(DOWN,Config.INITIAL_PLAYER_LENGTH));
  brainySnakePlayersUiModel.put(RIGHT,level.createStartingGameObject(RIGHT,Config.INITIAL_PLAYER_LENGTH));
  brainySnakePlayersUiModel.put(LEFT,level.createStartingGameObject(LEFT,Config.INITIAL_PLAYER_LENGTH));
  playerController=new PlayerController(brainySnakePlayers,brainySnakePlayersUiModel);
}

Fixed version (ground truth):
public GameMaster(Level level){
  this.level=level;
  brainySnakePlayers.add(playerOne);
  Map<Orientation,Snake> brainySnakePlayersUiModel=new HashMap<Orientation,Snake>();
  brainySnakePlayersUiModel.put(UP,level.createStartingGameObject(UP,Config.INITIAL_PLAYER_LENGTH));
  playerController=new PlayerController(brainySnakePlayers,brainySnakePlayersUiModel);
}
Program: 40175
Project: 40175
Buggy source:
private void validateEvents(PlayerHandler playerHandler,PlayerChoice playerChoice){
  List<RoundEvents> roundEvents=playerHandler.getRoundEvents();
  if (playerHandler.getSnake().countPoints() <= 1) {
    roundEvents.add(DIEDED);
    return;
  }
  Point2D nextPosition=playerHandler.getNextPosition();
  if (level.checkCollision(nextPosition.x,nextPosition.y)) {
    roundEvents.add(COLLISION_WITH_LEVEL);
    return;
  }
  if (playerChoice.isHasChosen() && playerHandler.isOrientationValid(playerChoice.getOrientation())) {
    playerHandler.setCurrentOrientation(playerChoice.getOrientation());
    roundEvents.add(MOVED);
  }
  for (  PlayerHandler player : playerController.getPlayerHandlerList()) {
    if (playerHandler.gotBitten(nextPosition)) {
      if (player.equals(playerHandler)) {
        roundEvents.add(BIT_HIMSELF);
      }
 else {
        roundEvents.add(BIT_AGENT);
        player.getRoundEvents().add(BIT_BY_AGENT);
      }
    }
  }
  if (level.tryConsumePoint(nextPosition)) {
    roundEvents.add(CONSUMED_POINT);
  }
}

Fixed version (ground truth):
private void validateEvents(PlayerHandler playerHandler,PlayerChoice playerChoice){
  List<RoundEvents> roundEvents=playerHandler.getRoundEvents();
  if (playerHandler.isDead() || playerHandler.getSnake().countPoints() <= 1) {
    roundEvents.add(DIEDED);
    return;
  }
  Point2D nextPosition=playerHandler.getNextPosition();
  if (level.checkCollision(nextPosition.x,nextPosition.y)) {
    roundEvents.add(COLLISION_WITH_LEVEL);
    return;
  }
  if (playerChoice.isHasChosen() && playerHandler.isOrientationValid(playerChoice.getOrientation())) {
    playerHandler.setCurrentOrientation(playerChoice.getOrientation());
    roundEvents.add(MOVED);
  }
 else {
    roundEvents.add(CONFUSED);
  }
  for (  PlayerHandler player : playerController.getPlayerHandlerList()) {
    if (playerHandler.gotBitten(nextPosition)) {
      if (player.equals(playerHandler)) {
        roundEvents.add(BIT_HIMSELF);
      }
 else {
        roundEvents.add(BIT_AGENT);
        player.getRoundEvents().add(BIT_BY_AGENT);
      }
    }
  }
  if (level.tryConsumePoint(nextPosition)) {
    roundEvents.add(CONSUMED_POINT);
  }
}
Program: 40176
Project: 40176
Buggy source:
public void gameLoop(){
  this.playerController.updatePlayerState(new GlobalGameState());
  Map<PlayerHandler,PlayerChoice> playerStatus=this.playerController.getPlayerStatus();
  for (  PlayerHandler playerHandler : playerStatus.keySet()) {
    PlayerChoice playerChoice=playerStatus.get(playerHandler);
    validateEvents(playerHandler,playerChoice);
  }
  List<PlayerHandler> deadPlayer=new ArrayList<PlayerHandler>();
  for (  PlayerHandler playerHandler : playerController.getPlayerHandlerList()) {
    List<RoundEvents> roundEvents=playerHandler.getRoundEvents();
    int collectedPoints=0;
    for (    RoundEvents roundEvent : roundEvents) {
switch (roundEvent) {
case DIEDED:
        playerHandler.kill();
      deadPlayer.add(playerHandler);
    break;
case MOVED:
  playerHandler.moveToNextPosition();
break;
case COLLISION_WITH_LEVEL:
playerHandler.setConfused(true);
collectedPoints--;
break;
case BIT_HIMSELF:
collectedPoints--;
playerHandler.setGhostMode();
break;
case BIT_AGENT:
playerHandler.setGhostMode();
collectedPoints++;
break;
case BIT_BY_AGENT:
if (!playerHandler.isGhostMode()) {
collectedPoints--;
}
break;
case CONSUMED_POINT:
collectedPoints++;
break;
}
}
if (collectedPoints < 0) {
}
playerHandler.endround();
}
for (PlayerHandler dead : deadPlayer) {
playerController.getPlayerHandlerList().remove(dead);
}
level.spreadPoints();
}

Fixed version (ground truth):
public void gameLoop(){
  this.playerController.updatePlayerState(new GlobalGameState());
  Map<PlayerHandler,PlayerChoice> playerStatus=this.playerController.getPlayerStatus();
  for (  PlayerHandler playerHandler : playerStatus.keySet()) {
    PlayerChoice playerChoice=playerStatus.get(playerHandler);
    validateEvents(playerHandler,playerChoice);
  }
  List<PlayerHandler> deadPlayer=new ArrayList<PlayerHandler>();
  for (  PlayerHandler playerHandler : playerController.getPlayerHandlerList()) {
    List<RoundEvents> roundEvents=playerHandler.getRoundEvents();
    int collectedPoints=0;
    for (    RoundEvents roundEvent : roundEvents) {
switch (roundEvent) {
case DIEDED:
        playerHandler.kill();
      deadPlayer.add(playerHandler);
    break;
case MOVED:
  playerHandler.moveToNextPosition();
break;
case CONFUSED:
playerHandler.setConfused(true);
collectedPoints++;
break;
case COLLISION_WITH_LEVEL:
playerHandler.setConfused(true);
collectedPoints--;
break;
case BIT_HIMSELF:
collectedPoints--;
playerHandler.setGhostMode();
break;
case BIT_AGENT:
playerHandler.setGhostMode();
collectedPoints++;
break;
case BIT_BY_AGENT:
if (!playerHandler.isGhostMode()) {
collectedPoints--;
}
break;
case CONSUMED_POINT:
collectedPoints++;
break;
}
}
if (collectedPoints <= 0) {
playerHandler.penalty();
if (collectedPoints < -1) {
playerHandler.penalty();
}
}
playerHandler.endround();
playerHandler.update();
}
for (PlayerHandler dead : deadPlayer) {
playerController.getPlayerHandlerList().remove(dead);
}
level.spreadPoints();
}
Program: 40177
Project: 40177
Buggy source:
public void penalty(){
  snake.removeTail();
}

Fixed version (ground truth):
public void penalty(){
  if (snake.countPoints() <= 1) {
    dead=true;
  }
 else {
    snake.removeTail();
  }
}
Program: 40178
Project: 40178
Buggy source:
private void update(float delta){
  if (dead) {
    return;
  }
  if (ghostMode) {
    ghostMode();
  }
 else   if (confused) {
    blink();
  }
}

Fixed version (ground truth):
public void update(){
  if (dead) {
    return;
  }
  if (ghostMode) {
    ghostMode();
  }
 else   if (confused) {
    blink();
  }
}
Program: 40179
Project: 40179
Buggy source:
private void ghostMode(){
  if (ghostTime++ > Config.GHOST_TIME) {
    ghostTime=0;
    snake.setGhostMode();
    ghostMode=false;
  }
 else {
    snake.reset();
  }
}

Fixed version (ground truth):
private void ghostMode(){
  if (ghostTime++ > Config.GHOST_TIME) {
    ghostTime=0;
    snake.reset();
    ghostMode=false;
  }
 else {
    snake.setGhostMode();
  }
}
Program: 40180
Project: 40180
Buggy source:
private void blink(){
  blinked=!blinked;
  if (blinked) {
    snake.blink();
  }
 else {
    snake.reset();
  }
}

Fixed version (ground truth):
private void blink(){
  if (blinkTime++ > Config.BLINK_TIME) {
    blinkTime=0;
    blinked=!blinked;
  }
  if (blinked) {
    snake.reset();
  }
 else {
    snake.blink();
  }
}
Program: 40181
Project: 40181
Buggy source:
public void setGhostMode(){
  this.ghostMode=true;
}

Fixed version (ground truth):
public void setGhostMode(){
  ghostMode=true;
  ghostTime=0;
}
Program: 40182
Project: 40182
Buggy source:
public void setGhostMode(){
  head.getColor().a*=Config.GHOSTMODE_OPACITY;
  body.getColor().a*=Config.GHOSTMODE_OPACITY;
}

Fixed version (ground truth):
public void setGhostMode(){
  head.setColor(Config.GHOSTMODE_COLOR);
  body.setColor(Config.GHOSTMODE_COLOR);
}
Program: 40183
Project: 40183
Buggy source:
public void setColor(Color color){
  headColor=color;
  bodyColor=new Color(color);
  bodyColor.a=Config.SNAKE_BODY_LIGHTING;
}

Fixed version (ground truth):
public void setColor(Color color){
  headColor=new Color(color);
  bodyColor=new Color(color);
  bodyColor.a=Config.SNAKE_BODY_LIGHTING;
  head.setColor(headColor);
  body.setColor(bodyColor);
}
Program: 40184
Project: 40184
Buggy source:
public void setNextPosition(Point2D nextPosition){
  body.getPositions().removeLast();
  body.getPositions().addFirst(getHeadPosition());
  setHead(nextPosition);
}

Fixed version (ground truth):
public void setNextPosition(Point2D nextPosition){
  body.getPositions().addFirst(getHeadPosition());
  setHead(nextPosition);
}
Program: 40185
Project: 40185
Buggy source:
public void getNextMoveActions(){
  for (  Agent agent : agents) {
    agent.updatePlayerState();
  }
  for (  Agent agent : agents) {
    agent.generateMove();
  }
  for (  Agent agent : agents) {
    validateEvents(agent);
  }
  for (  Agent agent : agents) {
    List<GameEvent> gameEvents=agent.getGameEvents();
    int collectedPoints=0;
    for (    GameEvent gameEvent : gameEvents) {
switch (gameEvent) {
case MOVED:
        agent.moveToNextPosition();
      break;
case COLLISION_WITH_LEVEL:
    agent.setConfused(true);
  collectedPoints--;
case HIT_HIMSELF:
collectedPoints--;
agent.setGhostMode();
break;
case HIT_AGENT:
agent.setConfused(true);
collectedPoints++;
break;
case HIT_BY_AGENT:
if (!agent.isGhostMode()) {
collectedPoints--;
}
agent.setGhostMode();
break;
case CONSUMED_POINT:
collectedPoints++;
case DIEDED:
break;
}
}
if (collectedPoints <= 0) {
agent.removeTail();
}
agent.endround();
}
level.spreadPoints();
}

Fixed version (ground truth):
public void getNextMoveActions(){
  for (  Agent agent : agents) {
    agent.updatePlayerState();
  }
  for (  Agent agent : agents) {
    agent.generateMove();
  }
  for (  Agent agent : agents) {
    validateEvents(agent);
  }
  for (  Agent agent : agents) {
    List<GameEvent> gameEvents=agent.getGameEvents();
    int collectedPoints=0;
    for (    GameEvent gameEvent : gameEvents) {
switch (gameEvent) {
case MOVED:
        agent.moveToNextPosition();
      break;
case COLLISION_WITH_LEVEL:
    agent.setConfused(true);
  collectedPoints--;
break;
case HIT_HIMSELF:
collectedPoints--;
agent.setGhostMode();
break;
case HIT_AGENT:
agent.setConfused(true);
collectedPoints++;
break;
case HIT_BY_AGENT:
if (!agent.isGhostMode()) {
collectedPoints--;
}
agent.setGhostMode();
break;
case CONSUMED_POINT:
collectedPoints++;
case DIEDED:
break;
}
}
if (collectedPoints <= 0) {
agent.removeTail();
if (collectedPoints <= -1) {
agent.removeTail();
}
}
agent.endround();
}
level.spreadPoints();
}
Program: 40186
Project: 40186
Buggy source:
@After public void afterEach() throws InterruptedException {
  TimeUnit.SECONDS.sleep(10l);
}

Fixed version (ground truth):
@After public void afterEach() throws InterruptedException {
  TimeUnit.SECONDS.sleep(11l);
}
Program: 40187
Project: 40187
Buggy source:
@Bean final ListenerContainerLifecycleManager listenerContainerLifecycleManager(){
  ListenerContainerLifecycleManager listenerContainerLifecycleManager=new ListenerContainerLifecycleManager();
  listenerContainerLifecycleManager.setConnectionFactory(connectionFactory);
  return listenerContainerLifecycleManager;
}

Fixed version (ground truth):
@Bean ListenerContainerLifecycleManager listenerContainerLifecycleManager(){
  ListenerContainerLifecycleManager listenerContainerLifecycleManager=new ListenerContainerLifecycleManager();
  listenerContainerLifecycleManager.setConnectionFactory(connectionFactory);
  return listenerContainerLifecycleManager;
}
Program: 40188
Project: 40188
Buggy source:
@Bean final EventBus eventBus(final SimpleCluster simpleCluster){
  return new ClusteringEventBus(new DefaultClusterSelector(simpleCluster),terminal());
}

Fixed version (ground truth):
@Bean EventBus eventBus(final SimpleCluster simpleCluster){
  return new ClusteringEventBus(new DefaultClusterSelector(simpleCluster),terminal());
}
Program: 40189
Project: 40189
Buggy source:
@Bean final SpringAMQPConsumerConfiguration springAMQPConsumerConfiguration(){
  SpringAMQPConsumerConfiguration amqpConsumerConfiguration=new SpringAMQPConsumerConfiguration();
  amqpConsumerConfiguration.setTxSize(10);
  amqpConsumerConfiguration.setTransactionManager(transactionManager);
  amqpConsumerConfiguration.setQueueName(uniqueQueueName);
  return amqpConsumerConfiguration;
}

Fixed version (ground truth):
@Bean SpringAMQPConsumerConfiguration springAMQPConsumerConfiguration(){
  SpringAMQPConsumerConfiguration amqpConsumerConfiguration=new SpringAMQPConsumerConfiguration();
  amqpConsumerConfiguration.setTxSize(10);
  amqpConsumerConfiguration.setTransactionManager(transactionManager);
  amqpConsumerConfiguration.setQueueName(uniqueQueueName);
  return amqpConsumerConfiguration;
}
Program: 40190
Project: 40190
Buggy source:
@Bean final SimpleCluster simpleCluster(final SpringAMQPConsumerConfiguration springAMQPConsumerConfiguration){
  SimpleCluster simpleCluster=new SimpleCluster(uniqueQueueName);
  simpleCluster.getMetaData().setProperty(AMQP_CONFIG_KEY,springAMQPConsumerConfiguration);
  return simpleCluster;
}

Fixed version (ground truth):
@Bean SimpleCluster simpleCluster(final SpringAMQPConsumerConfiguration springAMQPConsumerConfiguration){
  SimpleCluster simpleCluster=new SimpleCluster(uniqueQueueName);
  simpleCluster.getMetaData().setProperty(AMQP_CONFIG_KEY,springAMQPConsumerConfiguration);
  return simpleCluster;
}
Program: 40191
Project: 40191
Buggy source:
@Bean final EventBusTerminal terminal(){
  SpringAMQPTerminal terminal=new SpringAMQPTerminal();
  terminal.setConnectionFactory(connectionFactory);
  terminal.setSerializer(axonJsonSerializer());
  terminal.setExchangeName(terminalName);
  terminal.setListenerContainerLifecycleManager(listenerContainerLifecycleManager());
  terminal.setDurable(true);
  terminal.setTransactional(true);
  return terminal;
}

Fixed version (ground truth):
@Bean EventBusTerminal terminal(){
  SpringAMQPTerminal terminal=new SpringAMQPTerminal();
  terminal.setConnectionFactory(connectionFactory);
  terminal.setSerializer(axonJsonSerializer());
  terminal.setExchangeName(terminalName);
  terminal.setListenerContainerLifecycleManager(listenerContainerLifecycleManager());
  terminal.setDurable(true);
  terminal.setTransactional(true);
  return terminal;
}
Program: 40192
Project: 40192
Buggy source:
@Bean final JacksonSerializer axonJsonSerializer(){
  return new JacksonSerializer();
}

Fixed version (ground truth):
@Bean JacksonSerializer axonJsonSerializer(){
  return new JacksonSerializer();
}
Program: 40193
Project: 40193
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public void add(@PathVariable(value="String_Node_Str") String id,@RequestParam(value="String_Node_Str",required=true) String description,HttpServletResponse response){
  CreateOrderCommand command=new CreateOrderCommand(id,description);
  commandGateway.sendAndWait(command);
  response.setStatus(HttpServletResponse.SC_CREATED);
  return;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public void add(@PathVariable(value="String_Node_Str") String id,@RequestParam(value="String_Node_Str",required=true) String description,HttpServletResponse response){
  try {
    CreateOrderCommand command=new CreateOrderCommand(id,description);
    commandGateway.sendAndWait(command);
    response.setStatus(HttpServletResponse.SC_CREATED);
    return;
  }
 catch (  CommandExecutionException cex) {
    response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
    if (null != cex.getCause()) {
      if (cex.getCause() instanceof ConcurrencyException) {
        response.setStatus(HttpServletResponse.SC_CONFLICT);
      }
    }
  }
}
Program: 40195
Project: 40195
Buggy source:
/** 
 * 开启数据统计 这将会在异步执行
 * @return 是否运行成功.
 */
public boolean start(){
  if (task != null) {
    return true;
  }
  timer=new StatisticsTimer();
  MinecraftForge.EVENT_BUS.register(timer);
  task=new Thread(new Runnable(){
    @Override public void run(){
      try {
        postPlugin();
      }
 catch (      final Throwable e) {
        if (debug) {
          e.printStackTrace();
        }
      }
    }
  }
);
  task.start();
  return true;
}

Fixed version (ground truth):
/** 
 * 开启数据统计 这将会在异步执行
 * @return 是否运行成功.
 */
public boolean start(){
  if (task != null) {
    return true;
  }
  task=new Thread(new Runnable(){
    @Override public void run(){
      try {
        postPlugin();
      }
 catch (      final Throwable e) {
        if (debug) {
          e.printStackTrace();
        }
      }
    }
  }
);
  task.start();
  return true;
}
Program: 40196
Project: 40196
Buggy source:
@Override public void run(){
  long startTime=System.nanoTime();
  long timeSpent=(startTime - lastPoll) / 1000;
  if (history.size() > 10) {
    history.removeFirst();
  }
  double ttps=2.0E7D / (timeSpent == 0 ? 1 : timeSpent);
  if (ttps <= 21.0D) {
    history.add(ttps);
  }
  lastPoll=startTime;
}

Fixed version (ground truth):
@Override public void run(){
  try {
    postPlugin();
  }
 catch (  final Throwable e) {
    if (debug) {
      e.printStackTrace();
    }
  }
}
Program: 40197
Project: 40197
Buggy source:
public CraftLivingEntity(final CraftServer server,final net.minecraft.entity.EntityLivingBase entity){
  super(server,entity);
  updateEntity(entity);
  if (entity instanceof net.minecraft.entity.EntityLiving) {
    equipment=new CraftEntityEquipment(this);
  }
}

Fixed version (ground truth):
public CraftLivingEntity(final CraftServer server,final net.minecraft.entity.EntityLivingBase entity){
  super(server,entity);
  this.entityClass=entity.getClass();
  this.entityName=EntityRegistry.getCustomEntityTypeName(entityClass);
  if (entityName == null)   entityName=entity.getCommandSenderName();
  if (entity instanceof net.minecraft.entity.EntityLiving) {
    equipment=new CraftEntityEquipment(this);
  }
}
Program: 40198
Project: 40198
Buggy source:
@Override public void respawn(){
  if (getHealth() <= 0 && isOnline()) {
    server.getServer().getConfigurationManager().respawnPlayer(getHandle(),0,false);
  }
}

Fixed version (ground truth):
@Override public void respawn(){
  if (getHealth() <= 0 && isOnline()) {
    server.getServer().getConfigurationManager().respawnPlayer(getHandle(),0,TeleportCause.DEATH,null);
  }
}
Program: 40199
Project: 40199
Buggy source:
@Override public boolean teleport(Location location,PlayerTeleportEvent.TeleportCause cause){
  net.minecraft.entity.player.EntityPlayerMP entity=getHandle();
  if (getHealth() == 0 || entity.isDead) {
    return false;
  }
  if (entity.playerNetServerHandler == null || entity.playerNetServerHandler.isDisconnected()) {
    return false;
  }
  Location from=this.getLocation();
  Location to=location;
  PlayerTeleportEvent event=new PlayerTeleportEvent(this,from,to,cause);
  server.getPluginManager().callEvent(event);
  if (event.isCancelled()) {
    return false;
  }
  eject();
  leaveVehicle();
  from=event.getFrom();
  to=event.getTo();
  net.minecraft.world.WorldServer fromWorld=((CraftWorld)from.getWorld()).getHandle();
  net.minecraft.world.WorldServer toWorld=((CraftWorld)to.getWorld()).getHandle();
  if (getHandle().openContainer != getHandle().inventoryContainer) {
    getHandle().closeScreen();
  }
  if (fromWorld == toWorld) {
    entity.playerNetServerHandler.teleport(to);
  }
 else {
    server.getHandle().respawnPlayer(entity,toWorld.dimension,false,to,cause);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean teleport(Location location,PlayerTeleportEvent.TeleportCause cause){
  net.minecraft.entity.player.EntityPlayerMP entity=getHandle();
  if (getHealth() == 0 || entity.isDead) {
    return false;
  }
  if (entity.playerNetServerHandler == null || entity.playerNetServerHandler.isDisconnected()) {
    return false;
  }
  Location from=this.getLocation();
  Location to=location;
  PlayerTeleportEvent event=new PlayerTeleportEvent(this,from,to,cause);
  server.getPluginManager().callEvent(event);
  if (event.isCancelled()) {
    return false;
  }
  eject();
  leaveVehicle();
  from=event.getFrom();
  to=event.getTo();
  net.minecraft.world.WorldServer fromWorld=((CraftWorld)from.getWorld()).getHandle();
  net.minecraft.world.WorldServer toWorld=((CraftWorld)to.getWorld()).getHandle();
  if (getHandle().openContainer != getHandle().inventoryContainer) {
    getHandle().closeScreen();
  }
  if (fromWorld == toWorld) {
    entity.playerNetServerHandler.teleport(to);
  }
 else {
    server.getHandle().respawnPlayer(entity,toWorld.dimension,cause,to);
  }
  return true;
}
Program: 40201
Project: 40201
Buggy source:
@Override public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<IgniteQueryDescriptor> backendQuery,QueryParameters queryParameters,TupleContext tupleContext){
  IgniteCache<Object,BinaryObject> cache;
  if (backendQuery.getSingleEntityMetadataInformationOrNull() != null) {
    cache=provider.getEntityCache(backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata());
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  QueryHints hints=(new QueryHints.Builder(queryParameters.getQueryHints())).build();
  SqlFieldsQuery sqlQuery=provider.createSqlFieldsQueryWithLog(backendQuery.getQuery().getSql(),hints,backendQuery.getQuery().getIndexedParameters() != null ? backendQuery.getQuery().getIndexedParameters().toArray() : null);
  Iterable<List<?>> result=executeWithHints(cache,sqlQuery,hints);
  if (backendQuery.getSingleEntityMetadataInformationOrNull() != null) {
    return new IgnitePortableFromProjectionResultCursor(result,queryParameters.getRowSelection(),backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata());
  }
 else   if (backendQuery.getQuery().isHasScalar()) {
    throw new NotYetImplementedException();
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<IgniteQueryDescriptor> backendQuery,QueryParameters queryParameters,TupleContext tupleContext){
  IgniteCache<Object,BinaryObject> cache;
  if (backendQuery.getSingleEntityMetadataInformationOrNull() != null) {
    cache=provider.getEntityCache(backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata());
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  QueryHints hints=(new QueryHints.Builder(null)).build();
  SqlFieldsQuery sqlQuery=provider.createSqlFieldsQueryWithLog(backendQuery.getQuery().getSql(),hints,backendQuery.getQuery().getIndexedParameters() != null ? backendQuery.getQuery().getIndexedParameters().toArray() : null);
  Iterable<List<?>> result=executeWithHints(cache,sqlQuery,hints);
  if (backendQuery.getSingleEntityMetadataInformationOrNull() != null) {
    return new IgnitePortableFromProjectionResultCursor(result,queryParameters.getRowSelection(),backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata());
  }
 else   if (backendQuery.getQuery().isHasScalar()) {
    throw new NotYetImplementedException();
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}
Program: 40204
Project: 40204
Buggy source:
@Test public void testUnidirectionalManyToMany(){
  Session session=openSession();
  Transaction tx=session.beginTransaction();
  Student john=new Student("String_Node_Str","String_Node_Str");
  Student kate=new Student("String_Node_Str","String_Node_Str");
  Student mario=new Student("String_Node_Str","String_Node_Str");
  ClassRoom math=new ClassRoom(1L,"String_Node_Str");
  math.getStudents().add(john);
  math.getStudents().add(mario);
  ClassRoom english=new ClassRoom(2L,"String_Node_Str");
  english.getStudents().add(kate);
  math.getStudents().add(mario);
  persist(session,math,english,john,mario,kate);
  tx.commit();
  assertThat(getNumberOfEntities(sessionFactory)).isEqualTo(5);
  assertThat(getNumberOfAssociations(sessionFactory)).isEqualTo(expectedAssociationNumber());
  session.clear();
  delete(session,math,english,john,mario,kate);
  session.close();
  checkCleanCache();
}

Fixed version (ground truth):
@Test public void testUnidirectionalManyToMany(){
  Session session=openSession();
  Transaction tx=session.beginTransaction();
  Student john=new Student("String_Node_Str","String_Node_Str");
  Student kate=new Student("String_Node_Str","String_Node_Str");
  Student mario=new Student("String_Node_Str","String_Node_Str");
  ClassRoom math=new ClassRoom(1L,"String_Node_Str");
  math.getStudents().add(john);
  math.getStudents().add(mario);
  ClassRoom english=new ClassRoom(2L,"String_Node_Str");
  english.getStudents().add(kate);
  english.getStudents().add(mario);
  persist(session,math,english,john,mario,kate);
  tx.commit();
  assertThat(getNumberOfEntities(sessionFactory)).isEqualTo(5);
  assertThat(getNumberOfAssociations(sessionFactory)).isEqualTo(expectedAssociationNumber());
  session.clear();
  delete(session,math,english,john,mario,kate);
  session.close();
  checkCleanCache();
}
Program: 40205
Project: 40205
Buggy source:
/** 
 * Create a String representation of the identifier key in the format of   {@code Identifiers:(table name):(columnId)}.  {@see #IDENTIFIERS}
 * @param key Key for the identifier
 * @return byte array containing the key
 */
protected String identifierId(IdSourceKey key){
  String prefix=IDENTIFIERS + "String_Node_Str" + key.getTable();
  if (key.getColumnName() != null) {
    String entityId=key.getColumnValue();
    return prefix + "String_Node_Str" + entityId;
  }
  return prefix;
}

Fixed version (ground truth):
/** 
 * Create a String representation of the identifier key in the format of   {@code Identifiers:(table name):(columnId)}.  {@link #IDENTIFIERS}
 * @param key Key for the identifier
 * @return byte array containing the key
 */
protected String identifierId(IdSourceKey key){
  String prefix=IDENTIFIERS + "String_Node_Str" + key.getTable();
  if (key.getColumnName() != null) {
    String entityId=key.getColumnValue();
    return prefix + "String_Node_Str" + entityId;
  }
  return prefix;
}
Program: 40206
Project: 40206
Buggy source:
/** 
 * Create a String representation of the entity key in the format of   {@code Association:(table name):(columnId)}.  {@see #ASSOCIATIONS}
 * @param key Key of the association
 * @return byte array containing the key
 */
protected String associationId(AssociationKey key){
  String prefix=ASSOCIATIONS + "String_Node_Str" + key.getTable()+ "String_Node_Str";
  String entityId=keyToString(key.getColumnNames(),key.getColumnValues()) + "String_Node_Str" + key.getMetadata().getCollectionRole();
  return prefix + entityId;
}

Fixed version (ground truth):
/** 
 * Create a String representation of the entity key in the format of   {@code Association:(table name):(columnId)}.  {@link #ASSOCIATIONS}
 * @param key Key of the association
 * @return byte array containing the key
 */
protected String associationId(AssociationKey key){
  String prefix=ASSOCIATIONS + "String_Node_Str" + key.getTable()+ "String_Node_Str";
  String entityId=keyToString(key.getColumnNames(),key.getColumnValues()) + "String_Node_Str" + key.getMetadata().getCollectionRole();
  return prefix + entityId;
}
Program: 40207
Project: 40207
Buggy source:
/** 
 * Invoked by Jackson for any non-static property. <p/> A   {@link Map} creates an additional set of properties, one for each entry of the map.
 * @param name the property name
 * @param value the property value
 */
@JsonAnySetter @SuppressWarnings("String_Node_Str") public void set(String name,Object value){
  if (value instanceof Map) {
    setMapValue(name,(Map<String,Object>)value);
  }
 else {
    properties.put(name,value);
  }
}

Fixed version (ground truth):
/** 
 * Invoked by Jackson for any non-static property. <p> A   {@link Map} creates an additional set of properties, one for each entry of the map.
 * @param name the property name
 * @param value the property value
 */
@JsonAnySetter @SuppressWarnings("String_Node_Str") public void set(String name,Object value){
  if (value instanceof Map) {
    setMapValue(name,(Map<String,Object>)value);
  }
 else {
    properties.put(name,value);
  }
}
Program: 40208
Project: 40208
Buggy source:
@Test public void testOverriddenTypeInDialect() throws Exception {
  final EntityManagerFactory emf=Persistence.createEntityManagerFactory("String_Node_Str");
  final EntityManager em=emf.createEntityManager();
  em.getTransaction().begin();
  try {
    Poem poem=new Poem();
    poem.setName("String_Node_Str");
    poem.setPoemSocietyId(UUID.randomUUID());
    poem.setCreation(new Date());
    em.persist(poem);
    em.getTransaction().commit();
    assertThat(true).as("String_Node_Str").isFalse();
  }
 catch (  RollbackException e) {
    assertThat(Throwables.getRootCause(e)).hasMessage("String_Node_Str");
  }
 finally {
    try {
      em.getTransaction().rollback();
    }
 catch (    Exception e) {
    }
    em.close();
    dropSchemaAndDatabase(emf);
    emf.close();
  }
}

Fixed version (ground truth):
@Test public void testOverriddenTypeInDialect() throws Exception {
  final EntityManagerFactory emf=Persistence.createEntityManagerFactory("String_Node_Str");
  final EntityManager em=emf.createEntityManager();
  em.getTransaction().begin();
  try {
    Poem poem=new Poem();
    poem.setName("String_Node_Str");
    poem.setPoemSocietyId(UUID.randomUUID());
    poem.setCreation(new Date());
    em.persist(poem);
    em.getTransaction().commit();
    assertThat(true).as("String_Node_Str").isFalse();
  }
 catch (  RollbackException e) {
    assertThat(e.getCause().getMessage()).isEqualTo("String_Node_Str");
  }
 finally {
    try {
      em.getTransaction().rollback();
    }
 catch (    Exception e) {
    }
    em.close();
    dropSchemaAndDatabase(emf);
    emf.close();
  }
}
Program: 40209
Project: 40209
Buggy source:
@Test public void concurrentUpdateToAssociationShouldCauseException() throws Exception {
  Animal animal=createAndPersistAnimal();
  Zoo zoo=createAndPersistZoo(animal);
  doConcurrentUpdateToTheZoosAnimals();
  Transaction transaction=session.beginTransaction();
  zoo.getAnimals().remove(zoo.getAnimals().iterator().next());
  try {
    transaction.commit();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertThat(Throwables.getRootCause(e)).isInstanceOf(StaleObjectStateException.class);
  }
}

Fixed version (ground truth):
@Test(expected=StaleObjectStateException.class) public void concurrentUpdateToAssociationShouldCauseException() throws Exception {
  Animal animal=createAndPersistAnimal();
  Zoo zoo=createAndPersistZoo(animal);
  doConcurrentUpdateToTheZoosAnimals();
  Transaction transaction=session.beginTransaction();
  zoo.getAnimals().remove(zoo.getAnimals().iterator().next());
  transaction.commit();
}
Program: 40210
Project: 40210
Buggy source:
@Test public void concurrentModificationShouldCauseException() throws Exception {
  Novel novel=createAndPersistNovel();
  String newRevision=doConcurrentUpdateToNovel();
  assertThat(newRevision).isNotEqualTo(novel.get_rev());
  Transaction transaction=session.beginTransaction();
  novel.setDescription("String_Node_Str");
  try {
    transaction.commit();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertThat(Throwables.getRootCause(e)).isInstanceOf(StaleObjectStateException.class);
  }
}

Fixed version (ground truth):
@Test(expected=StaleObjectStateException.class) public void concurrentModificationShouldCauseException() throws Exception {
  Novel novel=createAndPersistNovel();
  String newRevision=doConcurrentUpdateToNovel();
  assertThat(newRevision).isNotEqualTo(novel.get_rev());
  Transaction transaction=session.beginTransaction();
  novel.setDescription("String_Node_Str");
  transaction.commit();
}
Program: 40211
Project: 40211
Buggy source:
@Test public void deletionAfterConcurrentModificationShouldCauseException() throws Exception {
  Novel novel=createAndPersistNovel();
  doConcurrentUpdateToNovel();
  Transaction transaction=session.beginTransaction();
  session.delete(novel);
  try {
    transaction.commit();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertThat(Throwables.getRootCause(e)).isInstanceOf(StaleObjectStateException.class);
  }
}

Fixed version (ground truth):
@Test(expected=StaleObjectStateException.class) public void deletionAfterConcurrentModificationShouldCauseException() throws Exception {
  Novel novel=createAndPersistNovel();
  doConcurrentUpdateToNovel();
  Transaction transaction=session.beginTransaction();
  session.delete(novel);
  transaction.commit();
}
Program: 40212
Project: 40212
Buggy source:
@Test public void mergeAfterConcurrentModificationShouldCauseException() throws Exception {
  Novel novel=createAndPersistNovel();
  session.clear();
  doConcurrentUpdateToNovel();
  session.beginTransaction();
  try {
    novel=(Novel)session.merge(novel);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertThat(Throwables.getRootCause(e)).isInstanceOf(StaleObjectStateException.class);
  }
}

Fixed version (ground truth):
@Test(expected=StaleObjectStateException.class) public void mergeAfterConcurrentModificationShouldCauseException() throws Exception {
  Novel novel=createAndPersistNovel();
  session.clear();
  doConcurrentUpdateToNovel();
  session.beginTransaction();
  novel=(Novel)session.merge(novel);
}
Program: 40213
Project: 40213
Buggy source:
@Test public void concurrentUpdateToObjectShouldCauseExceptionWhenUpdatingAssociation() throws Exception {
  Animal animal=createAndPersistAnimal();
  Zoo zoo=createAndPersistZoo(animal);
  doConcurrentUpdateToZoo();
  Transaction transaction=session.beginTransaction();
  zoo.getAnimals().remove(zoo.getAnimals().iterator().next());
  try {
    transaction.commit();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertThat(Throwables.getRootCause(e)).isInstanceOf(StaleObjectStateException.class);
  }
}

Fixed version (ground truth):
@Test(expected=StaleObjectStateException.class) public void concurrentUpdateToObjectShouldCauseExceptionWhenUpdatingAssociation() throws Exception {
  Animal animal=createAndPersistAnimal();
  Zoo zoo=createAndPersistZoo(animal);
  doConcurrentUpdateToZoo();
  Transaction transaction=session.beginTransaction();
  zoo.getAnimals().remove(zoo.getAnimals().iterator().next());
  transaction.commit();
}
Program: 40214
Project: 40214
Buggy source:
@Test public void customColumnNameShouldBeUsableForRevisionProperty() throws Exception {
  Animal animal=createAndPersistAnimal();
  String newRevision=doConcurrentUpdateToAnimal();
  assertThat(newRevision).isNotEqualTo(animal.getRevision());
  Transaction transaction=session.beginTransaction();
  animal.setName("String_Node_Str");
  try {
    transaction.commit();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertThat(Throwables.getRootCause(e)).isInstanceOf(StaleObjectStateException.class);
  }
}

Fixed version (ground truth):
@Test(expected=StaleObjectStateException.class) public void customColumnNameShouldBeUsableForRevisionProperty() throws Exception {
  Animal animal=createAndPersistAnimal();
  String newRevision=doConcurrentUpdateToAnimal();
  assertThat(newRevision).isNotEqualTo(animal.getRevision());
  Transaction transaction=session.beginTransaction();
  animal.setName("String_Node_Str");
  transaction.commit();
}
Program: 40215
Project: 40215
Buggy source:
@Test public void updateAfterConcurrentDeletionShouldCauseException() throws Exception {
  createAndPersistNovel();
  session.clear();
  Transaction transaction=session.beginTransaction();
  Novel novel=(Novel)session.get(Novel.class,"String_Node_Str");
  concurrentlyDeleteNovel();
  novel.setPosition(2);
  try {
    transaction.commit();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertThat(Throwables.getRootCause(e)).isInstanceOf(StaleObjectStateException.class);
  }
}

Fixed version (ground truth):
@Test(expected=StaleObjectStateException.class) public void updateAfterConcurrentDeletionShouldCauseException() throws Exception {
  createAndPersistNovel();
  session.clear();
  Transaction transaction=session.beginTransaction();
  Novel novel=(Novel)session.get(Novel.class,"String_Node_Str");
  concurrentlyDeleteNovel();
  novel.setPosition(2);
  transaction.commit();
}
Program: 40216
Project: 40216
Buggy source:
/** 
 * Specifies how data (entity, associations, id source) should be mapped to caches.
 * @param cacheMapping the cache mapping type to be used when not configured on the entity or property level
 * @return this context, allowing for further fluent API invocations
 */
G cacheMapping(CacheMappingType cacheMappingType);

Fixed version (ground truth):
/** 
 * Specifies how data (entity, associations, id source) should be mapped to caches.
 * @param cacheMapping the cache mapping type to be used when not configured on the entity or property level
 * @return this context, allowing for further fluent API invocations
 */
G cacheMapping(CacheMappingType cacheMapping);
Program: 40217
Project: 40217
Buggy source:
/** 
 * Adds the given row to this association, using the given row key. The row must not be null, use the   {@link #remove()} operation instead.
 * @param key the key to store the row under
 * @param value the association row to store
 */
public void put(RowKey key,Tuple value){
  Contracts.assertNotNull(value,"String_Node_Str");
  currentState.put(key,new AssociationOperation(key,value,PUT));
}

Fixed version (ground truth):
/** 
 * Adds the given row to this association, using the given row key. The row must not be null, use the   {@link org.hibernate.ogm.model.spi.Association#remove(org.hibernate.ogm.model.key.spi.RowKey)}operation instead.
 * @param key the key to store the row under
 * @param value the association row to store
 */
public void put(RowKey key,Tuple value){
  Contracts.assertNotNull(value,"String_Node_Str");
  currentState.put(key,new AssociationOperation(key,value,PUT));
}
Program: 40218
Project: 40218
Buggy source:
/** 
 * Determine the name of the column in which we will store the generator persistent value. <p> Called during   {@link #configure configuration}.
 * @param params The params supplied in the generator config (plus some standard useful extras).
 * @param dialect The dialect in effect
 * @return The name of the value column
 * @see #getValueColumnName()
 */
protected String determineValueColumnName(Properties params,Dialect dialect){
  ObjectNameNormalizer normalizer=(ObjectNameNormalizer)params.get(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER);
  String name=ConfigurationHelper.getString(VALUE_COLUMN_PARAM,params,DEF_VALUE_COLUMN);
  return dialect.quote(normalizer.normalizeIdentifierQuoting(name));
}

Fixed version (ground truth):
/** 
 * Determine the name of the column in which we will store the generator persistent value. <p> Called during   {@link #configure configuration}.
 * @param params The params supplied in the generator config (plus some standard useful extras).
 * @param dialect The dialect in effect
 * @return The name of the value column
 */
protected String determineValueColumnName(Properties params,Dialect dialect){
  ObjectNameNormalizer normalizer=(ObjectNameNormalizer)params.get(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER);
  String name=ConfigurationHelper.getString(VALUE_COLUMN_PARAM,params,DEF_VALUE_COLUMN);
  return dialect.quote(normalizer.normalizeIdentifierQuoting(name));
}
Program: 40219
Project: 40219
Buggy source:
/** 
 * Determine the segment value corresponding to this generator instance. <p> Called during   {@link #configure configuration}.
 * @param params The params supplied in the generator config (plus some standard useful extras).
 * @return The name of the value column
 * @see #getSegmentValue()
 */
protected String determineSegmentValue(Properties params){
  String segmentValue=params.getProperty(SEGMENT_VALUE_PARAM);
  if (StringHelper.isEmpty(segmentValue)) {
    segmentValue=determineDefaultSegmentValue(params);
  }
  return segmentValue;
}

Fixed version (ground truth):
/** 
 * Determine the segment value corresponding to this generator instance. <p> Called during   {@link #configure configuration}.
 * @param params The params supplied in the generator config (plus some standard useful extras).
 * @return The name of the value column
 */
protected String determineSegmentValue(Properties params){
  String segmentValue=params.getProperty(SEGMENT_VALUE_PARAM);
  if (StringHelper.isEmpty(segmentValue)) {
    segmentValue=determineDefaultSegmentValue(params);
  }
  return segmentValue;
}
Program: 40220
Project: 40220
Buggy source:
/** 
 * Perform the binding.  Safe to assume that value is not null.
 * @param st The prepared statement
 * @param value The value to bind (not null).
 * @param index The index at which to bind
 * @param options The binding options
 * @throws java.sql.SQLException Indicates a problem binding to the prepared statement.
 */
protected abstract void doBind(Tuple resultset,X value,String[] names,WrapperOptions options);

Fixed version (ground truth):
/** 
 * Perform the binding.  Safe to assume that value is not null.
 */
protected abstract void doBind(Tuple resultset,X value,String[] names,WrapperOptions options);
Program: 40222
Project: 40222
Buggy source:
@After public void cleanUp(){
  removePlanet();
}

Fixed version (ground truth):
@After public void cleanUp(){
  removePlanet();
  removePulsar();
}
Program: 40223
Project: 40223
Buggy source:
@Override protected Class<?>[] getAnnotatedClasses(){
  return new Class<?>[]{Planet.class,Galaxy.class};
}

Fixed version (ground truth):
@Override protected Class<?>[] getAnnotatedClasses(){
  return new Class<?>[]{Planet.class,Galaxy.class,Pulsar.class};
}
Program: 40224
Project: 40224
Buggy source:
private RowKey createRowKey(String tableName,String[] rowKeyColumnNames,Object[] rowKeyColumnValues){
  return new RowKey(tableName,rowKeyColumnNames,rowKeyColumnValues);
}

Fixed version (ground truth):
private RowKey createRowKey(String tableName,String[] rowKeyColumnNames,Object[] rowKeyColumnValues){
  return new RowKey(tableName,rowKeyColumnNames,rowKeyColumnValues,null);
}
Program: 40225
Project: 40225
Buggy source:
private AssociationKey createAssociationKey(EntityKey ownerEntityKey,String collectionRole,String tableName,String[] columnNames,Object[] columnValues,String[] rowKeyColumnNames){
  AssociationKeyMetadata associationKeyMetadata=new AssociationKeyMetadata(tableName,columnNames,rowKeyColumnNames);
  return new AssociationKey(associationKeyMetadata,columnValues,collectionRole,ownerEntityKey,AssociationKind.ASSOCIATION);
}

Fixed version (ground truth):
private AssociationKey createAssociationKey(EntityKey ownerEntityKey,String collectionRole,String tableName,String[] columnNames,Object[] columnValues,String[] rowKeyColumnNames){
  AssociationKeyMetadata associationKeyMetadata=new AssociationKeyMetadata(tableName,columnNames,rowKeyColumnNames,EMPTY_STRING_ARRAY,null,EMPTY_STRING_ARRAY);
  return new AssociationKey(associationKeyMetadata,columnValues,collectionRole,ownerEntityKey,AssociationKind.ASSOCIATION);
}
Program: 40226
Project: 40226
Buggy source:
@Override public Set<RowKey> getRowKeys(){
  Set<RowKey> rowKeys=new HashSet<RowKey>(associationMap.size());
  for (  SerializableKey key : associationMap.keySet()) {
    rowKeys.add(new RowKey(key.getTable(),key.getColumnNames(),key.getColumnValues()));
  }
  return rowKeys;
}

Fixed version (ground truth):
@Override public Set<RowKey> getRowKeys(){
  Set<RowKey> rowKeys=new HashSet<RowKey>(associationMap.size());
  for (  SerializableKey key : associationMap.keySet()) {
    rowKeys.add(new RowKey(key.getTable(),key.getColumnNames(),key.getColumnValues(),null));
  }
  return rowKeys;
}