Program: 86697
Project: 86697
Buggy source:
/** 
 * Register an already implemented CanaryCommand to the help system. This will automatically update the help system as well.
 * @param com
 * @param owner
 * @param force force overriding
 * @throws CommandDependencyException
 */
public void registerCommand(CanaryCommand com,CommandOwner owner,boolean force) throws CommandDependencyException {
  for (  CanaryCommand parent : commands.values()) {
    if (com.meta.parent().isEmpty()) {
      continue;
    }
    boolean depMissing=true;
    CanaryCommand tmp=null;
    String[] cmdp=com.meta.parent().split("String_Node_Str");
    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) {
      com.setParent(tmp);
      depMissing=false;
    }
    if (depMissing) {
      throw new CommandDependencyException(com.meta.aliases()[0] + "String_Node_Str" + "String_Node_Str"+ com.meta.parent()+ "String_Node_Str"+ "String_Node_Str");
    }
  }
  boolean hasDuplicate=false;
  StringBuilder dupes=null;
  for (  String alias : com.meta.aliases()) {
    if (commands.containsKey(alias.toLowerCase()) && com.meta.parent().isEmpty() && !force) {
      hasDuplicate=true;
      if (dupes == null) {
        dupes=new StringBuilder();
      }
      dupes.append(alias).append("String_Node_Str");
    }
 else {
      if (com.meta.parent().isEmpty()) {
        commands.put(alias.toLowerCase(),com);
      }
      if (!com.meta.helpLookup().isEmpty() && !Canary.help().hasHelp(com.meta.helpLookup())) {
        Canary.help().registerCommand(owner,com,com.meta.helpLookup());
      }
 else {
        Canary.help().registerCommand(owner,com);
      }
    }
  }
  if (hasDuplicate && !force) {
    throw new DuplicateCommandException(dupes.toString());
  }
}

Fixed version (ground truth):
/** 
 * Register an already implemented CanaryCommand to the help system. This will automatically update the help system as well.
 * @param com
 * @param owner
 * @param force force overriding
 * @throws CommandDependencyException
 */
public void registerCommand(CanaryCommand com,CommandOwner owner,boolean force) throws CommandDependencyException {
  for (  CanaryCommand parent : commands.values()) {
    if (com.meta.parent().isEmpty()) {
      continue;
    }
    boolean depMissing=true;
    CanaryCommand tmp=null;
    String[] cmdp=com.meta.parent().split("String_Node_Str");
    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) {
      com.setParent(tmp);
      depMissing=false;
    }
    if (depMissing) {
      throw new CommandDependencyException(com.meta.aliases()[0] + "String_Node_Str" + "String_Node_Str"+ com.meta.parent()+ "String_Node_Str"+ "String_Node_Str");
    }
  }
  boolean hasDuplicate=false;
  StringBuilder dupes=null;
  for (  String alias : com.meta.aliases()) {
    boolean currentIsDupe=false;
    if (commands.containsKey(alias.toLowerCase()) && com.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 (com.meta.parent().isEmpty()) {
        commands.put(alias.toLowerCase(),com);
      }
      if (!com.meta.helpLookup().isEmpty() && !Canary.help().hasHelp(com.meta.helpLookup())) {
        Canary.help().registerCommand(owner,com,com.meta.helpLookup());
      }
 else {
        Canary.help().registerCommand(owner,com);
      }
    }
  }
  if (hasDuplicate && !force) {
    throw new DuplicateCommandException(dupes.toString());
  }
}