Program: 79556
Project: 79556
Buggy source:
@Override public void onMessageReceived(MessageReceivedEvent event){
  final JDA jda=event.getJDA();
  final User author=event.getAuthor();
  if (author.isBot())   return;
  if (author.getIdLong() == jda.getSelfUser().getIdLong())   return;
  final Message message=event.getMessage();
  final String prefix;
  if (message.getGuild() == null) {
    prefix=shardUtil.getPrefixStore().getDefaultPrefix();
  }
 else {
    prefix=shardUtil.getPrefixStore().getPrefix(message.getGuild().getIdLong());
  }
  final String content=message.getRawContent();
  final MessageChannel channel=event.getChannel();
  if (content.startsWith(prefix)) {
    String[] split=content.substring(prefix.length()).split("String_Node_Str");
    List<String> args=new ArrayList<>(split.length - 1);
    for (int i=1; i < split.length; i++)     args.add(split[i]);
    String cmdName=split[0].toLowerCase();
    if (commands.containsKey(cmdName)) {
      Command command=commands.get(cmdName);
      try {
        command.invoke(this,event,args,prefix,cmdName);
      }
 catch (      IllegalAccessException e) {
        logger.error("String_Node_Str",cmdName,e);
        channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
      }
catch (      InvocationTargetException e) {
        Throwable cause=e.getCause();
        if (cause == null) {
          logger.error("String_Node_Str",cmdName,e);
          channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
        }
 else         if (cause instanceof PassException) {
        }
 else         if (cause instanceof PermissionError) {
          channel.sendMessage(format("String_Node_Str",author.getAsMention(),prefix,cmdName,Strings.smartJoin(((PermissionError)cause).getFriendlyPerms(),"String_Node_Str"))).queue();
        }
 else         if (cause instanceof PermissionException) {
          try {
            channel.sendMessage(Emotes.getFailure() + "String_Node_Str" + ((PermissionException)cause).getPermission().getName()+ "String_Node_Str").queue();
          }
 catch (          PermissionException ignored) {
          }
        }
 else {
          logger.error("String_Node_Str",cmdName,cause);
          channel.sendMessage(format(Emotes.getFailure() + "String_Node_Str",prefix,cmdName,vagueTrace(cause))).queue();
          if (command.reportErrors)           reportErrorToOwner(cause,message,command);
        }
      }
catch (      PermissionError e) {
        channel.sendMessage(format("String_Node_Str",author.getAsMention(),prefix,cmdName,Strings.smartJoin(e.getFriendlyPerms(),"String_Node_Str"))).queue();
      }
catch (      GuildOnlyError e) {
        channel.sendMessage("String_Node_Str").queue();
      }
catch (      CheckFailure e) {
        channel.sendMessage(format("String_Node_Str",author.getAsMention(),prefix,cmdName)).queue();
      }
catch (      Exception e) {
        logger.error("String_Node_Str",cmdName,e);
        channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
      }
      try {
        shardUtil.getCommandCalls().get(command.name).incrementAndGet();
      }
 catch (      NullPointerException ignored) {
        shardUtil.getCommandCalls().put(command.name,new AtomicInteger(1));
      }
    }
  }
 else   if (message.isMentioned(jda.getSelfUser())) {
    String mention=message.getGuild() == null ? jda.getSelfUser().getAsMention() : message.getGuild().getSelfMember().getAsMention();
    if (content.startsWith(mention) || content.startsWith("String_Node_Str")) {
      String request=Strings.renderMessage(message,message.getGuild(),message.getRawContent().replaceFirst("String_Node_Str","String_Node_Str"));
      if (request.equalsIgnoreCase("String_Node_Str")) {
        channel.sendMessage("String_Node_Str" + prefix + "String_Node_Str").queue();
      }
 else       if (request.length() > 0) {
        chatengineResponse(channel,author.getIdLong(),request,null);
      }
 else {
        String tag=Cog.getTag(jda.getSelfUser());
        channel.sendMessage("String_Node_Str" + tag + "String_Node_Str"+ tag+ "String_Node_Str").queue();
      }
    }
 else     if (channel instanceof PrivateChannel) {
      String request=message.getContent();
      chatengineResponse(channel,author.getIdLong(),request,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void onMessageReceived(MessageReceivedEvent event){
  final JDA jda=event.getJDA();
  final User author=event.getAuthor();
  if (author.isBot())   return;
  if (author.getIdLong() == jda.getSelfUser().getIdLong())   return;
  final Message message=event.getMessage();
  final String prefix;
  if (message.getGuild() == null) {
    prefix=shardUtil.getPrefixStore().getDefaultPrefix();
  }
 else {
    prefix=shardUtil.getPrefixStore().getPrefix(message.getGuild().getIdLong());
  }
  final String content=message.getRawContent();
  final MessageChannel channel=event.getChannel();
  if (content.startsWith(prefix)) {
    String[] split=content.substring(prefix.length()).split("String_Node_Str");
    List<String> args=new ArrayList<>(split.length - 1);
    for (int i=1; i < split.length; i++)     args.add(split[i]);
    String cmdName=split[0].toLowerCase();
    if (commands.containsKey(cmdName)) {
      Command command=commands.get(cmdName);
      try {
        command.invoke(this,event,args,prefix,cmdName);
      }
 catch (      IllegalAccessException e) {
        logger.error("String_Node_Str",cmdName,e);
        channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
      }
catch (      InvocationTargetException e) {
        Throwable cause=e.getCause();
        if (cause == null) {
          logger.error("String_Node_Str",cmdName,e);
          channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
        }
 else         if (cause instanceof PassException) {
        }
 else         if (cause instanceof PermissionError) {
          channel.sendMessage(format("String_Node_Str",author.getAsMention(),prefix,cmdName,Strings.smartJoin(((PermissionError)cause).getFriendlyPerms(),"String_Node_Str"))).queue();
        }
 else         if (cause instanceof PermissionException) {
          try {
            channel.sendMessage(Emotes.getFailure() + "String_Node_Str" + ((PermissionException)cause).getPermission().getName()+ "String_Node_Str").queue();
          }
 catch (          PermissionException ignored) {
          }
        }
 else {
          logger.error("String_Node_Str",cmdName,cause);
          channel.sendMessage(format(Emotes.getFailure() + "String_Node_Str",prefix,cmdName,vagueTrace(cause))).queue();
          if (command.reportErrors)           reportErrorToOwner(cause,message,command);
        }
      }
catch (      PermissionError e) {
        channel.sendMessage(format("String_Node_Str",author.getAsMention(),prefix,cmdName,Strings.smartJoin(e.getFriendlyPerms(),"String_Node_Str"))).queue();
      }
catch (      GuildOnlyError e) {
        channel.sendMessage("String_Node_Str").queue();
      }
catch (      CheckFailure e) {
        channel.sendMessage(format("String_Node_Str",author.getAsMention(),prefix,cmdName)).queue();
      }
catch (      Exception e) {
        logger.error("String_Node_Str",cmdName,e);
        channel.sendMessage(Emotes.getFailure() + "String_Node_Str").queue();
      }
      try {
        shardUtil.getCommandCalls().get(command.name).incrementAndGet();
      }
 catch (      NullPointerException ignored) {
        shardUtil.getCommandCalls().put(command.name,new AtomicInteger(1));
      }
    }
  }
 else   if (message.isMentioned(jda.getSelfUser())) {
    String mention=message.getGuild() == null ? jda.getSelfUser().getAsMention() : message.getGuild().getSelfMember().getAsMention();
    if (content.startsWith(mention) || content.startsWith("String_Node_Str")) {
      String request=Strings.renderMessage(message,message.getGuild(),message.getRawContent().replaceFirst("String_Node_Str","String_Node_Str"));
      if (request.equalsIgnoreCase("String_Node_Str")) {
        channel.sendMessage("String_Node_Str" + prefix + "String_Node_Str").queue();
      }
 else       if (request.length() > 0) {
        chatengineResponse(channel,"String_Node_Str" + author.getId(),request,null);
      }
 else {
        String tag=Cog.getTag(jda.getSelfUser());
        channel.sendMessage("String_Node_Str" + tag + "String_Node_Str"+ tag+ "String_Node_Str").queue();
      }
    }
 else     if (channel instanceof PrivateChannel) {
      String request=message.getContent();
      chatengineResponse(channel,"String_Node_Str" + author.getId(),request,"String_Node_Str");
    }
  }
}