nus-yam/ex-repair huggingface dataset:
Program: 40438
Project: 40438
Buggy source:
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder,int position){
  int type=holder.getItemViewType();
  if (type == TYPE_HEADER) {
    View v=headers.get(position);
    bindHeaderFooter((HeaderFooterViewHolder)holder,v);
  }
 else   if (type == TYPE_FOOTER) {
    View v=footers.get(position - headers.size() - getItemCountExceptHeaderFooter());
    bindHeaderFooter((HeaderFooterViewHolder)holder,v);
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder,int position){
  int type=holder.getItemViewType();
  if (type == TYPE_HEADER) {
    View v=headers.get(position);
    bindHeaderFooter((HeaderFooterViewHolder)holder,v);
  }
 else   if (type == TYPE_FOOTER) {
    View v=footers.get(position - headers.size() - getItemCountExceptHeaderFooter());
    bindHeaderFooter((HeaderFooterViewHolder)holder,v);
  }
 else {
    bindHolder(holder,position);
  }
}
Program: 40439
Project: 40439
Buggy source:
@Override public void onCompleted(boolean success){
  if (listener != null) {
    listener.onCompleted(success);
  }
  if (!success) {
    TransitionGlideLoader.super.loadImage(source,imageView);
  }
}

Fixed version (ground truth):
@Override public void onCompleted(boolean success){
  if (success && listener != null) {
    listener.onCompleted(true);
  }
  if (!success) {
    createThumbnail(source).listener(listener).into(imageView);
  }
}
Program: 40440
Project: 40440
Buggy source:
/** 
 * Support better for loading image at detail page Firstly, we load the image from cache only, if image is'nt cached, perform normal loading with thumbnail place holder
 * @param source image source
 * @param imageView destination image view
 * @param listener complete listener
 */
@Override public <T>void loadImage(T source,ImageView imageView,GlideOnCompleteListener<T,GlideDrawable> listener){
  GlideUtils.createFullNoNetworkRequestBuilder(mRequestManager,source).listener(new GlideOnCompleteListener<T,GlideDrawable>(){
    @Override public void onCompleted(    boolean success){
      if (listener != null) {
        listener.onCompleted(success);
      }
      if (!success) {
        TransitionGlideLoader.super.loadImage(source,imageView);
      }
    }
  }
).into(imageView);
}

Fixed version (ground truth):
/** 
 * Support better for loading image at detail page Firstly, we load the image from cache only, if image is'nt cached, perform normal loading with thumbnail place holder
 * @param source image source
 * @param imageView destination image view
 * @param listener complete listener
 */
@Override public <T>void loadImage(T source,ImageView imageView,GlideOnCompleteListener<T,GlideDrawable> listener){
  GlideUtils.createFullNoNetworkRequestBuilder(mRequestManager,source).listener(new GlideOnCompleteListener<T,GlideDrawable>(){
    @Override public void onCompleted(    boolean success){
      if (success && listener != null) {
        listener.onCompleted(true);
      }
      if (!success) {
        createThumbnail(source).listener(listener).into(imageView);
      }
    }
  }
).into(imageView);
}
Program: 40441
Project: 40441
Buggy source:
private void sendPrivateMessage(User user,String content){
  user.openPrivateChannel().queue((channel) -> {
    try {
      channel.sendMessage(content).queue();
    }
 catch (    Throwable t) {
      LOGGER.warn("String_Node_Str" + this + "String_Node_Str"+ t.getMessage());
    }
  }
);
}

Fixed version (ground truth):
private void sendPrivateMessage(User user,String content){
  user.openPrivateChannel().queue((channel) -> {
    try {
      channel.sendMessage(content).queue(m -> {
      }
,m -> {
        LOGGER.warn("String_Node_Str" + this + "String_Node_Str"+ m.getMessage());
      }
);
    }
 catch (    Throwable t) {
      LOGGER.warn("String_Node_Str" + this + "String_Node_Str"+ t.getMessage());
    }
  }
);
}
Program: 40442
Project: 40442
Buggy source:
@Override public boolean canHandle(Config config,User user,Raid raid){
  if (user.isBot()) {
    return false;
  }
  if (user.getId().equals(userId)) {
    return false;
  }
  boolean raidIsForPokemon=StringUtils.containsIgnoreCase(raid.getPokemon().getName(),pokemon.getName());
  return raidIsForPokemon;
}

Fixed version (ground truth):
@Override public boolean canHandle(Config config,User user,Raid raid){
  if (config == null || user == null || raid == null) {
    LOGGER.debug("String_Node_Str" + config + "String_Node_Str"+ (user == null ? "String_Node_Str" : user.getName())+ "String_Node_Str"+ raid);
    return false;
  }
  if (!config.useBotIntegration() && user.isBot()) {
    return false;
  }
  if (user.getId().equals(userId)) {
    return false;
  }
  boolean raidIsForPokemon=StringUtils.containsIgnoreCase(raid.getPokemon().getName(),pokemon.getName());
  return raidIsForPokemon;
}
Program: 40443
Project: 40443
Buggy source:
private void sendFeedbackThenCleanUp(Raid createdRaid,MessageChannel channel,MessageEmbed messageEmbed){
  LOGGER.info("String_Node_Str" + createdRaid);
  try {
    channel.sendMessage(messageEmbed).queue(m -> {
      try {
        channel.deleteMessageById(m.getId()).queueAfter(BotServerMain.timeToRemoveFeedbackInSeconds,TimeUnit.SECONDS);
      }
 catch (      Throwable t) {
        LOGGER.warn("String_Node_Str" + t.getMessage());
      }
    }
);
  }
 catch (  Throwable t) {
    LOGGER.debug("String_Node_Str" + t.getMessage());
  }
}

Fixed version (ground truth):
private void sendFeedbackThenCleanUp(Raid createdRaid,MessageChannel channel,MessageEmbed messageEmbed){
  LOGGER.info("String_Node_Str" + createdRaid.getRegion() + "String_Node_Str"+ createdRaid);
  try {
    channel.sendMessage(messageEmbed).queue(m -> {
      try {
        channel.deleteMessageById(m.getId()).queueAfter(BotServerMain.timeToRemoveFeedbackInSeconds,TimeUnit.SECONDS);
      }
 catch (      Throwable t) {
        LOGGER.warn("String_Node_Str" + t.getMessage());
      }
    }
);
  }
 catch (  Throwable t) {
    LOGGER.debug("String_Node_Str" + t.getMessage());
  }
}
Program: 40445
Project: 40445
Buggy source:
public AdminCommands(UserConfigRepository userConfigRepository,ServerConfigRepository serverConfigRepository,GymRepository gymRepository,BotService botService,TrackingService trackingCommandListener){
  this.userConfigRepository=userConfigRepository;
  this.serverConfigRepository=serverConfigRepository;
  this.gymRepository=gymRepository;
  this.botService=botService;
  this.trackingCommandListener=trackingCommandListener;
  this.guildOnly=false;
  this.name="String_Node_Str";
  this.help="String_Node_Str";
}

Fixed version (ground truth):
public AdminCommands(UserConfigRepository userConfigRepository,ServerConfigRepository serverConfigRepository,GymRepository gymRepository,BotService botService,TrackingService trackingCommandListener,LocaleService localeService,PokemonRepository pokemonRepository,RaidRepository raidRepository){
  this.userConfigRepository=userConfigRepository;
  this.serverConfigRepository=serverConfigRepository;
  this.gymRepository=gymRepository;
  this.botService=botService;
  this.trackingCommandListener=trackingCommandListener;
  this.localeService=localeService;
  this.pokemonRepository=pokemonRepository;
  this.raidRepository=raidRepository;
  this.guildOnly=false;
  this.name="String_Node_Str";
  this.help="String_Node_Str";
}
Program: 40447
Project: 40447
Buggy source:
public static void assertTimeInRaidTimespan(User user,LocalDateTime dateTimeToCheck,Raid raid,LocaleService localeService){
  final LocalDateTime startOfRaid=getStartOfRaid(raid.getEndOfRaid(),raid.isExRaid());
  if (!(dateTimeToCheck.isBefore(raid.getEndOfRaid()) && dateTimeToCheck.isAfter(startOfRaid))) {
    throw new UserMessedUpException(user,localeService.getMessageFor(LocaleService.TIME_NOT_IN_RAID_TIMESPAN,localeService.getLocaleForUser(user),printDateTime(dateTimeToCheck),printDateTime(startOfRaid),printTimeIfSameDay(raid.getEndOfRaid())));
  }
}

Fixed version (ground truth):
public static void assertTimeInRaidTimespan(User user,LocalDateTime dateTimeToCheck,Raid raid,LocaleService localeService){
  final LocalDateTime startOfRaid=getStartOfRaid(raid.getEndOfRaid(),raid.isExRaid());
  final boolean timeIsSameOrBeforeEnd=raid.getEndOfRaid().isAfter(dateTimeToCheck) || raid.getEndOfRaid().equals(dateTimeToCheck);
  final boolean timeIsSameOrAfterStart=startOfRaid.isBefore(dateTimeToCheck) || startOfRaid.equals(dateTimeToCheck);
  if (!(timeIsSameOrBeforeEnd && timeIsSameOrAfterStart)) {
    throw new UserMessedUpException(user,localeService.getMessageFor(LocaleService.TIME_NOT_IN_RAID_TIMESPAN,localeService.getLocaleForUser(user),printDateTime(dateTimeToCheck),printDateTime(startOfRaid),printTimeIfSameDay(raid.getEndOfRaid())));
  }
}
Program: 40450
Project: 40450
Buggy source:
private static void cleanUp(Config config,User user,String messageId,ServerConfigRepository serverConfigRepository,LocaleService localeService,MessageChannel messageChannel,Locale locale){
  try {
    if (!StringUtils.isEmpty(messageId)) {
      messageChannel.deleteMessageById(messageId).queue(m -> {
        LOGGER.info("String_Node_Str" + messageId);
      }
,m -> {
        LOGGER.info("String_Node_Str" + messageId);
      }
);
    }
  }
 catch (  Throwable t) {
    LOGGER.warn("String_Node_Str" + t.getMessage());
  }
 finally {
    try {
      LOGGER.debug("String_Node_Str" + config.getServer());
      serverConfigRepository.setOverviewMessageIdForServer(config.getServer(),null);
    }
 catch (    Throwable t) {
      LOGGER.warn(t.getClass().getSimpleName() + "String_Node_Str" + config.getServer()+ "String_Node_Str"+ t.getMessage());
    }
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void cleanUp(Config config,String messageId,ServerConfigRepository serverConfigRepository,MessageChannel messageChannel){
  try {
    if (!StringUtils.isEmpty(messageId)) {
      messageChannel.deleteMessageById(messageId).queue(m -> {
        LOGGER.info("String_Node_Str" + messageId);
      }
,m -> {
        LOGGER.info("String_Node_Str" + messageId);
      }
);
    }
  }
 catch (  Throwable t) {
    LOGGER.warn("String_Node_Str" + t.getMessage());
  }
 finally {
    try {
      LOGGER.debug("String_Node_Str" + config.getServer());
      serverConfigRepository.setOverviewMessageIdForServer(config.getServer(),null);
    }
 catch (    Throwable t) {
      LOGGER.warn(t.getClass().getSimpleName() + "String_Node_Str" + config.getServer()+ "String_Node_Str"+ t.getMessage());
    }
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("String_Node_Str");
    }
  }
}
Program: 40452
Project: 40452
Buggy source:
@Override protected void executeWithConfig(CommandEvent commandEvent,Config config){
  String gymName=commandEvent.getArgs();
  final Gym gym=gymRepository.search(commandEvent.getAuthor(),gymName,config.getRegion());
  String staticUrl=Utils.getStaticMapUrl(gym);
  String nonStaticUrl=Utils.getNonStaticMapUrl(gym);
  commandEvent.reply(new EmbedBuilder().setImage(staticUrl).setTitle(gym.getName(),nonStaticUrl).build());
  removeOriginMessageIfConfigSaysSo(config,commandEvent);
}

Fixed version (ground truth):
@Override protected void executeWithConfig(CommandEvent commandEvent,Config config){
  String gymName=commandEvent.getArgs();
  final Gym gym=gymRepository.search(commandEvent.getAuthor(),gymName,config.getRegion());
  String staticUrl=Utils.getStaticMapUrl(gym);
  String nonStaticUrl=Utils.getNonStaticMapUrl(gym);
  final MessageEmbed messageEmbed=new EmbedBuilder().setImage(staticUrl).setTitle(gym.getName(),nonStaticUrl).build();
  replyMapBasedOnConfig(config,commandEvent,messageEmbed);
}
Program: 40454
Project: 40454
Buggy source:
@Test public void testDoubleWeaknesses() throws Exception {
  PokemonRepository pokemonRepository=new PokemonRepository("String_Node_Str",new LocaleService("String_Node_Str",userConfigRepository));
  Pokemon pokemon;
  String typeToCheck;
  pokemon=pokemonRepository.search("String_Node_Str",null);
  typeToCheck="String_Node_Str";
  assertPokemonIsDoubleWeakAgainst(pokemon,typeToCheck);
  pokemon=pokemonRepository.search("String_Node_Str",null);
  typeToCheck="String_Node_Str";
  assertPokemonIsDoubleWeakAgainst(pokemon,typeToCheck);
}

Fixed version (ground truth):
@Test public void testDoubleWeaknesses() throws Exception {
  Pokemon pokemon;
  String typeToCheck;
  pokemon=pokemonRepository.search("String_Node_Str",null);
  typeToCheck="String_Node_Str";
  assertPokemonIsDoubleWeakAgainst(pokemon,typeToCheck);
  pokemon=pokemonRepository.search("String_Node_Str",null);
  typeToCheck="String_Node_Str";
  assertPokemonIsDoubleWeakAgainst(pokemon,typeToCheck);
}
Program: 40456
Project: 40456
Buggy source:
private Callable<Boolean> getMessageRefreshingTaskToSchedule(CommandEvent commandEvent,User user,Raid raid,EmoticonSignUpMessageListener emoticonSignUpMessageListener,Message embed){
  final MessageChannel channel=commandEvent.getTextChannel();
  Callable<Boolean> refreshEditThreadTask=() -> {
    final Callable<Boolean> editTask=() -> {
      TimeUnit.SECONDS.sleep(15);
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str" + Thread.currentThread().getId() + "String_Node_Str"+ embed.getId());
      }
      LocalDateTime start=emoticonSignUpMessageListener.getStartAt();
      final MessageEmbed newContent=getRaidGroupMessageEmbed(user,start,raidRepository.getById(raid.getId()),localeService);
      embed.getChannel().editMessageById(embed.getId(),newContent).queue(m -> {
      }
,m -> {
        emoticonSignUpMessageListener.setStartAt(null);
      }
);
      return true;
    }
;
    while (raidIsActiveAndRaidGroupNotExpired(raid.getEndOfRaid(),emoticonSignUpMessageListener.getStartAt())) {
      try {
        executorService.submit(editTask).get();
      }
 catch (      InterruptedException|ExecutionException e) {
        throw new RuntimeException(e);
      }
    }
    LOGGER.info("String_Node_Str" + emoticonSignUpMessageListener.getRaidId() + "String_Node_Str"+ emoticonSignUpMessageListener.getUserId());
    cleanUp(commandEvent,emoticonSignUpMessageListener.getStartAt(),raid.getId(),emoticonSignUpMessageListener);
    return true;
  }
;
  return refreshEditThreadTask;
}

Fixed version (ground truth):
private Callable<Boolean> getMessageRefreshingTaskToSchedule(CommandEvent commandEvent,User user,Raid raid,EmoticonSignUpMessageListener emoticonSignUpMessageListener,Message embed){
  final MessageChannel channel=commandEvent.getTextChannel();
  Callable<Boolean> refreshEditThreadTask=() -> {
    final Callable<Boolean> editTask=() -> {
      TimeUnit.SECONDS.sleep(15);
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str" + Thread.currentThread().getId() + "String_Node_Str"+ embed.getId());
      }
      LocalDateTime start=emoticonSignUpMessageListener.getStartAt();
      final MessageEmbed newContent=getRaidGroupMessageEmbed(user,start,raidRepository.getById(raid.getId()),localeService);
      embed.getChannel().editMessageById(embed.getId(),newContent).queue(m -> {
      }
,m -> {
        LOGGER.warn(m.getClass().getName() + "String_Node_Str" + m.getMessage());
        emoticonSignUpMessageListener.setStartAt(null);
      }
);
      return true;
    }
;
    while (raidIsActiveAndRaidGroupNotExpired(raid.getEndOfRaid(),emoticonSignUpMessageListener.getStartAt())) {
      try {
        executorService.submit(editTask).get();
      }
 catch (      InterruptedException|ExecutionException e) {
        throw new RuntimeException(e);
      }
    }
    LOGGER.info("String_Node_Str" + emoticonSignUpMessageListener.getRaidId() + "String_Node_Str"+ emoticonSignUpMessageListener.getUserId());
    cleanUp(commandEvent,emoticonSignUpMessageListener.getStartAt(),raid.getId(),emoticonSignUpMessageListener);
    return true;
  }
;
  return refreshEditThreadTask;
}
Program: 40457
Project: 40457
Buggy source:
public Raid modifySignUp(String raidId,User user,int mystic,int instinct,int valor,int plebs,LocalDateTime startAt){
  RaidEntity raidEntity=findEntityByRaidId(raidId,user);
  RaidEntitySignUp signUp=raidEntity.getSignUp(user.getName());
  final String startAtTime=Utils.printTime(startAt.toLocalTime());
  if (signUp == null) {
    final int sum=mystic + instinct + valor+ plebs;
    assertSumNotLessThanOne(user,sum);
    raidEntity.addSignUp(new RaidEntitySignUp(user.getName(),sum,startAtTime));
  }
 else {
    int sum=signUp.getNumberOfPeople();
    if (startAt.toLocalTime().equals(Utils.parseTime(user,signUp.getEta(),localeService))) {
      sum=sum + mystic + instinct+ valor+ plebs;
    }
 else {
      signUp.setEta(startAtTime);
      sum=mystic + instinct + valor+ plebs;
    }
    assertSumNotLessThanOne(user,sum);
    signUp.setNumberOfPeople(sum,localeService,user);
  }
  raidEntity=raidEntityRepository.save(raidEntity);
  return getRaidInstance(raidEntity);
}

Fixed version (ground truth):
public Raid modifySignUp(String raidId,User user,int mystic,int instinct,int valor,int plebs,LocalDateTime startAt){
  RaidEntity raidEntity=findEntityByRaidId(raidId);
  RaidEntitySignUp signUp=raidEntity.getSignUp(user.getName());
  final String startAtTime=Utils.printTime(startAt.toLocalTime());
  if (signUp == null) {
    final int sum=mystic + instinct + valor+ plebs;
    assertSumNotLessThanOne(user,sum);
    raidEntity.addSignUp(new RaidEntitySignUp(user.getName(),sum,startAtTime));
  }
 else {
    int sum=signUp.getNumberOfPeople();
    if (startAt.toLocalTime().equals(Utils.parseTime(user,signUp.getEta(),localeService))) {
      sum=sum + mystic + instinct+ valor+ plebs;
    }
 else {
      signUp.setEta(startAtTime);
      sum=mystic + instinct + valor+ plebs;
    }
    assertSumNotLessThanOne(user,sum);
    signUp.setNumberOfPeople(sum,localeService,user);
  }
  raidEntity=raidEntityRepository.save(raidEntity);
  return getRaidInstance(raidEntity);
}
Program: 40458
Project: 40458
Buggy source:
public Raid removeAllSignUpsAt(String raidId,LocalDateTime startAt){
  Validate.notNull(raidId,"String_Node_Str");
  Validate.notNull(startAt,"String_Node_Str");
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + raidId + "String_Node_Str"+ printTimeIfSameDay(startAt));
  }
  RaidEntity entity=findEntityByRaidId(raidId,null);
  if (entity != null) {
    for (    RaidEntitySignUp signUp : entity.getSignUpsAsSet()) {
      if (signUp.getArrivalTime().equals(startAt.toLocalTime())) {
        RaidEntitySignUp removed=entity.removeSignUp(signUp);
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("String_Node_Str" + removed);
        }
      }
    }
    entity=raidEntityRepository.save(entity);
  }
  return getRaidInstance(entity);
}

Fixed version (ground truth):
public Raid removeAllSignUpsAt(String raidId,LocalDateTime startAt){
  Validate.notNull(raidId,"String_Node_Str");
  Validate.notNull(startAt,"String_Node_Str");
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + raidId + "String_Node_Str"+ printTimeIfSameDay(startAt));
  }
  RaidEntity entity=findEntityByRaidId(raidId);
  if (entity != null) {
    for (    RaidEntitySignUp signUp : entity.getSignUpsAsSet()) {
      if (signUp.getArrivalTime().equals(startAt.toLocalTime())) {
        RaidEntitySignUp removed=entity.removeSignUp(signUp);
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("String_Node_Str" + removed);
        }
      }
    }
    entity=raidEntityRepository.save(entity);
  }
  return getRaidInstance(entity);
}
Program: 40459
Project: 40459
Buggy source:
public Raid changeEndOfRaid(String raidId,LocalDateTime newEndOfRaid,User user){
  RaidEntity raidEntity=findEntityByRaidId(raidId,user);
  raidEntity.setEndOfRaid(newEndOfRaid);
  raidEntity=raidEntityRepository.save(raidEntity);
  return getRaidInstance(raidEntity);
}

Fixed version (ground truth):
public Raid changeEndOfRaid(String raidId,LocalDateTime newEndOfRaid){
  RaidEntity raidEntity=findEntityByRaidId(raidId);
  raidEntity.setEndOfRaid(newEndOfRaid);
  raidEntity=raidEntityRepository.save(raidEntity);
  return getRaidInstance(raidEntity);
}
Program: 40460
Project: 40460
Buggy source:
public void newRaid(User raidCreator,Raid raid){
  RaidEntity raidEntity=findEntityByRaidId(raid,raidCreator);
  final String pokemonName=raid.getPokemon().getName();
  if (raidEntity != null) {
    final String existingEntityPokemon=raidEntity.getPokemon();
    final boolean oneRaidIsEx=Utils.isRaidExPokemon(pokemonName) || Utils.isRaidExPokemon(existingEntityPokemon);
    if ((!oneRaidIsEx) || Utils.raidsCollide(raid.getEndOfRaid(),raidEntity.getEndOfRaid())) {
      throw new RaidExistsException(raidCreator,getRaidInstance(raidEntity),localeService,localeService.getLocaleForUser(raidCreator));
    }
  }
  saveRaid(raidCreator,raid);
}

Fixed version (ground truth):
public void newRaid(User raidCreator,Raid raid){
  RaidEntity raidEntity=getActiveOrFallbackToExRaidEntity(raid.getGym(),raid.getRegion());
  final String pokemonName=raid.getPokemon().getName();
  if (raidEntity != null) {
    final String existingEntityPokemon=raidEntity.getPokemon();
    final boolean oneRaidIsEx=Utils.isRaidExPokemon(pokemonName) || Utils.isRaidExPokemon(existingEntityPokemon);
    if ((!oneRaidIsEx) || Utils.raidsCollide(raid.getEndOfRaid(),raidEntity.getEndOfRaid())) {
      throw new RaidExistsException(raidCreator,getRaidInstance(raidEntity),localeService,localeService.getLocaleForUser(raidCreator));
    }
  }
  saveRaid(raidCreator,raid);
}
Program: 40461
Project: 40461
Buggy source:
public void addSignUp(User user,Raid raid,SignUp theSignUp){
  RaidEntity entity=findEntityByRaidId(raid.getId(),user);
  RaidEntitySignUp entitySignUp=entity.getSignUp(user.getName());
  if (entitySignUp == null) {
    entity.addSignUp(new RaidEntitySignUp(user.getName(),theSignUp.getHowManyPeople(),Utils.printTime(theSignUp.getArrivalTime())));
  }
 else {
    entitySignUp.setNumberOfPeople(theSignUp.getHowManyPeople(),localeService,user);
    entitySignUp.setEta(Utils.printTime(theSignUp.getArrivalTime()));
  }
  raidEntityRepository.save(entity);
}

Fixed version (ground truth):
public void addSignUp(User user,Raid raid,SignUp theSignUp){
  RaidEntity entity=findEntityByRaidId(raid.getId());
  RaidEntitySignUp entitySignUp=entity.getSignUp(user.getName());
  if (entitySignUp == null) {
    entity.addSignUp(new RaidEntitySignUp(user.getName(),theSignUp.getHowManyPeople(),Utils.printTime(theSignUp.getArrivalTime())));
  }
 else {
    entitySignUp.setNumberOfPeople(theSignUp.getHowManyPeople(),localeService,user);
    entitySignUp.setEta(Utils.printTime(theSignUp.getArrivalTime()));
  }
  raidEntityRepository.save(entity);
}
Program: 40462
Project: 40462
Buggy source:
public Raid removeFromSignUp(String raidId,User user,int mystic,int instinct,int valor,int plebs,LocalDateTime startAt){
  RaidEntity raidEntity=findEntityByRaidId(raidId,user);
  if (raidEntity == null) {
    throw new UserMessedUpException(user,localeService.getMessageFor(LocaleService.NO_RAID_AT_GYM,localeService.getLocaleForUser(user)));
  }
  RaidEntitySignUp signUp=raidEntity.getSignUp(user.getName());
  final String startAtTime=Utils.printTime(startAt.toLocalTime());
  if (signUp == null) {
  }
 else   if (startAtTime.equals(signUp.getEta())) {
    final int sum=signUp.getNumberOfPeople() - mystic - instinct- valor- plebs;
    if (sum <= 0) {
      raidEntity.removeSignUp(signUp);
    }
 else {
      signUp.setNumberOfPeople(sum,localeService,user);
    }
    raidEntity=raidEntityRepository.save(raidEntity);
  }
 else {
  }
  return getRaidInstance(raidEntity);
}

Fixed version (ground truth):
public Raid removeFromSignUp(String raidId,User user,int mystic,int instinct,int valor,int plebs,LocalDateTime startAt){
  RaidEntity raidEntity=findEntityByRaidId(raidId);
  if (raidEntity == null) {
    throw new UserMessedUpException(user,localeService.getMessageFor(LocaleService.NO_RAID_AT_GYM,localeService.getLocaleForUser(user)));
  }
  RaidEntitySignUp signUp=raidEntity.getSignUp(user.getName());
  final String startAtTime=Utils.printTime(startAt.toLocalTime());
  if (signUp == null) {
  }
 else   if (startAtTime.equals(signUp.getEta())) {
    final int sum=signUp.getNumberOfPeople() - mystic - instinct- valor- plebs;
    if (sum <= 0) {
      raidEntity.removeSignUp(signUp);
    }
 else {
      signUp.setNumberOfPeople(sum,localeService,user);
    }
    raidEntity=raidEntityRepository.save(raidEntity);
  }
 else {
  }
  return getRaidInstance(raidEntity);
}
Program: 40463
Project: 40463
Buggy source:
private RaidEntity findEntityByRaidId(String raidId,User user){
  final RaidEntity raidEntity=raidId == null ? null : raidEntityRepository.findOne(raidId);
  removeRaidIfExpired(raidEntity);
  return raidEntity;
}

Fixed version (ground truth):
private RaidEntity findEntityByRaidId(String raidId){
  final RaidEntity raidEntity=raidId == null ? null : raidEntityRepository.findOne(raidId);
  removeRaidIfExpired(raidEntity);
  return raidEntity;
}
Program: 40464
Project: 40464
Buggy source:
public void removeSignUp(User user,Raid raid,SignUp theSignUp){
  RaidEntity entity=findEntityByRaidId(raid.getId(),user);
  entity.removeSignUp(new RaidEntitySignUp(user.getName(),theSignUp.getHowManyPeople(),Utils.printTime(theSignUp.getArrivalTime())));
  raidEntityRepository.save(entity);
}

Fixed version (ground truth):
public void removeSignUp(User user,Raid raid,SignUp theSignUp){
  RaidEntity entity=findEntityByRaidId(raid.getId());
  entity.removeSignUp(new RaidEntitySignUp(user.getName(),theSignUp.getHowManyPeople(),Utils.printTime(theSignUp.getArrivalTime())));
  raidEntityRepository.save(entity);
}
Program: 40465
Project: 40465
Buggy source:
@Test public void changeEndOfRaidWorks() throws Exception {
  clockService.setMockTime(LocalTime.of(10,0));
  final LocalDateTime now=clockService.getCurrentDateTime();
  final LocalTime nowTime=now.toLocalTime();
  LocalDateTime endOfRaid=now.plusMinutes(45);
  final Gym gym=gymRepository.findByName("String_Node_Str",uppsalaRegion);
  Raid enteiRaid=new Raid(pokemonRepository.search("String_Node_Str",null),endOfRaid,gym,localeService,uppsalaRegion);
  String raidCreatorName="String_Node_Str";
  User user=mock(User.class);
  when(user.getName()).thenReturn(raidCreatorName);
  try {
    repo.newRaid(user,enteiRaid);
  }
 catch (  RuntimeException e) {
    System.err.println(e.getMessage());
    fail("String_Node_Str" + e.getMessage());
  }
  Raid raid=repo.getActiveRaidOrFallbackToExRaid(gym,uppsalaRegion,user);
  Raid changedRaid=repo.changeEndOfRaid(raid.getId(),endOfRaid.plusMinutes(5),user);
  assertThat(raid.getEndOfRaid(),not(changedRaid.getEndOfRaid()));
  assertThat(changedRaid.getEndOfRaid(),is(raid.getEndOfRaid().plusMinutes(5)));
  assertThat(raid.getGym(),is(changedRaid.getGym()));
  assertThat(raid.getSignUps(),is(changedRaid.getSignUps()));
  assertThat(raid.getRegion(),is(changedRaid.getRegion()));
  assertThat(raid.getPokemon().getName(),is(changedRaid.getPokemon().getName()));
}

Fixed version (ground truth):
@Test public void changeEndOfRaidWorks() throws Exception {
  clockService.setMockTime(LocalTime.of(10,0));
  final LocalDateTime now=clockService.getCurrentDateTime();
  final LocalTime nowTime=now.toLocalTime();
  LocalDateTime endOfRaid=now.plusMinutes(45);
  final Gym gym=gymRepository.findByName("String_Node_Str",uppsalaRegion);
  Raid enteiRaid=new Raid(pokemonRepository.search("String_Node_Str",null),endOfRaid,gym,localeService,uppsalaRegion);
  String raidCreatorName="String_Node_Str";
  User user=mock(User.class);
  when(user.getName()).thenReturn(raidCreatorName);
  try {
    repo.newRaid(user,enteiRaid);
  }
 catch (  RuntimeException e) {
    System.err.println(e.getMessage());
    fail("String_Node_Str" + e.getMessage());
  }
  Raid raid=repo.getActiveRaidOrFallbackToExRaid(gym,uppsalaRegion,user);
  Raid changedRaid=repo.changeEndOfRaid(raid.getId(),endOfRaid.plusMinutes(5));
  assertThat(raid.getEndOfRaid(),not(changedRaid.getEndOfRaid()));
  assertThat(changedRaid.getEndOfRaid(),is(raid.getEndOfRaid().plusMinutes(5)));
  assertThat(raid.getGym(),is(changedRaid.getGym()));
  assertThat(raid.getSignUps(),is(changedRaid.getSignUps()));
  assertThat(raid.getRegion(),is(changedRaid.getRegion()));
  assertThat(raid.getPokemon().getName(),is(changedRaid.getPokemon().getName()));
}
Program: 40466
Project: 40466
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + region + '\''+ "String_Node_Str"+ pokemonName+ '\''+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + region + '\''+ "String_Node_Str"+ userId+ '\''+ "String_Node_Str"+ pokemonName+ '\''+ '}';
}
Program: 40467
Project: 40467
Buggy source:
public void newRaid(String raidCreatorName,Raid raid){
}

Fixed version (ground truth):
public void newRaid(String raidCreatorName,Raid raid){
  RaidEntity raidEntity=getActiveOrFallbackToExRaidEntity(raid.getGym(),raid.getRegion());
  final String pokemonName=raid.getPokemon().getName();
  if (raidEntity != null) {
    final String existingEntityPokemon=raidEntity.getPokemon();
    final boolean oneRaidIsEx=Utils.isRaidExPokemon(pokemonName) || Utils.isRaidExPokemon(existingEntityPokemon);
    if ((!oneRaidIsEx) || Utils.raidsCollide(raid.getEndOfRaid(),raidEntity.getEndOfRaid())) {
      throw new RaidExistsException(raidCreatorName,getRaidInstance(raidEntity),localeService,LocaleService.DEFAULT);
    }
  }
  saveRaid(raidCreatorName,raid);
}
Program: 40468
Project: 40468
Buggy source:
private RaidEntity getActiveOrFallbackToExRaidEntity(Gym gym,String region){
  RaidEntity raidEntity=null;
  List<RaidEntity> raidEntities=raidEntityRepository.findByGymAndRegion(gym.getName(),region);
  RaidEntity exEntity=null;
  for (  RaidEntity entity : raidEntities) {
    if (entity.isActive(clockService)) {
      raidEntity=entity;
    }
 else     if (entity.isExpired(clockService)) {
      raidEntityRepository.delete(entity);
      throw new RaidNotFoundException(gym,localeService);
    }
 else     if (Utils.isRaidExPokemon(entity.getPokemon())) {
      exEntity=entity;
    }
  }
  if (raidEntity == null) {
    if (exEntity != null) {
      raidEntity=exEntity;
    }
 else {
      throw new RaidNotFoundException(gym,localeService);
    }
  }
  return raidEntity;
}

Fixed version (ground truth):
private RaidEntity getActiveOrFallbackToExRaidEntity(Gym gym,String region){
  RaidEntity raidEntity=null;
  List<RaidEntity> raidEntities=raidEntityRepository.findByGymAndRegion(gym.getName(),region);
  RaidEntity exEntity=null;
  for (  RaidEntity entity : raidEntities) {
    if (entity.isExpired(clockService)) {
      raidEntityRepository.delete(entity);
    }
 else     if (Utils.isRaidExPokemon(entity.getPokemon())) {
      exEntity=entity;
    }
 else     if (!entity.isExpired(clockService)) {
      if (raidEntity != null) {
        throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + raidEntity);
      }
      raidEntity=entity;
    }
  }
  if (raidEntity == null) {
    if (exEntity != null) {
      raidEntity=exEntity;
    }
  }
  return raidEntity;
}
Program: 40469
Project: 40469
Buggy source:
@Autowired public RaidRepository(ClockService clockService,LocaleService localeService,RaidEntityRepository raidEntityRepository,PokemonRepository pokemonRepository,GymRepository gymRepository){
  this.clockService=clockService;
  this.localeService=localeService;
  this.raidEntityRepository=raidEntityRepository;
  this.pokemonRepository=pokemonRepository;
  this.gymRepository=gymRepository;
  clockService.setMockTime(LocalTime.of(10,30));
  Utils.setClockService(clockService);
}

Fixed version (ground truth):
@Autowired public RaidRepository(ClockService clockService,LocaleService localeService,RaidEntityRepository raidEntityRepository,PokemonRepository pokemonRepository,GymRepository gymRepository){
  this.clockService=clockService;
  this.localeService=localeService;
  this.raidEntityRepository=raidEntityRepository;
  this.pokemonRepository=pokemonRepository;
  this.gymRepository=gymRepository;
  clockService.setMockTime(LocalTime.of(10,30));
  Utils.setClockService(clockService);
  removeExpiredRaids();
}
Program: 40470
Project: 40470
Buggy source:
public Raid getActiveRaidOrFallbackToExRaid(Gym gym,String region){
  RaidEntity raidEntity=getActiveOrFallbackToExRaidEntity(gym,region);
  final Raid raid=getRaidInstance(raidEntity);
  return raid;
}

Fixed version (ground truth):
public Raid getActiveRaidOrFallbackToExRaid(Gym gym,String region){
  RaidEntity raidEntity=getActiveOrFallbackToExRaidEntity(gym,region);
  if (raidEntity == null) {
    throw new RaidNotFoundException(gym,localeService);
  }
  final Raid raid=getRaidInstance(raidEntity);
  return raid;
}
Program: 40471
Project: 40471
Buggy source:
@Test public void testSignUp() throws Exception {
  clockService.setMockTime(LocalTime.of(10,0));
  final LocalDateTime now=clockService.getCurrentDateTime();
  final LocalTime nowTime=now.toLocalTime();
  LocalDateTime endOfRaid=now.plusHours(1);
  final Gym gym=gymRepository.findByName("String_Node_Str",uppsalaRegion);
  Raid enteiRaid=new Raid(pokemonRepository.getByName("String_Node_Str"),endOfRaid,gym,new LocaleService(),uppsalaRegion);
  String raidCreatorName="String_Node_Str";
  try {
    repo.newRaid(raidCreatorName,enteiRaid);
  }
 catch (  RuntimeException e) {
    System.err.println(e.getMessage());
  }
  Raid raid=repo.getActiveRaidOrFallbackToExRaid(gym,uppsalaRegion);
  assertThat(raid,is(enteiRaid));
  String userName="String_Node_Str";
  int howManyPeople=3;
  LocalTime arrivalTime=nowTime.plusMinutes(30);
  raid.signUp(userName,howManyPeople,arrivalTime,repo);
  assertThat(raid.getSignUps().size(),is(1));
  assertThat(raid.getNumberOfPeopleSignedUp(),is(howManyPeople));
  final Raid raidFromDb=repo.getActiveRaidOrFallbackToExRaid(gym,uppsalaRegion);
  assertThat(raidFromDb,is(raid));
  assertThat(raidFromDb.getSignUps().size(),is(1));
}

Fixed version (ground truth):
@Test public void testSignUp() throws Exception {
  clockService.setMockTime(LocalTime.of(10,0));
  final LocalDateTime now=clockService.getCurrentDateTime();
  final LocalTime nowTime=now.toLocalTime();
  LocalDateTime endOfRaid=now.plusMinutes(45);
  final Gym gym=gymRepository.findByName("String_Node_Str",uppsalaRegion);
  Raid enteiRaid=new Raid(pokemonRepository.getByName("String_Node_Str"),endOfRaid,gym,new LocaleService(),uppsalaRegion);
  String raidCreatorName="String_Node_Str";
  try {
    repo.newRaid(raidCreatorName,enteiRaid);
  }
 catch (  RuntimeException e) {
    System.err.println(e.getMessage());
    fail("String_Node_Str" + e.getMessage());
  }
  Raid raid=repo.getActiveRaidOrFallbackToExRaid(gym,uppsalaRegion);
  assertThat(raid,is(enteiRaid));
  String userName="String_Node_Str";
  int howManyPeople=3;
  LocalTime arrivalTime=nowTime.plusMinutes(30);
  raid.signUp(userName,howManyPeople,arrivalTime,repo);
  assertThat(raid.getSignUps().size(),is(1));
  assertThat(raid.getNumberOfPeopleSignedUp(),is(howManyPeople));
  final Raid raidFromDb=repo.getActiveRaidOrFallbackToExRaid(gym,uppsalaRegion);
  assertThat(raidFromDb,is(raid));
  assertThat(raidFromDb.getSignUps().size(),is(1));
}
Program: 40472
Project: 40472
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + region + '\''+ "String_Node_Str"+ pokemonName+ '\''+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + region + '\''+ "String_Node_Str"+ userId+ '\''+ "String_Node_Str"+ pokemonName+ '\''+ '}';
}
Program: 40473
Project: 40473
Buggy source:
public void newRaid(String raidCreatorName,Raid raid){
  final Pair<String,Raid> pair=raids.get(raid.getGym());
  if (pair != null && (raid.equals(pair.getRight()) || raid.getGym().equals(pair.getRight().getGym()))) {
    throw new RaidExistsException(raidCreatorName,raid);
  }
 else   if (pair == null) {
    raids.put(raid.getGym(),Pair.of(raidCreatorName,raid));
  }
 else {
    throw new IllegalStateException("String_Node_Str" + raid);
  }
}

Fixed version (ground truth):
public void newRaid(String raidCreatorName,Raid raid){
  final Pair<String,Raid> pair=raids.get(raid.getGym());
  if (pair != null && (raid.equals(pair.getRight()) || raid.getGym().equals(pair.getRight().getGym()))) {
    throw new RaidExistsException(raidCreatorName,pair.getRight());
  }
 else   if (pair == null) {
    raids.put(raid.getGym(),Pair.of(raidCreatorName,raid));
  }
 else {
    throw new IllegalStateException("String_Node_Str" + raid);
  }
}
Program: 40474
Project: 40474
Buggy source:
public static String printTime(LocalTime time){
  return time.format(dateTimeFormatter);
}

Fixed version (ground truth):
public static String printTime(LocalTime time){
  return time.format(dateTimePrintFormatter);
}
Program: 40475
Project: 40475
Buggy source:
@Override protected void execute(CommandEvent commandEvent){
  try {
    final String userName=commandEvent.getAuthor().getName();
    final String[] args=commandEvent.getArgs().split("String_Node_Str");
    String pokemonName=args[0];
    final Pokemon pokemon=pokemonRepository.getByName(pokemonName);
    String timeString=args[1];
    LocalTime endsAt=LocalTime.parse(timeString,Utils.dateTimeFormatter);
    assertGivenTimeNotBeforeNow(userName,endsAt);
    StringBuilder gymNameBuilder=new StringBuilder();
    for (int i=2; i < args.length; i++) {
      gymNameBuilder.append(args[i]).append("String_Node_Str");
    }
    String gymName=gymNameBuilder.toString().trim();
    final Raid raid=new Raid(pokemon,endsAt,gymRepository.search(userName,gymName));
    raidRepository.newRaid(userName,raid);
    commandEvent.reply("String_Node_Str" + raid);
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}

Fixed version (ground truth):
@Override protected void execute(CommandEvent commandEvent){
  try {
    final String userName=commandEvent.getAuthor().getName();
    final String[] args=commandEvent.getArgs().split("String_Node_Str");
    String pokemonName=args[0];
    final Pokemon pokemon=pokemonRepository.getByName(pokemonName);
    String timeString=args[1];
    LocalTime endsAt=LocalTime.parse(timeString,Utils.dateTimeParseFormatter);
    assertTimeNotMoreThanTwoHoursFromNow(userName,endsAt);
    assertTimeNotInNoRaidTimespan(userName,endsAt);
    assertGivenTimeNotBeforeNow(userName,endsAt);
    StringBuilder gymNameBuilder=new StringBuilder();
    for (int i=2; i < args.length; i++) {
      gymNameBuilder.append(args[i]).append("String_Node_Str");
    }
    String gymName=gymNameBuilder.toString().trim();
    final Raid raid=new Raid(pokemon,endsAt,gymRepository.search(userName,gymName));
    raidRepository.newRaid(userName,raid);
    commandEvent.reply("String_Node_Str" + raid);
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}
Program: 40476
Project: 40476
Buggy source:
@Override protected void execute(CommandEvent commandEvent){
  try {
    final String userName=commandEvent.getAuthor().getName();
    final String[] args=commandEvent.getArgs().split("String_Node_Str");
    String people=args[0];
    Integer numberOfPeople;
    try {
      numberOfPeople=new Integer(people);
      if (numberOfPeople < 1 || numberOfPeople > highLimitForSignUps) {
        throw new RuntimeException();
      }
    }
 catch (    RuntimeException e) {
      throw new UserMessedUpException(userName,"String_Node_Str" + people + "String_Node_Str"+ highLimitForSignUps+ "String_Node_Str");
    }
    String timeString=args[1];
    StringBuilder gymNameBuilder=new StringBuilder();
    for (int i=2; i < args.length; i++) {
      gymNameBuilder.append(args[i]).append("String_Node_Str");
    }
    String gymName=gymNameBuilder.toString().trim();
    final Gym gym=gymRepository.findByName(gymName);
    final Raid raid=raidRepository.getRaid(gym);
    LocalTime eta=LocalTime.parse(timeString,Utils.dateTimeFormatter);
    assertEtaNotAfterRaidEnd(userName,raid,eta);
    assertGivenTimeNotBeforeNow(userName,eta);
    raid.signUp(userName,numberOfPeople,eta);
    commandEvent.reply(userName + "String_Node_Str" + gym.getName()+ "String_Node_Str"+ (raid.getSignUps().size() > 1 ? "String_Node_Str" + raid.getSignUps() : "String_Node_Str"));
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}

Fixed version (ground truth):
@Override protected void execute(CommandEvent commandEvent){
  try {
    final String userName=commandEvent.getAuthor().getName();
    final String[] args=commandEvent.getArgs().split("String_Node_Str");
    String people=args[0];
    Integer numberOfPeople;
    try {
      numberOfPeople=new Integer(people);
      if (numberOfPeople < 1 || numberOfPeople > highLimitForSignUps) {
        throw new RuntimeException();
      }
    }
 catch (    RuntimeException e) {
      throw new UserMessedUpException(userName,"String_Node_Str" + people + "String_Node_Str"+ highLimitForSignUps+ "String_Node_Str");
    }
    String timeString=args[1];
    StringBuilder gymNameBuilder=new StringBuilder();
    for (int i=2; i < args.length; i++) {
      gymNameBuilder.append(args[i]).append("String_Node_Str");
    }
    String gymName=gymNameBuilder.toString().trim();
    final Gym gym=gymRepository.findByName(gymName);
    final Raid raid=raidRepository.getRaid(gym);
    LocalTime eta=LocalTime.parse(timeString,Utils.dateTimeParseFormatter);
    assertEtaNotAfterRaidEnd(userName,raid,eta);
    assertGivenTimeNotBeforeNow(userName,eta);
    raid.signUp(userName,numberOfPeople,eta);
    commandEvent.reply(userName + "String_Node_Str" + gym.getName()+ "String_Node_Str"+ (raid.getSignUps().size() > 1 ? "String_Node_Str" + raid.getSignUps() : "String_Node_Str"));
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}
Program: 40477
Project: 40477
Buggy source:
@Override protected void execute(CommandEvent commandEvent){
  try {
    String gymName=commandEvent.getArgs();
    final Gym gym=gymRepository.search(commandEvent.getAuthor().getName(),gymName);
    String url=Utils.getMapUrl(gym);
    commandEvent.reply(new EmbedBuilder().setImage(url).setTitle(gym.getName(),url).build());
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}

Fixed version (ground truth):
@Override protected void execute(CommandEvent commandEvent){
  try {
    String gymName=commandEvent.getArgs();
    final Gym gym=gymRepository.search(commandEvent.getAuthor().getName(),gymName);
    String staticUrl=Utils.getStaticMapUrl(gym);
    String nonStaticUrl=Utils.getNonStaticMapUrl(gym);
    commandEvent.reply(new EmbedBuilder().setImage(staticUrl).setTitle(gym.getName(),nonStaticUrl).build());
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}
Program: 40478
Project: 40478
Buggy source:
public RaidExistsException(String raidCreatorName,Raid raid){
  super("String_Node_Str" + raidCreatorName + "String_Node_Str"+ raid.getGym().getName()+ "String_Node_Str"+ raid.getPokemon().getName()+ "String_Node_Str");
}

Fixed version (ground truth):
public RaidExistsException(String raidCreatorName,Raid existingRaid){
  super("String_Node_Str" + raidCreatorName + "String_Node_Str"+ existingRaid.getGym().getName()+ "String_Node_Str"+ existingRaid.getPokemon().getName()+ "String_Node_Str");
}
Program: 40479
Project: 40479
Buggy source:
@Override protected void execute(CommandEvent commandEvent){
  try {
    String pokemonName=commandEvent.getArgs();
    final Pokemon pokemon=repo.getByName(pokemonName);
    final RaidBossCounters counters=raidInfoService.getCounters(pokemon);
    final String maxCp=raidInfoService.getMaxCp(pokemon);
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str").append(pokemon).append("String_Node_Str").append("String_Node_Str").append(pokemon.getWeaknesses()).append("String_Node_Str").append("String_Node_Str").append(pokemon.getResistant()).append("String_Node_Str");
    if (counters != null && counters.getSupremeCounters().size() > 0) {
      builder.append("String_Node_Str");
      final Optional<CounterPokemon> bestCounterPokemon=counters.getSupremeCounters().stream().findFirst();
      builder.append(bestCounterPokemon.get());
      if (counters.getSupremeCounters().size() > 1 || counters.getGoodCounters().size() > 0) {
        final LinkedList<CounterPokemon> totalCounters=new LinkedList<>(counters.getSupremeCounters());
        totalCounters.addAll(counters.getGoodCounters());
        List<String> otherCounters=totalCounters.stream().skip(1).map(CounterPokemon::getCounterPokemonName).collect(Collectors.toList());
        builder.append("String_Node_Str");
        builder.append(StringUtils.join(otherCounters.toArray(),"String_Node_Str"));
        builder.append("String_Node_Str");
      }
    }
    if (maxCp != null) {
      builder.append("String_Node_Str").append(maxCp).append("String_Node_Str");
    }
    commandEvent.reply(builder.toString());
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}

Fixed version (ground truth):
@Override protected void execute(CommandEvent commandEvent){
  try {
    String pokemonName=commandEvent.getArgs();
    final Pokemon pokemon=repo.getByName(pokemonName);
    final RaidBossCounters counters=raidInfoService.getCounters(pokemon);
    final String maxCp=raidInfoService.getMaxCp(pokemon);
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str").append(pokemon).append("String_Node_Str").append("String_Node_Str").append(pokemon.getWeaknesses()).append("String_Node_Str").append("String_Node_Str").append(pokemon.getResistant()).append("String_Node_Str");
    appendBestCounters(counters,builder);
    if (maxCp != null) {
      builder.append("String_Node_Str").append(maxCp).append("String_Node_Str");
    }
    commandEvent.reply(builder.toString());
  }
 catch (  Throwable t) {
    commandEvent.reply(t.getMessage());
  }
}
Program: 40482
Project: 40482
Buggy source:
private static ValiWapper getFieldsFromCache(Class c){
  ValiWapper wapper=cache.get(c);
  if (wapper == null) {
    wapper=new ValiWapper();
    Field[] cFields=c.getDeclaredFields();
    NotNull notNull;
    Reg reg;
    for (    Field field : cFields) {
      notNull=field.getAnnotation(NotNull.class);
      reg=field.getAnnotation(Reg.class);
      if (notNull != null || reg != null) {
        if (notNull != null) {
          ValiModel valiModel=new ValiModel(notNull.order(),notNull.error(),null,field);
          wapper.addValiModel(valiModel);
        }
        if (reg != null) {
          ValiModel valiModel=new ValiModel(reg.order(),reg.error(),reg.reg(),field);
          wapper.addValiModel(valiModel);
        }
      }
    }
    Method[] methods=c.getMethods();
    for (    Method method : methods) {
      ValiSuccess valiSuccess=method.getAnnotation(ValiSuccess.class);
      if (valiSuccess != null) {
        wapper.setMethod(method);
      }
    }
    cache.put(c,wapper);
  }
  return wapper;
}

Fixed version (ground truth):
private static ValiWapper getFieldsFromCache(Class c){
  ValiWapper wapper=cache.get(c);
  if (wapper == null) {
    wapper=new ValiWapper();
    Field[] cFields=c.getDeclaredFields();
    NotNull notNull;
    Reg reg;
    for (    Field field : cFields) {
      field.setAccessible(true);
      notNull=field.getAnnotation(NotNull.class);
      reg=field.getAnnotation(Reg.class);
      if (notNull != null || reg != null) {
        if (notNull != null) {
          ValiModel valiModel=new ValiModel(notNull.order(),notNull.error(),null,field);
          wapper.addValiModel(valiModel);
        }
        if (reg != null) {
          ValiModel valiModel=new ValiModel(reg.order(),reg.error(),reg.reg(),field);
          wapper.addValiModel(valiModel);
        }
      }
    }
    Method[] methods=c.getMethods();
    for (    Method method : methods) {
      ValiSuccess valiSuccess=method.getAnnotation(ValiSuccess.class);
      if (valiSuccess != null) {
        wapper.setMethod(method);
      }
    }
    cache.put(c,wapper);
  }
  return wapper;
}