Program: 86696
Project: 86696
Buggy source:
/** 
 * Register your CommandListener. This will make all annotated commands available to CanaryMod and the help system. Sub Command relations can only be sorted out after availability. That means if you try to register a command that is a sub-command of something that is not registered yet, it will fail. So make sure you add commands in the correct order.
 * @param listener
 * @param owner
 * @param translator
 * @param force
 * @throws CommandDependencyException
 */
public void registerCommands(final CommandListener listener,CommandOwner owner,LocaleHelper translator,boolean force) throws CommandDependencyException {
  Method[] methods=listener.getClass().getDeclaredMethods();
  ArrayList<CanaryCommand> loadedCommands=new ArrayList<CanaryCommand>();
  for (  final Method method : methods) {
    if (!method.isAnnotationPresent(Command.class)) {
      continue;
    }
    Class<?>[] params=method.getParameterTypes();
    if (params.length != 2) {
      Canary.logWarning("String_Node_Str" + method.getName());
      continue;
    }
    if (!(MessageReceiver.class.isAssignableFrom(params[0]) && String[].class.isAssignableFrom(params[1]))) {
      Canary.logWarning("String_Node_Str" + method.getName());
      continue;
    }
    Command meta=method.getAnnotation(Command.class);
    CanaryCommand command=new CanaryCommand(meta,owner,translator){
      @Override protected void execute(      MessageReceiver caller,      String[] parameters){
        try {
          method.invoke(listener,new Object[]{caller,parameters});
        }
 catch (        IllegalArgumentException e) {
          Canary.logStackTrace("String_Node_Str" + e.getMessage(),e);
        }
catch (        IllegalAccessException e) {
          Canary.logStackTrace("String_Node_Str" + e.getMessage(),e);
        }
catch (        InvocationTargetException e) {
          Canary.logStackTrace("String_Node_Str" + e.getMessage(),e);
        }
      }
    }
;
    loadedCommands.add(command);
  }
  Collections.sort(loadedCommands);
  for (  CanaryCommand cmd : loadedCommands) {
    if (cmd.meta.parent().isEmpty()) {
      continue;
    }
    String[] cmdp=cmd.meta.parent().split("String_Node_Str");
    boolean depMissing=true;
    for (    CanaryCommand parent : loadedCommands) {
      CanaryCommand tmp=null;
      for (int i=0; i < cmdp.length; i++) {
        if (i == 0) {
          for (          String palias : parent.meta.aliases()) {
            if (palias.equals(cmdp[i])) {
              tmp=parent;
            }
          }
        }
 else {
          if (tmp == null) {
            break;
          }
          if (tmp.hasSubCommand(cmdp[i])) {
            tmp=tmp.getSubCommand(cmdp[i]);
          }
 else {
            tmp=null;
            break;
          }
        }
      }
      if (tmp != null) {
        cmd.setParent(tmp);
        depMissing=false;
      }
    }
    if (depMissing) {
      throw new CommandDependencyException(cmd.meta.aliases()[0] + "String_Node_Str" + "String_Node_Str"+ cmd.meta.parent()+ "String_Node_Str"+ "String_Node_Str");
    }
  }
  boolean hasDuplicate=false;
  StringBuilder dupes=null;
  for (  CanaryCommand cmd : loadedCommands) {
    for (    String alias : cmd.meta.aliases()) {
      if (commands.containsKey(alias.toLowerCase()) && cmd.meta.parent().isEmpty() && !force) {
        hasDuplicate=true;
        if (dupes == null) {
          dupes=new StringBuilder();
        }
        dupes.append(alias).append("String_Node_Str");
      }
 else {
        if (cmd.meta.parent().isEmpty()) {
          commands.put(alias.toLowerCase(),cmd);
        }
        if (!cmd.meta.helpLookup().isEmpty() && !Canary.help().hasHelp(cmd.meta.helpLookup())) {
          Canary.help().registerCommand(owner,cmd,cmd.meta.helpLookup());
        }
 else {
          Canary.help().registerCommand(owner,cmd);
        }
      }
    }
  }
  if (hasDuplicate && !force) {
    throw new DuplicateCommandException(dupes.toString());
  }
}

Fixed version (ground truth):
/** 
 * Register your CommandListener. This will make all annotated commands available to CanaryMod and the help system. Sub Command relations can only be sorted out after availability. That means if you try to register a command that is a sub-command of something that is not registered yet, it will fail. So make sure you add commands in the correct order.
 * @param listener
 * @param owner
 * @param translator
 * @param force
 * @throws CommandDependencyException
 */
public void registerCommands(final CommandListener listener,CommandOwner owner,LocaleHelper translator,boolean force) throws CommandDependencyException {
  Method[] methods=listener.getClass().getDeclaredMethods();
  ArrayList<CanaryCommand> loadedCommands=new ArrayList<CanaryCommand>();
  for (  final Method method : methods) {
    if (!method.isAnnotationPresent(Command.class)) {
      continue;
    }
    Class<?>[] params=method.getParameterTypes();
    if (params.length != 2) {
      Canary.logWarning("String_Node_Str" + method.getName());
      continue;
    }
    if (!(MessageReceiver.class.isAssignableFrom(params[0]) && String[].class.isAssignableFrom(params[1]))) {
      Canary.logWarning("String_Node_Str" + method.getName());
      continue;
    }
    Command meta=method.getAnnotation(Command.class);
    CanaryCommand command=new CanaryCommand(meta,owner,translator){
      @Override protected void execute(      MessageReceiver caller,      String[] parameters){
        try {
          method.invoke(listener,new Object[]{caller,parameters});
        }
 catch (        IllegalArgumentException e) {
          Canary.logStackTrace("String_Node_Str" + e.getMessage(),e);
        }
catch (        IllegalAccessException e) {
          Canary.logStackTrace("String_Node_Str" + e.getMessage(),e);
        }
catch (        InvocationTargetException e) {
          Canary.logStackTrace("String_Node_Str" + e.getMessage(),e);
        }
      }
    }
;
    loadedCommands.add(command);
  }
  Collections.sort(loadedCommands);
  for (  CanaryCommand cmd : loadedCommands) {
    if (cmd.meta.parent().isEmpty()) {
      continue;
    }
    String[] cmdp=cmd.meta.parent().split("String_Node_Str");
    boolean depMissing=true;
    for (    CanaryCommand parent : loadedCommands) {
      CanaryCommand tmp=null;
      for (int i=0; i < cmdp.length; i++) {
        if (i == 0) {
          for (          String palias : parent.meta.aliases()) {
            if (palias.equals(cmdp[i])) {
              tmp=parent;
            }
          }
        }
 else {
          if (tmp == null) {
            break;
          }
          if (tmp.hasSubCommand(cmdp[i])) {
            tmp=tmp.getSubCommand(cmdp[i]);
          }
 else {
            tmp=null;
            break;
          }
        }
      }
      if (tmp != null) {
        cmd.setParent(tmp);
        depMissing=false;
      }
    }
    for (    CanaryCommand parent : commands.values()) {
      CanaryCommand tmp=null;
      for (int i=0; i < cmdp.length; i++) {
        if (i == 0) {
          for (          String palias : parent.meta.aliases()) {
            if (palias.equals(cmdp[i])) {
              tmp=parent;
            }
          }
        }
 else {
          if (tmp == null) {
            break;
          }
          if (tmp.hasSubCommand(cmdp[i])) {
            tmp=tmp.getSubCommand(cmdp[i]);
          }
 else {
            tmp=null;
            break;
          }
        }
      }
      if (tmp != null) {
        cmd.setParent(tmp);
        depMissing=false;
      }
    }
    if (depMissing) {
      throw new CommandDependencyException(cmd.meta.aliases()[0] + "String_Node_Str" + "String_Node_Str"+ cmd.meta.parent()+ "String_Node_Str"+ "String_Node_Str");
    }
  }
  boolean hasDuplicate=false;
  StringBuilder dupes=null;
  for (  CanaryCommand cmd : loadedCommands) {
    for (    String alias : cmd.meta.aliases()) {
      boolean currentIsDupe=false;
      if (commands.containsKey(alias.toLowerCase()) && cmd.meta.parent().isEmpty() && !force) {
        hasDuplicate=true;
        currentIsDupe=true;
        if (dupes == null) {
          dupes=new StringBuilder();
        }
        dupes.append(alias).append("String_Node_Str");
      }
      if (!currentIsDupe || (currentIsDupe && force)) {
        if (cmd.meta.parent().isEmpty()) {
          commands.put(alias.toLowerCase(),cmd);
        }
        if (!cmd.meta.helpLookup().isEmpty() && !Canary.help().hasHelp(cmd.meta.helpLookup())) {
          Canary.help().registerCommand(owner,cmd,cmd.meta.helpLookup());
        }
 else {
          Canary.help().registerCommand(owner,cmd);
        }
      }
    }
  }
  if (hasDuplicate && !force) {
    throw new DuplicateCommandException(dupes.toString());
  }
}