nus-yam/ex-repair huggingface dataset:
Program: 79544
Project: 79544
Buggy source:
@Override public void onViewCreated(View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  swipeRefreshLayout.setOnRefreshListener(() -> {
    swipeRefreshLayout.setRefreshing(true);
    stockPresenter.fetchstock(currentStockName,true,true);
  }
);
  if (currentStock == null)   stockPresenter.fetchstock(currentStockName,false,false);
 else {
    onStockFetched(currentStock);
  }
  EventBus.getInstance().toObserverable().subscribe(o -> {
    if (o instanceof StockSelectorFragment.StockSymbolWrapper) {
      String stockName=((StockSelectorFragment.StockSymbolWrapper)o).stockName;
      SharedPreferencesHelper.setLastViewedStock(stockName);
      currentStockName=stockName;
      currentStock=null;
      stockTrackingBinding.setStock(null);
      stockPresenter.fetchstock(((StockSelectorFragment.StockSymbolWrapper)o).stockName,false,false);
    }
  }
,throwable -> throwable.printStackTrace());
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  swipeRefreshLayout.setOnRefreshListener(() -> {
    swipeRefreshLayout.setRefreshing(true);
    stockPresenter.fetchstock(currentStockName,true,true);
  }
);
  if (currentStock == null)   stockPresenter.fetchstock(currentStockName,false,false);
 else {
    onStockFetched(currentStock);
  }
  EventBus.getInstance().toObserverable().subscribe(o -> {
    if (o instanceof StockSelectorFragment.StockSymbolWrapper) {
      String stockName=((StockSelectorFragment.StockSymbolWrapper)o).stockName;
      stockPresenter.fetchstock(stockName,false,false);
    }
  }
,throwable -> throwable.printStackTrace());
}
Program: 79545
Project: 79545
Buggy source:
@Override public void showError(String message){
  swipeRefreshLayout.setRefreshing(false);
  if (currentStock == null) {
    stockTrackingBinding.setShowRetry(true);
    stockTrackingBinding.setRetryMessage(message);
  }
 else {
    Toast.makeText(StockTrackerApp.getContext(),message,Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
@Override public void showError(String message){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  if (currentStock == null) {
    stockTrackingBinding.setShowRetry(true);
    stockTrackingBinding.setRetryMessage(message);
  }
 else {
    Toast.makeText(StockTrackerApp.getContext(),message,Toast.LENGTH_SHORT).show();
  }
}
Program: 79546
Project: 79546
Buggy source:
@Override public void onStockFetched(Stock stock){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  stockTrackingBinding.setShowRetry(false);
  if (stock != null) {
    if (!stock.isValidStock()) {
      showError(StringUtils.getString(R.string.invalid_stock));
      openStockSelector();
      return;
    }
    Timber.d("String_Node_Str");
    stockTrackingBinding.setStock(stock);
    currentStock=stock;
    drawGraph(stock);
  }
}

Fixed version (ground truth):
@Override public void onStockFetched(Stock stock){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  stockTrackingBinding.setShowRetry(false);
  if (stock != null) {
    if (!stock.isValidStock()) {
      showError(StringUtils.getString(R.string.invalid_stock));
      stockPresenter.unsubscribe();
      openStockSelector();
      return;
    }
    Timber.d("String_Node_Str");
    stockTrackingBinding.setStock(stock);
    currentStock=stock;
    currentStockName=stock.getStockName();
    SharedPreferencesHelper.setLastViewedStock(currentStockName);
    drawGraph(stock);
  }
}
Program: 79547
Project: 79547
Buggy source:
@Override public void destroy(){
  unsubscribe();
}

Fixed version (ground truth):
@Override public void destroy(){
  unsubscribe();
  stockView=null;
}
Program: 79548
Project: 79548
Buggy source:
private Stock getStockFromStockApiResponse(StockApiResponse stockApiResponse){
  Stock stock=new Stock();
  if (stockApiResponse.getErrorMessage() != null) {
    stock.setValidStock(false);
    return stock;
  }
  stock.setValidStock(true);
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  stock.setCurrentPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getClose())));
  stock.setClosed(!isMarkedOpen());
  stock.setOpeningPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getOpen()))));
  stock.setChangeInPrice(Double.valueOf(df.format(getChangeInPrice(stock.getCurrentPrice(),stockApiResponse))));
  stock.setIntradayLowPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getLow()))));
  stock.setIntradayHighPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getHigh())));
  stock.setStockName(stockApiResponse.getMetaData()._2Symbol);
  stock.setLastUpdatedDate(stockApiResponse.getMetaData()._3LastRefreshed);
  HashMap<String,Double> stockDatePriceMap=new HashMap<>();
  for (  String key : stockApiResponse.getTimeSeries15min().keySet())   stockDatePriceMap.put(key,stockApiResponse.getTimeSeries15min().get(key).getClose());
  stock.setHistoricalData(stockDatePriceMap);
  return stock;
}

Fixed version (ground truth):
public static Stock getStockFromStockApiResponse(StockApiResponse stockApiResponse){
  Stock stock=new Stock();
  if (stockApiResponse.getErrorMessage() != null) {
    stock.setValidStock(false);
    return stock;
  }
  stock.setValidStock(true);
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  stock.setCurrentPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getClose())));
  stock.setClosed(!DateUtils.isMarkedOpen());
  stock.setOpeningPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getOpen()))));
  stock.setChangeInPrice(Double.valueOf(df.format(getChangeInPrice(stock.getCurrentPrice(),stockApiResponse))));
  stock.setIntradayLowPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getLow()))));
  stock.setIntradayHighPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getHigh())));
  stock.setStockName(stockApiResponse.getMetaData()._2Symbol);
  stock.setLastUpdatedDate(stockApiResponse.getMetaData()._3LastRefreshed);
  HashMap<String,Double> stockDatePriceMap=new HashMap<>();
  for (  String key : stockApiResponse.getTimeSeries15min().keySet())   stockDatePriceMap.put(key,stockApiResponse.getTimeSeries15min().get(key).getClose());
  stock.setHistoricalData(stockDatePriceMap);
  return stock;
}
Program: 79549
Project: 79549
Buggy source:
private double getChangeInPrice(double currentPrice,StockApiResponse stockApiResponse){
  Date todayDate=DateUtils.convertStringToDate(stockApiResponse.getMetaData()._3LastRefreshed);
  todayDate.setTime(todayDate.getTime() - 2);
  if (!stockApiResponse.getTimeSeries15min().containsKey(DateUtils.convertDateToString(todayDate)))   return 0d;
  return currentPrice - stockApiResponse.getTimeSeries15min().get(DateUtils.convertDateToString(todayDate)).getClose();
}

Fixed version (ground truth):
private static double getChangeInPrice(double currentPrice,StockApiResponse stockApiResponse){
  Date todayDate=DateUtils.convertStringToDate(stockApiResponse.getMetaData()._3LastRefreshed);
  todayDate.setTime(todayDate.getTime() - 2);
  if (!stockApiResponse.getTimeSeries15min().containsKey(DateUtils.convertDateToString(todayDate)))   return 0d;
  return currentPrice - stockApiResponse.getTimeSeries15min().get(DateUtils.convertDateToString(todayDate)).getClose();
}
Program: 79550
Project: 79550
Buggy source:
public HashMap<String,String> getHeaders(){
  return params;
}

Fixed version (ground truth):
public static HashMap<String,String> getHeaders(){
  return params;
}
Program: 79551
Project: 79551
Buggy source:
public static boolean loadPatreonData(){
  String jsonCode;
  try {
    jsonCode=new String(Files.readAllBytes(Paths.get("String_Node_Str")));
  }
 catch (  IOException e) {
    defLog.error("String_Node_Str",e);
    return false;
  }
  patreonData=new JSONObject(jsonCode);
  TLongSet ids=new TLongHashSet();
  for (  Object iter : patreonData.getJSONArray("String_Node_Str")) {
    ids.add(iter instanceof Long ? (Long)iter : Long.parseUnsignedLong((String)iter));
  }
  patronIds=ids;
  return true;
}

Fixed version (ground truth):
public static boolean loadPatreonData(){
  String jsonCode;
  try {
    jsonCode=new String(Files.readAllBytes(Paths.get("String_Node_Str")));
  }
 catch (  NoSuchFileException ignored) {
    return true;
  }
catch (  IOException e) {
    defLog.error("String_Node_Str",e);
    return false;
  }
  patreonData=new JSONObject(jsonCode);
  TLongSet ids=new TLongHashSet();
  for (  Object iter : patreonData.getJSONArray("String_Node_Str")) {
    ids.add(iter instanceof Long ? (Long)iter : Long.parseUnsignedLong((String)iter));
  }
  patronIds=ids;
  return true;
}
Program: 79552
Project: 79552
Buggy source:
private void leaveCmdPreview(Context ctx){
  onGuildMemberLeave(new GuildMemberLeaveEvent(ctx.jda,ctx.event.getResponseNumber(),ctx.guild,ctx.member));
}

Fixed version (ground truth):
private void leaveCmdPreview(Context ctx){
  onGuildMemberLeave(new GuildMemberLeaveEvent(ctx.jda,ctx.event.getResponseNumber(),ctx.member));
}
Program: 79553
Project: 79553
Buggy source:
private void welcomeCmdPreview(Context ctx){
  onGuildMemberJoin(new GuildMemberJoinEvent(ctx.jda,ctx.event.getResponseNumber(),ctx.guild,ctx.member));
}

Fixed version (ground truth):
private void welcomeCmdPreview(Context ctx){
  onGuildMemberJoin(new GuildMemberJoinEvent(ctx.jda,ctx.event.getResponseNumber(),ctx.member));
}
Program: 79554
Project: 79554
Buggy source:
@Override public void onResponse(Call call,Response response) throws IOException {
  JSONObject resp=new JSONObject(response.body().string());
  if (resp.optBoolean("String_Node_Str",false)) {
    logger.error("String_Node_Str",resp.optString("String_Node_Str","String_Node_Str"));
    channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
  }
  String toSend;
  if (respPrefix == null)   toSend=resp.getString("String_Node_Str");
 else   toSend=respPrefix + resp.getString("String_Node_Str");
  channel.sendMessage(toSend).queue();
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response) throws IOException {
  JSONObject resp=new JSONObject(response.body().string());
  if (!resp.optBoolean("String_Node_Str",false)) {
    logger.error("String_Node_Str",resp.optString("String_Node_Str","String_Node_Str"));
    channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  String toSend;
  if (respPrefix == null)   toSend=resp.getString("String_Node_Str");
 else   toSend=respPrefix + resp.getString("String_Node_Str");
  channel.sendMessage(toSend).queue();
}
Program: 79555
Project: 79555
Buggy source:
public void chatengineResponse(MessageChannel channel,long sessionID,String query,String respPrefix){
  String reqDest=getConfig().optString("String_Node_Str",null);
  if (reqDest == null) {
    channel.sendMessage("String_Node_Str").queue();
    return;
  }
  channel.sendTyping().queue();
  http.newCall(new Request.Builder().post(RequestBody.create(JSON_MEDIA_TYPE,new JSONObject().put("String_Node_Str",sessionID).put("String_Node_Str",query).toString())).url(reqDest).header("String_Node_Str",getKeys().optString("String_Node_Str")).build()).enqueue(new okhttp3.Callback(){
    @Override public void onFailure(    Call call,    IOException e){
      logger.error("String_Node_Str",e);
      channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
    }
    @Override public void onResponse(    Call call,    Response response) throws IOException {
      JSONObject resp=new JSONObject(response.body().string());
      if (resp.optBoolean("String_Node_Str",false)) {
        logger.error("String_Node_Str",resp.optString("String_Node_Str","String_Node_Str"));
        channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
      }
      String toSend;
      if (respPrefix == null)       toSend=resp.getString("String_Node_Str");
 else       toSend=respPrefix + resp.getString("String_Node_Str");
      channel.sendMessage(toSend).queue();
    }
  }
);
}

Fixed version (ground truth):
public void chatengineResponse(MessageChannel channel,String sessionID,String query,String respPrefix){
  String reqDest=getConfig().optString("String_Node_Str",null);
  if (reqDest == null) {
    channel.sendMessage("String_Node_Str").queue();
    return;
  }
  channel.sendTyping().queue();
  http.newCall(new Request.Builder().post(RequestBody.create(JSON_MEDIA_TYPE,new JSONObject().put("String_Node_Str",sessionID).put("String_Node_Str",query).toString())).url(reqDest).header("String_Node_Str",getKeys().optString("String_Node_Str")).build()).enqueue(new okhttp3.Callback(){
    @Override public void onFailure(    Call call,    IOException e){
      logger.error("String_Node_Str",e);
      channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
    }
    @Override public void onResponse(    Call call,    Response response) throws IOException {
      JSONObject resp=new JSONObject(response.body().string());
      if (!resp.optBoolean("String_Node_Str",false)) {
        logger.error("String_Node_Str",resp.optString("String_Node_Str","String_Node_Str"));
        channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
        return;
      }
      String toSend;
      if (respPrefix == null)       toSend=resp.getString("String_Node_Str");
 else       toSend=respPrefix + resp.getString("String_Node_Str");
      channel.sendMessage(toSend).queue();
    }
  }
);
}
Program: 79557
Project: 79557
Buggy source:
private void answerQuestion(byte answer){
  try {
    JSONObject json=new JSONObject(client.newCall(new Request.Builder().get().url(Strings.buildQueryUrl(ANSWER_URL,"String_Node_Str",session,"String_Node_Str",signature,"String_Node_Str",str(stepInfo.getStepNum()),"String_Node_Str",Byte.toString(answer))).build()).execute().body().string());
    stepInfo=new StepInfo(json);
    if (stepInfo.getProgression() > 90) {
      presentGuess();
    }
 else {
      presentNextQuestion();
    }
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
private void answerQuestion(byte answer){
  try {
    JSONObject json=new JSONObject(client.newCall(new Request.Builder().get().url(Strings.buildQueryUrl(ANSWER_URL,"String_Node_Str",session,"String_Node_Str",signature,"String_Node_Str",str(stepInfo.getStepNum()),"String_Node_Str",Byte.toString(answer))).build()).execute().body().string());
    try {
      stepInfo=new StepInfo(json);
    }
 catch (    JSONException ignored) {
      emb.setImage(null).clearFields().addField("String_Node_Str","String_Node_Str",false);
      onFinish.run();
    }
    if (stepInfo.getProgression() > 90) {
      presentGuess();
    }
 else {
      presentNextQuestion();
    }
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
}
Program: 79558
Project: 79558
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",aliases="String_Node_Str") public void cmdAkinator(Context ctx){
  if (ctx.channel instanceof TextChannel && !ctx.member.hasPermission((Channel)ctx.channel,Permission.MESSAGE_ADD_REACTION,Permission.MESSAGE_EMBED_LINKS)) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  AkinatorGame game;
  try {
    game=new AkinatorGame(ctx);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",aliases="String_Node_Str") public void cmdAkinator(Context ctx){
  if (ctx.channel instanceof TextChannel && !ctx.member.hasPermission((Channel)ctx.channel,Permission.MESSAGE_ADD_REACTION,Permission.MESSAGE_EMBED_LINKS)) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  try {
    new AkinatorGame(ctx);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
  }
catch (  JSONException ignored) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
  }
}
Program: 79560
Project: 79560
Buggy source:
@Override public void onTrackStart(AudioPlayer player,AudioTrack track){
  current=track;
  if (track.getUserData() != null) {
    AudioTrackInfo info=track.getInfo();
    track.getUserData(ExtraTrackInfo.class).textChannel.sendMessage("String_Node_Str" + mentionClean(info.title) + "String_Node_Str"+ Bot.formatDuration(info.length / 1000L)+ "String_Node_Str").queue();
  }
}

Fixed version (ground truth):
@Override public void onTrackStart(AudioPlayer player,AudioTrack track){
  try {
    current=track;
    if (track.getUserData() != null) {
      AudioTrackInfo info=track.getInfo();
      track.getUserData(ExtraTrackInfo.class).textChannel.sendMessage("String_Node_Str" + mentionClean(info.title) + "String_Node_Str"+ Bot.formatDuration(info.length / 1000L)+ "String_Node_Str").queue();
    }
  }
 catch (  PermissionException ignored) {
  }
}
Program: 79561
Project: 79561
Buggy source:
@Override public void onTrackStuck(AudioPlayer player,AudioTrack track,long thresholdMs){
  if (track.getUserData() != null) {
    track.getUserData(ExtraTrackInfo.class).textChannel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
  }
  track.stop();
  nextTrack();
}

Fixed version (ground truth):
@Override public void onTrackStuck(AudioPlayer player,AudioTrack track,long thresholdMs){
  if (track.getUserData() != null) {
    try {
      track.getUserData(ExtraTrackInfo.class).textChannel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
    }
 catch (    PermissionException ignored) {
    }
  }
  track.stop();
  nextTrack();
}
Program: 79562
Project: 79562
Buggy source:
@Override public void onTrackException(AudioPlayer player,AudioTrack track,FriendlyException exception){
  if (track.getUserData() != null) {
    track.getUserData(ExtraTrackInfo.class).textChannel.sendMessage("String_Node_Str" + exception.getMessage()).queue();
  }
}

Fixed version (ground truth):
@Override public void onTrackException(AudioPlayer player,AudioTrack track,FriendlyException exception){
  if (track.getUserData() != null) {
    try {
      track.getUserData(ExtraTrackInfo.class).textChannel.sendMessage("String_Node_Str" + exception.getMessage()).queue();
    }
 catch (    PermissionException ignored) {
    }
  }
}
Program: 79565
Project: 79565
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",perms={"String_Node_Str"},hidden=true,aliases={"String_Node_Str"},thread=true) public void cmdPatReload(Context ctx){
  boolean success=Bot.loadPatreonData();
  if (success) {
    ctx.send(Emotes.getSuccess() + "String_Node_Str");
  }
 else {
    ctx.send(Emotes.getFailure() + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",perms={"String_Node_Str"},hidden=true,aliases={"String_Node_Str"},thread=true) public void cmdPatReload(Context ctx){
  boolean success=Bot.loadPatreonData();
  if (success) {
    ctx.send(Emotes.getSuccess() + "String_Node_Str").queue();
  }
 else {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
  }
}
Program: 79566
Project: 79566
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",aliases={"String_Node_Str","String_Node_Str"}) public void cmdSupporters(Context ctx){
  if (!(Bot.patreonData.has("String_Node_Str") && Bot.patreonData.has("String_Node_Str"))) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  EmbedBuilder emb=newEmbedWithAuthor(ctx).setColor(randomColor()).setDescription("String_Node_Str").setFooter("String_Node_Str",null);
  StringBuilder randBuilder=new StringBuilder();
  StringBuilder alwaysBuilder=new StringBuilder();
  List<Object> randList=Bot.patreonData.getJSONArray("String_Node_Str").toList();
  Collections.shuffle(randList);
  for (int i=0; i < randList.size() && i < 10; i++) {
    randBuilder.append("String_Node_Str").append((String)randList.get(i)).append('\n');
  }
  emb.addField("String_Node_Str",randBuilder.toString(),false);
  for (  Object name : Bot.patreonData.getJSONArray("String_Node_Str")) {
    alwaysBuilder.append("String_Node_Str").append((String)name).append('\n');
  }
  emb.addField("String_Node_Str",alwaysBuilder.toString(),false);
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",aliases={"String_Node_Str","String_Node_Str"}) public void cmdSupporters(Context ctx){
  if (!(Bot.patreonData.has("String_Node_Str") && Bot.patreonData.has("String_Node_Str"))) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  EmbedBuilder emb=newEmbedWithAuthor(ctx).setColor(randomColor()).setDescription("String_Node_Str").setFooter("String_Node_Str",null);
  StringBuilder randBuilder=new StringBuilder();
  StringBuilder alwaysBuilder=new StringBuilder();
  List<Object> randList=Bot.patreonData.getJSONArray("String_Node_Str").toList();
  Collections.shuffle(randList);
  for (int i=0; i < randList.size() && i < 10; i++) {
    randBuilder.append("String_Node_Str").append((String)randList.get(i)).append('\n');
  }
  emb.addField("String_Node_Str",randBuilder.toString(),false);
  for (  Object name : Bot.patreonData.getJSONArray("String_Node_Str")) {
    alwaysBuilder.append("String_Node_Str").append((String)name).append('\n');
  }
  emb.addField("String_Node_Str",alwaysBuilder.toString(),false);
  ctx.send(emb.build()).queue();
}
Program: 79568
Project: 79568
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",aliases={"String_Node_Str"},thread=true) public void cmdGoogle(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  final String query=String.join("String_Node_Str",ctx.args);
  String key=bot.getKeys().optString("String_Node_Str");
  if (key == null) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    bot.logger.error("String_Node_Str",e);
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  ctx.channel.sendTyping().queue();
  try {
    ctx.send(cache.get(format(API_URL_BASE,key,encodedQuery))).queue();
  }
 catch (  ExecutionException e) {
    logger.error("String_Node_Str",e.getCause());
    ctx.send(FAILED_EMBED).queue();
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",aliases={"String_Node_Str"},thread=true) public void cmdGoogle(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  final String query=String.join("String_Node_Str",ctx.args);
  String key=bot.getKeys().optString("String_Node_Str");
  if (key == null) {
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    bot.logger.error("String_Node_Str",e);
    ctx.send(Emotes.getFailure() + "String_Node_Str").queue();
    return;
  }
  ctx.channel.sendTyping().queue();
  try {
    ctx.send(cache.get(format(API_URL_BASE,key,encodedQuery))).queue();
  }
 catch (  ExecutionException|UncheckedExecutionException e) {
    logger.error("String_Node_Str",e.getCause());
    ctx.send(FAILED_EMBED).queue();
  }
}
Program: 79569
Project: 79569
Buggy source:
private void quoteCmdList(Context ctx) throws SQLException {
  List<Quote> quotes=dao.queryBuilder().orderBy("String_Node_Str",true).query();
  if (quotes.size() < 1) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  String[] renderedQuotes=new String[quotes.size()];
  for (int i=0; i < quotes.size(); i++)   renderedQuotes[i]=quotes.get(i).render();
  String name;
  Color color;
  if (ctx.guild == null) {
    color=Color.BLUE;
    name=ctx.author.getName();
  }
 else {
    color=val(ctx.member.getColor()).or(Color.RED);
    name=ctx.member.getEffectiveName();
  }
  PaginatorBuilder builder=new PaginatorBuilder().setColumns(1).useNumberedItems(false).setItemsPerPage(12).waitOnSinglePage(false).showPageNumbers(true).setColor(color).setText("String_Node_Str").setItems(renderedQuotes).setFinalAction(msg -> {
    msg.editMessage(new MessageBuilder().append("String_Node_Str").setEmbed(new EmbedBuilder().setColor(color).setAuthor(name,null,ctx.author.getEffectiveAvatarUrl()).setFooter("String_Node_Str",null).build()).build()).queue();
    try {
      msg.clearReactions().queue();
    }
 catch (    PermissionException ignored) {
    }
  }
).setEventWaiter(bot.getEventWaiter()).setTimeout(2,TimeUnit.MINUTES).addUsers(ctx.author);
  builder.build().paginate(ctx.channel,1);
}

Fixed version (ground truth):
private void quoteCmdList(Context ctx) throws SQLException {
  List<Quote> quotes=dao.queryBuilder().orderBy("String_Node_Str",true).query();
  if (quotes.size() < 1) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  String[] renderedQuotes=new String[quotes.size()];
  for (int i=0; i < quotes.size(); i++)   renderedQuotes[i]=quotes.get(i).render();
  int page=1;
  if (ctx.args.size() > 1) {
    if (ctx.args.get(1).matches("String_Node_Str")) {
      int wantedPage=Integer.parseInt(ctx.args.get(1));
      int max=(int)Math.ceil(renderedQuotes.length / 12);
      if (wantedPage > max) {
        ctx.send("String_Node_Str" + max + "String_Node_Str").queue();
        return;
      }
 else {
        page=wantedPage;
      }
    }
  }
  String name;
  Color color;
  if (ctx.guild == null) {
    color=Color.BLUE;
    name=ctx.author.getName();
  }
 else {
    color=val(ctx.member.getColor()).or(Color.RED);
    name=ctx.member.getEffectiveName();
  }
  PaginatorBuilder builder=new PaginatorBuilder().setColumns(1).useNumberedItems(false).setItemsPerPage(12).waitOnSinglePage(false).showPageNumbers(true).setColor(color).setText("String_Node_Str").setItems(renderedQuotes).setFinalAction(msg -> {
    msg.editMessage(new MessageBuilder().append("String_Node_Str").setEmbed(new EmbedBuilder().setColor(color).setAuthor(name,null,ctx.author.getEffectiveAvatarUrl()).setFooter("String_Node_Str",null).build()).build()).queue();
    try {
      msg.clearReactions().queue();
    }
 catch (    PermissionException ignored) {
    }
  }
).setEventWaiter(bot.getEventWaiter()).setTimeout(2,TimeUnit.MINUTES).addUsers(ctx.author);
  builder.build().paginate(ctx.channel,page);
}
Program: 79570
Project: 79570
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",aliases={"String_Node_Str"}) public void cmdInvite(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send(ctx.jda.asBot().getInviteUrl(PERMS_NEEDED)).queue();
  }
 else {
    if (!ctx.rawArgs.matches("String_Node_Str")) {
      ctx.send("String_Node_Str").queue();
      return;
    }
    ctx.send(format("String_Node_Str",ctx.rawArgs)).queue();
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",aliases={"String_Node_Str"}) public void cmdInvite(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send('<' + ctx.jda.asBot().getInviteUrl(PERMS_NEEDED) + '>').queue();
  }
 else {
    if (!ctx.rawArgs.matches("String_Node_Str")) {
      ctx.send("String_Node_Str").queue();
      return;
    }
    ctx.send(format("String_Node_Str",ctx.rawArgs)).queue();
  }
}
Program: 79571
Project: 79571
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str") public void cmdCharlie(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send(Emotes.getFailure() + ' ' + "String_Node_Str").queue();
    return;
  }
  String question=ctx.rawArgs.endsWith("String_Node_Str") ? ctx.rawArgs : ctx.rawArgs + "String_Node_Str";
  ctx.send(format("String_Node_Str",question,(randint(0,1) == 1 ? "String_Node_Str" : "String_Node_Str"))).queue();
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str") public void cmdCharlie(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  String question=ctx.rawArgs.endsWith("String_Node_Str") ? ctx.rawArgs : ctx.rawArgs + "String_Node_Str";
  ctx.send(format("String_Node_Str",question,(randint(0,1) == 1 ? "String_Node_Str" : "String_Node_Str"))).queue();
}
Program: 79573
Project: 79573
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",aliases={"String_Node_Str"},thread=true) public void cmdGoogle(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send(Emotes.getFailure() + ' ' + "String_Node_Str").queue();
    return;
  }
  final String query=String.join("String_Node_Str",ctx.args);
  String key=bot.getKeys().optString("String_Node_Str");
  if (key == null) {
    ctx.send(Emotes.getFailure() + ' ' + "String_Node_Str").queue();
    return;
  }
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    bot.logger.error("String_Node_Str",e);
    ctx.send(Emotes.getFailure() + ' ' + "String_Node_Str").queue();
    return;
  }
  ctx.channel.sendTyping().queue();
  try {
    ctx.send(cache.get(format(API_URL_BASE,key,encodedQuery))).queue();
  }
 catch (  ExecutionException e) {
    logger.error("String_Node_Str",e.getCause());
    ctx.send(FAILED_EMBED).queue();
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",aliases={"String_Node_Str"},thread=true) public void cmdGoogle(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send(Emotes.getFailure() + ' ' + "String_Node_Str").queue();
    return;
  }
  final String query=String.join("String_Node_Str",ctx.args);
  String key=bot.getKeys().optString("String_Node_Str");
  if (key == null) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    bot.logger.error("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    return;
  }
  ctx.channel.sendTyping().queue();
  try {
    ctx.send(cache.get(format(API_URL_BASE,key,encodedQuery))).queue();
  }
 catch (  ExecutionException e) {
    logger.error("String_Node_Str",e.getCause());
    ctx.send(FAILED_EMBED).queue();
  }
}
Program: 79576
Project: 79576
Buggy source:
public static void checkPerms(Context ctx,String[] permsRequired){
  if (!Permissions.check(permsRequired,ctx))   throw new PermissionError("String_Node_Str");
}

Fixed version (ground truth):
public static void checkPerms(Context ctx,String[] permsRequired){
  if (!Permissions.check(permsRequired,ctx))   throw new PermissionError("String_Node_Str").setPerms(permsRequired);
}
Program: 79578
Project: 79578
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",aliases={"String_Node_Str"},thread=true) public void cmdGoogle(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  final String query=String.join("String_Node_Str",ctx.args);
  String key=bot.getKeys().optString("String_Node_Str");
  if (key == null) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    bot.logger.error("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    return;
  }
  try {
    ctx.send(cache.get(format(API_URL_BASE,key,encodedQuery))).queue();
  }
 catch (  ExecutionException e) {
    logger.error("String_Node_Str",e.getCause());
    ctx.send(FAILED_EMBED).queue();
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",aliases={"String_Node_Str"},thread=true) public void cmdGoogle(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  final String query=String.join("String_Node_Str",ctx.args);
  String key=bot.getKeys().optString("String_Node_Str");
  if (key == null) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    bot.logger.error("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    return;
  }
  ctx.channel.sendTyping().queue();
  try {
    ctx.send(cache.get(format(API_URL_BASE,key,encodedQuery))).queue();
  }
 catch (  ExecutionException e) {
    logger.error("String_Node_Str",e.getCause());
    ctx.send(FAILED_EMBED).queue();
  }
}
Program: 79580
Project: 79580
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",guildOnly=true) public void cmdPlay(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  if (ctx.guild.getSelfMember().getVoiceState().getChannel() == null) {
    summon(ctx);
  }
 else   if (ctx.guild.getSelfMember().getVoiceState().getChannel().getIdLong() != ctx.member.getVoiceState().getChannel().getIdLong()) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  AudioState state=getAudioState(ctx.guild);
  if (state.scheduler.queue.size() >= 10) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  final String term=String.join("String_Node_Str",ctx.args);
  ctx.message.addReaction("String_Node_Str").queue();
  playerManager.loadItem(term,new TrackLoadHandler(ctx,state,playerManager,term));
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",usage="String_Node_Str",guildOnly=true) public void cmdPlay(Context ctx){
  if (ctx.rawArgs.length() < 1) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  try {
    if (ctx.guild.getSelfMember().getVoiceState().getChannel() == null) {
      summon(ctx);
    }
 else     if (ctx.guild.getSelfMember().getVoiceState().getChannel().getIdLong() != ctx.member.getVoiceState().getChannel().getIdLong()) {
      ctx.send("String_Node_Str").queue();
      return;
    }
  }
 catch (  NullPointerException e) {
    logger.warn("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    return;
  }
  AudioState state=getAudioState(ctx.guild);
  if (state.scheduler.queue.size() >= 10) {
    ctx.send("String_Node_Str").queue();
    return;
  }
  final String term=String.join("String_Node_Str",ctx.args);
  ctx.message.addReaction("String_Node_Str").queue();
  playerManager.loadItem(term,new TrackLoadHandler(ctx,state,playerManager,term));
}
Program: 79587
Project: 79587
Buggy source:
protected String formatMessage(String msg,Guild guild,Member member,String def){
  return Strings.replace(msg.replace("String_Node_Str",def),SUB_REGEX,m -> {
    return Strings.createMap().map("String_Node_Str",member::getAsMention).map("String_Node_Str",member::getEffectiveName).map("String_Node_Str",() -> getTag(member.getUser())).map("String_Node_Str",() -> member.getUser().getDiscriminator()).map("String_Node_Str",() -> member.getUser().getId()).map("String_Node_Str",guild::getName).map("String_Node_Str",guild::getIconUrl).map("String_Node_Str",guild::getId).map("String_Node_Str",() -> guild.getOwner().getEffectiveName()).map("String_Node_Str",member::getAsMention).map("String_Node_Str",member::getAsMention).map("String_Node_Str",() -> new Date().toString()).map("String_Node_Str",() -> new Date().toString()).map("String_Node_Str",guild::getName).map("String_Node_Str",() -> bot.getShardUtil().getPrefixStore().getPrefix(guild.getIdLong())).map("String_Node_Str","String_Node_Str").exec(m);
  }
);
}

Fixed version (ground truth):
private String formatMessage(String msg,Guild guild,Member member,String def){
  return Strings.replace(msg.replace("String_Node_Str",def),SUB_REGEX,m -> {
    return Strings.createMap().map("String_Node_Str",member::getAsMention).map("String_Node_Str",member::getEffectiveName).map("String_Node_Str",() -> getTag(member.getUser())).map("String_Node_Str",member.getUser()::getDiscriminator).map("String_Node_Str",member.getUser()::getId).map("String_Node_Str",guild::getName).map("String_Node_Str",guild::getIconUrl).map("String_Node_Str",guild::getId).map("String_Node_Str",guild.getOwner()::getEffectiveName).map("String_Node_Str",member::getAsMention).map("String_Node_Str",member::getAsMention).map("String_Node_Str",() -> new Date().toString()).map("String_Node_Str",() -> new Date().toString()).map("String_Node_Str",guild::getName).map("String_Node_Str",() -> bot.getShardUtil().getPrefixStore().getPrefix(guild.getIdLong())).map("String_Node_Str","String_Node_Str").exec(m);
  }
);
}
Program: 79588
Project: 79588
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",guildOnly=true,aliases={"String_Node_Str","String_Node_Str"},thread=true,perms={"String_Node_Str","String_Node_Str","String_Node_Str"},usage="String_Node_Str") public void welcomeControl(Context ctx) throws SQLException {
  if (ctx.rawArgs.length() < 1) {
    ctx.send(NO_COMMAND).queue();
    return;
  }
  String invoked=ctx.args.get(0);
  try {
    if (invoked.equals("String_Node_Str"))     welcomeCmdStatus(ctx);
 else     if (invoked.equals("String_Node_Str"))     welcomeCmdShow(ctx);
 else     if (invoked.equals("String_Node_Str"))     welcomeCmdSet(ctx);
 else     if (invoked.equals("String_Node_Str"))     welcomeCmdToggle(ctx);
 else     ctx.send(NO_COMMAND).queue();
  }
 catch (  NullPointerException e) {
    logger.warn("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    try {
      messageDao.createOrUpdate(new GuildWelcomeMessages(ctx.guild.getIdLong(),"String_Node_Str","String_Node_Str",true,true));
    }
 catch (    SQLException ex) {
      logger.error("String_Node_Str",ex);
      ctx.send("String_Node_Str").queue();
      return;
    }
    ctx.send("String_Node_Str").queue();
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",guildOnly=true,aliases={"String_Node_Str","String_Node_Str"},thread=true,perms={"String_Node_Str","String_Node_Str","String_Node_Str"},usage="String_Node_Str") public void welcomeControl(Context ctx) throws SQLException {
  if (ctx.rawArgs.length() < 1) {
    ctx.send(NO_COMMAND).queue();
    return;
  }
  String invoked=ctx.args.get(0);
  try {
    if (invoked.equals("String_Node_Str"))     welcomeCmdStatus(ctx);
 else     if (invoked.equals("String_Node_Str"))     welcomeCmdShow(ctx);
 else     if (invoked.equals("String_Node_Str"))     welcomeCmdSet(ctx);
 else     if (invoked.equals("String_Node_Str"))     welcomeCmdToggle(ctx);
 else     if (invoked.equals("String_Node_Str"))     allCmdHelp(ctx);
 else     ctx.send(NO_COMMAND).queue();
  }
 catch (  NullPointerException e) {
    logger.warn("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    try {
      messageDao.createOrUpdate(new GuildWelcomeMessages(ctx.guild.getIdLong(),"String_Node_Str","String_Node_Str",true,true));
    }
 catch (    SQLException ex) {
      logger.error("String_Node_Str",ex);
      ctx.send("String_Node_Str").queue();
      return;
    }
    ctx.send("String_Node_Str").queue();
  }
}
Program: 79589
Project: 79589
Buggy source:
@Command(name="String_Node_Str",desc="String_Node_Str",guildOnly=true,aliases={"String_Node_Str","String_Node_Str"},thread=true,perms={"String_Node_Str","String_Node_Str","String_Node_Str"},usage="String_Node_Str") public void leaveControl(Context ctx) throws SQLException {
  if (ctx.rawArgs.length() < 1) {
    ctx.send(NO_COMMAND).queue();
    return;
  }
  String invoked=ctx.args.get(0);
  try {
    if (invoked.equals("String_Node_Str"))     leaveCmdStatus(ctx);
 else     if (invoked.equals("String_Node_Str"))     leaveCmdShow(ctx);
 else     if (invoked.equals("String_Node_Str"))     leaveCmdSet(ctx);
 else     if (invoked.equals("String_Node_Str"))     leaveCmdToggle(ctx);
 else     ctx.send(NO_COMMAND).queue();
  }
 catch (  NullPointerException e) {
    logger.warn("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    try {
      messageDao.createOrUpdate(new GuildWelcomeMessages(ctx.guild.getIdLong(),"String_Node_Str","String_Node_Str",true,true));
    }
 catch (    SQLException ex) {
      logger.error("String_Node_Str",ex);
      ctx.send("String_Node_Str").queue();
      return;
    }
    ctx.send("String_Node_Str").queue();
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",desc="String_Node_Str",guildOnly=true,aliases={"String_Node_Str","String_Node_Str"},thread=true,perms={"String_Node_Str","String_Node_Str","String_Node_Str"},usage="String_Node_Str") public void leaveControl(Context ctx) throws SQLException {
  if (ctx.rawArgs.length() < 1) {
    ctx.send(NO_COMMAND).queue();
    return;
  }
  String invoked=ctx.args.get(0);
  try {
    if (invoked.equals("String_Node_Str"))     leaveCmdStatus(ctx);
 else     if (invoked.equals("String_Node_Str"))     leaveCmdShow(ctx);
 else     if (invoked.equals("String_Node_Str"))     leaveCmdSet(ctx);
 else     if (invoked.equals("String_Node_Str"))     leaveCmdToggle(ctx);
 else     if (invoked.equals("String_Node_Str"))     allCmdHelp(ctx);
 else     ctx.send(NO_COMMAND).queue();
  }
 catch (  NullPointerException e) {
    logger.warn("String_Node_Str",e);
    ctx.send("String_Node_Str").queue();
    try {
      messageDao.createOrUpdate(new GuildWelcomeMessages(ctx.guild.getIdLong(),"String_Node_Str","String_Node_Str",true,true));
    }
 catch (    SQLException ex) {
      logger.error("String_Node_Str",ex);
      ctx.send("String_Node_Str").queue();
      return;
    }
    ctx.send("String_Node_Str").queue();
  }
}
Program: 79590
Project: 79590
Buggy source:
@EventHandler(event=GuildMemberJoinEvent.class,threaded=true) public void onGuildMemberJoin(GuildMemberJoinEvent event){
  if (event.getMember().getUser().getIdLong() == bot.getJda().getSelfUser().getIdLong())   return;
  if (!event.getGuild().isAvailable())   return;
  try {
    GuildWelcomeMessages queryResult=messageDao.queryForId(event.getGuild().getIdLong());
    if (queryResult == null || !queryResult.isWelcomeEnabled())     return;
    String msg=formatMessage(queryResult.getWelcome(),event.getGuild(),event.getMember(),DEFAULT_WELCOME);
    event.getGuild().getPublicChannel().sendMessage(Context.truncate(msg)).queue();
  }
 catch (  SQLException e) {
    logger.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@EventHandler(event=GuildMemberJoinEvent.class,threaded=true) public void onGuildMemberJoin(GuildMemberJoinEvent event){
  if (event.getMember().getUser().getIdLong() == bot.getJda().getSelfUser().getIdLong())   return;
  if (!event.getGuild().isAvailable())   return;
  try {
    GuildWelcomeMessages queryResult=messageDao.queryForId(event.getGuild().getIdLong());
    if (queryResult == null) {
      try {
        queryResult=initGuild(event.getGuild());
      }
 catch (      SQLException ex) {
        logger.error("String_Node_Str",ex);
        return;
      }
    }
    if (!queryResult.isWelcomeEnabled())     return;
    String msg=formatMessage(queryResult.getWelcome(),event.getGuild(),event.getMember(),DEFAULT_WELCOME);
    event.getGuild().getPublicChannel().sendMessage(Context.truncate(msg)).queue();
  }
 catch (  SQLException e) {
    logger.warn("String_Node_Str",e);
  }
}
Program: 79591
Project: 79591
Buggy source:
@EventHandler(event=GuildMemberLeaveEvent.class,threaded=true) public void onGuildMemberLeave(GuildMemberLeaveEvent event){
  if (event.getMember().getUser().getIdLong() == bot.getJda().getSelfUser().getIdLong())   return;
  if (!event.getGuild().isAvailable())   return;
  try {
    GuildWelcomeMessages queryResult=messageDao.queryForId(event.getGuild().getIdLong());
    if (queryResult == null || !queryResult.isLeaveEnabled())     return;
    String msg=formatMessage(queryResult.getLeave(),event.getGuild(),event.getMember(),DEFAULT_LEAVE);
    event.getGuild().getPublicChannel().sendMessage(Context.truncate(msg)).queue();
  }
 catch (  SQLException e) {
    logger.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@EventHandler(event=GuildMemberLeaveEvent.class,threaded=true) public void onGuildMemberLeave(GuildMemberLeaveEvent event){
  if (event.getMember().getUser().getIdLong() == bot.getJda().getSelfUser().getIdLong())   return;
  if (!event.getGuild().isAvailable())   return;
  try {
    GuildWelcomeMessages queryResult=messageDao.queryForId(event.getGuild().getIdLong());
    if (queryResult == null) {
      try {
        queryResult=initGuild(event.getGuild());
      }
 catch (      SQLException ex) {
        logger.error("String_Node_Str",ex);
        return;
      }
    }
    if (!queryResult.isLeaveEnabled())     return;
    String msg=formatMessage(queryResult.getLeave(),event.getGuild(),event.getMember(),DEFAULT_LEAVE);
    event.getGuild().getPublicChannel().sendMessage(Context.truncate(msg)).queue();
  }
 catch (  SQLException e) {
    logger.warn("String_Node_Str",e);
  }
}
Program: 79592
Project: 79592
Buggy source:
public static String replace(String input,Pattern regex,StringReplacerCallback callback){
  StringBuffer result=new StringBuffer();
  Matcher matcher=regex.matcher(input);
  while (matcher.find()) {
    result.append(callback.replace(matcher.group(1)));
  }
  matcher.appendTail(result);
  return result.toString();
}

Fixed version (ground truth):
public static String replace(String input,Pattern regex,StringReplacerCallback callback){
  StringBuffer result=new StringBuffer();
  Matcher matcher=regex.matcher(input);
  while (matcher.find()) {
    String rep=callback.replace(matcher.group(1));
    matcher.appendReplacement(result,Matcher.quoteReplacement(rep));
  }
  matcher.appendTail(result);
  return result.toString();
}