Program: 167713
Project: 167713
Buggy source:
public GenericTypeOperationHandler(CommandContext ctx,String nodeType,String idProperty,String... excludeOperations){
  super(ctx,"String_Node_Str",true);
  if (nodeType == null || nodeType.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str" + (nodeType == null ? "String_Node_Str" : "String_Node_Str"));
  }
  if (nodeType.startsWith("String_Node_Str") || nodeType.startsWith("String_Node_Str")) {
    int nextSep=nodeType.indexOf('/',7);
    if (nextSep < 0) {
      throw new IllegalArgumentException("String_Node_Str" + nodeType + "String_Node_Str");
    }
    nodeType=nodeType.substring(nextSep);
    this.nodeType=nodeType;
  }
 else {
    this.nodeType=nodeType;
  }
  helpArg=new ArgumentWithoutValue(this,"String_Node_Str","String_Node_Str");
  addRequiredPath(nodeType);
  this.commandName=getRequiredType();
  if (this.commandName == null) {
    throw new IllegalArgumentException("String_Node_Str" + nodeType + "String_Node_Str");
  }
  this.idProperty=idProperty;
  if (excludeOperations != null) {
    this.excludedOps=new HashSet<String>(Arrays.asList(excludeOperations));
  }
 else {
    excludedOps=Collections.emptySet();
  }
  profile=new ArgumentWithValue(this,new DefaultCompleter(new CandidatesProvider(){
    @Override public List<String> getAllCandidates(    CommandContext ctx){
      return Util.getNodeNames(ctx.getModelControllerClient(),null,Util.PROFILE);
    }
  }
),"String_Node_Str"){
    @Override public boolean canAppearNext(    CommandContext ctx) throws CommandFormatException {
      if (!isDependsOnProfile()) {
        return false;
      }
      if (!ctx.isDomainMode()) {
        return false;
      }
      return super.canAppearNext(ctx);
    }
  }
;
  operation=new ArgumentWithValue(this,new DefaultCompleter(new CandidatesProvider(){
    @Override public Collection<String> getAllCandidates(    CommandContext ctx){
      DefaultOperationRequestAddress address=new DefaultOperationRequestAddress();
      if (isDependsOnProfile() && ctx.isDomainMode()) {
        final String profileName=profile.getValue(ctx.getParsedCommandLine());
        if (profileName == null) {
          return Collections.emptyList();
        }
        address.toNode(Util.PROFILE,profileName);
      }
      for (      OperationRequestAddress.Node node : getRequiredAddress()) {
        address.toNode(node.getType(),node.getName());
      }
      address.toNode(getRequiredType(),"String_Node_Str");
      Collection<String> ops=Util.getOperationNames(ctx,address);
      ops.removeAll(excludedOps);
      if (customHandlers != null) {
        if (ops.isEmpty()) {
          ops=customHandlers.keySet();
        }
 else {
          ops=new HashSet<String>(ops);
          for (          Map.Entry<String,OperationCommandWithDescription> entry : customHandlers.entrySet()) {
            if (entry.getValue().isAvailable(ctx)) {
              ops.add(entry.getKey());
            }
 else {
              ops.remove(entry.getKey());
            }
          }
        }
      }
      return ops;
    }
  }
),0,"String_Node_Str"){
    @Override public boolean canAppearNext(    CommandContext ctx) throws CommandFormatException {
      if (isDependsOnProfile() && ctx.isDomainMode() && !profile.isValueComplete(ctx.getParsedCommandLine())) {
        return false;
      }
      return super.canAppearNext(ctx);
    }
  }
;
  operation.addCantAppearAfter(helpArg);
  name=new ArgumentWithValue(this,new DefaultCompleter(new DefaultCompleter.CandidatesProvider(){
    @Override public List<String> getAllCandidates(    CommandContext ctx){
      ModelControllerClient client=ctx.getModelControllerClient();
      if (client == null) {
        return Collections.emptyList();
      }
      DefaultOperationRequestAddress address=new DefaultOperationRequestAddress();
      if (isDependsOnProfile() && ctx.isDomainMode()) {
        final String profileName=profile.getValue(ctx.getParsedCommandLine());
        if (profile == null) {
          return Collections.emptyList();
        }
        address.toNode(Util.PROFILE,profileName);
      }
      for (      OperationRequestAddress.Node node : getRequiredAddress()) {
        address.toNode(node.getType(),node.getName());
      }
      return Util.getNodeNames(ctx.getModelControllerClient(),address,getRequiredType());
    }
  }
),(idProperty == null ? "String_Node_Str" : "String_Node_Str" + idProperty)){
    @Override public boolean canAppearNext(    CommandContext ctx) throws CommandFormatException {
      if (isDependsOnProfile() && ctx.isDomainMode() && !profile.isValueComplete(ctx.getParsedCommandLine())) {
        return false;
      }
      return super.canAppearNext(ctx);
    }
  }
;
  name.addCantAppearAfter(helpArg);
  helpArg.addCantAppearAfter(name);
  helpProperties=new ArgumentWithoutValue(this,"String_Node_Str");
  helpProperties.addRequiredPreceding(helpArg);
  helpProperties.addCantAppearAfter(operation);
  helpCommands=new ArgumentWithoutValue(this,"String_Node_Str");
  helpCommands.addRequiredPreceding(helpArg);
  helpCommands.addCantAppearAfter(operation);
  helpCommands.addCantAppearAfter(helpProperties);
  helpProperties.addCantAppearAfter(helpCommands);
  staticArgs.put(helpArg.getFullName(),helpArg);
  staticArgs.put(helpCommands.getFullName(),helpCommands);
  staticArgs.put(helpProperties.getFullName(),helpProperties);
  staticArgs.put(profile.getFullName(),profile);
  staticArgs.put(name.getFullName(),name);
  staticArgs.put(operation.getFullName(),operation);
}

Fixed version (ground truth):
/** 
 * Generic command constructor.
 * @param commandName The name of the command. If null, nodeType is used.
 * @param ctx The CommandContext.
 * @param nodeType The resource type.
 * @param idProperty The property name that identify the resource.
 * @param excludeOperations The list of operations to exclude.
 */
public GenericTypeOperationHandler(String commandName,CommandContext ctx,String nodeType,String idProperty,String... excludeOperations){
  super(ctx,"String_Node_Str",true);
  if (nodeType == null || nodeType.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str" + (nodeType == null ? "String_Node_Str" : "String_Node_Str"));
  }
  if (nodeType.startsWith("String_Node_Str") || nodeType.startsWith("String_Node_Str")) {
    int nextSep=nodeType.indexOf('/',7);
    if (nextSep < 0) {
      throw new IllegalArgumentException("String_Node_Str" + nodeType + "String_Node_Str");
    }
    nodeType=nodeType.substring(nextSep);
    this.nodeType=nodeType;
  }
 else {
    this.nodeType=nodeType;
  }
  helpArg=new ArgumentWithoutValue(this,"String_Node_Str","String_Node_Str");
  addRequiredPath(nodeType);
  this.commandName=commandName == null ? getRequiredType() : commandName;
  if (this.commandName == null) {
    throw new IllegalArgumentException("String_Node_Str" + nodeType + "String_Node_Str");
  }
  this.idProperty=idProperty;
  if (excludeOperations != null) {
    this.excludedOps=new HashSet<String>(Arrays.asList(excludeOperations));
  }
 else {
    excludedOps=Collections.emptySet();
  }
  profile=new ArgumentWithValue(this,new DefaultCompleter(new CandidatesProvider(){
    @Override public List<String> getAllCandidates(    CommandContext ctx){
      return Util.getNodeNames(ctx.getModelControllerClient(),null,Util.PROFILE);
    }
  }
),"String_Node_Str"){
    @Override public boolean canAppearNext(    CommandContext ctx) throws CommandFormatException {
      if (!isDependsOnProfile()) {
        return false;
      }
      if (!ctx.isDomainMode()) {
        return false;
      }
      return super.canAppearNext(ctx);
    }
  }
;
  operation=new ArgumentWithValue(this,new DefaultCompleter(new CandidatesProvider(){
    @Override public Collection<String> getAllCandidates(    CommandContext ctx){
      DefaultOperationRequestAddress address=new DefaultOperationRequestAddress();
      if (isDependsOnProfile() && ctx.isDomainMode()) {
        final String profileName=profile.getValue(ctx.getParsedCommandLine());
        if (profileName == null) {
          return Collections.emptyList();
        }
        address.toNode(Util.PROFILE,profileName);
      }
      for (      OperationRequestAddress.Node node : getRequiredAddress()) {
        address.toNode(node.getType(),node.getName());
      }
      address.toNode(getRequiredType(),"String_Node_Str");
      Collection<String> ops=Util.getOperationNames(ctx,address);
      ops.removeAll(excludedOps);
      if (customHandlers != null) {
        if (ops.isEmpty()) {
          ops=customHandlers.keySet();
        }
 else {
          ops=new HashSet<String>(ops);
          for (          Map.Entry<String,OperationCommandWithDescription> entry : customHandlers.entrySet()) {
            if (entry.getValue().isAvailable(ctx)) {
              ops.add(entry.getKey());
            }
 else {
              ops.remove(entry.getKey());
            }
          }
        }
      }
      return ops;
    }
  }
),0,"String_Node_Str"){
    @Override public boolean canAppearNext(    CommandContext ctx) throws CommandFormatException {
      if (isDependsOnProfile() && ctx.isDomainMode() && !profile.isValueComplete(ctx.getParsedCommandLine())) {
        return false;
      }
      return super.canAppearNext(ctx);
    }
  }
;
  operation.addCantAppearAfter(helpArg);
  name=new ArgumentWithValue(this,new DefaultCompleter(new DefaultCompleter.CandidatesProvider(){
    @Override public List<String> getAllCandidates(    CommandContext ctx){
      ModelControllerClient client=ctx.getModelControllerClient();
      if (client == null) {
        return Collections.emptyList();
      }
      DefaultOperationRequestAddress address=new DefaultOperationRequestAddress();
      if (isDependsOnProfile() && ctx.isDomainMode()) {
        final String profileName=profile.getValue(ctx.getParsedCommandLine());
        if (profile == null) {
          return Collections.emptyList();
        }
        address.toNode(Util.PROFILE,profileName);
      }
      for (      OperationRequestAddress.Node node : getRequiredAddress()) {
        address.toNode(node.getType(),node.getName());
      }
      return Util.getNodeNames(ctx.getModelControllerClient(),address,getRequiredType());
    }
  }
),(idProperty == null ? "String_Node_Str" : "String_Node_Str" + idProperty)){
    @Override public boolean canAppearNext(    CommandContext ctx) throws CommandFormatException {
      if (isDependsOnProfile() && ctx.isDomainMode() && !profile.isValueComplete(ctx.getParsedCommandLine())) {
        return false;
      }
      return super.canAppearNext(ctx);
    }
  }
;
  name.addCantAppearAfter(helpArg);
  helpArg.addCantAppearAfter(name);
  helpProperties=new ArgumentWithoutValue(this,"String_Node_Str");
  helpProperties.addRequiredPreceding(helpArg);
  helpProperties.addCantAppearAfter(operation);
  helpCommands=new ArgumentWithoutValue(this,"String_Node_Str");
  helpCommands.addRequiredPreceding(helpArg);
  helpCommands.addCantAppearAfter(operation);
  helpCommands.addCantAppearAfter(helpProperties);
  helpProperties.addCantAppearAfter(helpCommands);
  staticArgs.put(helpArg.getFullName(),helpArg);
  staticArgs.put(helpCommands.getFullName(),helpCommands);
  staticArgs.put(helpProperties.getFullName(),helpProperties);
  staticArgs.put(profile.getFullName(),profile);
  staticArgs.put(name.getFullName(),name);
  staticArgs.put(operation.getFullName(),operation);
}