Program: 167716
Project: 167716
Buggy source:
protected ModelNode upload(CommandContext ctx,boolean stream) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  final String name=this.name.getValue(args,true);
  if (!Util.isValidPath(ctx.getModelControllerClient(),Util.DEPLOYMENT_OVERLAY,name)) {
    throw new CommandLineException("String_Node_Str" + name + "String_Node_Str");
  }
  final String contentStr=content.getValue(args,true);
  final String[] contentPairs=contentStr.split("String_Node_Str");
  if (contentPairs.length == 0) {
    throw new CommandFormatException("String_Node_Str");
  }
  final String[] contentNames=new String[contentPairs.length];
  final File[] contentPaths=new File[contentPairs.length];
  for (int i=0; i < contentPairs.length; ++i) {
    final String pair=contentPairs[i];
    final int equalsIndex=pair.indexOf('=');
    if (equalsIndex < 0) {
      throw new CommandFormatException("String_Node_Str" + pair + "String_Node_Str");
    }
    contentNames[i]=pair.substring(0,equalsIndex);
    if (contentNames[i].length() == 0) {
      throw new CommandFormatException("String_Node_Str" + pair + "String_Node_Str");
    }
    String path=pair.substring(equalsIndex + 1);
    if (path.length() == 0) {
      throw new CommandFormatException("String_Node_Str" + pair + "String_Node_Str");
    }
    path=pathCompleter.translatePath(path);
    final File f=new File(path);
    if (!f.exists()) {
      throw new CommandFormatException("String_Node_Str" + f.getAbsolutePath());
    }
    contentPaths[i]=f;
  }
  final String deploymentsStr=deployments.getValue(args);
  if (deploymentsStr != null) {
    throw new CommandFormatException(deployments.getFullName() + "String_Node_Str");
  }
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ModelNode composite=new ModelNode();
  final OperationBuilder opBuilder=stream ? new OperationBuilder(composite,true) : null;
  composite.get(Util.OPERATION).set(Util.COMPOSITE);
  composite.get(Util.ADDRESS).setEmptyList();
  final ModelNode steps=composite.get(Util.STEPS);
  for (int i=0; i < contentNames.length; ++i) {
    final ModelNode op=new ModelNode();
    ModelNode address=op.get(Util.ADDRESS);
    address.add(Util.DEPLOYMENT_OVERLAY,name);
    address.add(Util.CONTENT,contentNames[i]);
    op.get(Util.OPERATION).set(Util.ADD);
    if (opBuilder != null) {
      op.get(Util.CONTENT).get(Util.INPUT_STREAM_INDEX).set(i);
      opBuilder.addFileAsAttachment(contentPaths[i]);
    }
 else {
      op.get(Util.CONTENT).get(Util.BYTES).set(Util.readBytes(contentPaths[i]));
    }
    steps.add(op);
  }
  if (redeployAffected.isPresent(args)) {
    if (ctx.isDomainMode()) {
      for (      String sgName : Util.getServerGroups(client)) {
        addRemoveRedeployLinksSteps(ctx,client,steps,name,sgName,null,false,REDEPLOY_ALL);
      }
    }
 else {
      addRemoveRedeployLinksSteps(ctx,client,steps,name,null,null,false,REDEPLOY_ALL);
    }
  }
 else {
    printWarning(ctx,client,name,contentStr,null);
  }
  if (opBuilder == null) {
    return composite;
  }
  try {
    final ModelNode result=client.execute(opBuilder.build());
    if (!Util.isSuccess(result)) {
      throw new CommandFormatException(Util.getFailureDescription(result));
    }
  }
 catch (  IOException e) {
    throw new CommandFormatException("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
protected ModelNode upload(CommandContext ctx,boolean stream) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  final String name=getName(ctx,false);
  final String contentStr=content.getValue(args,true);
  final String[] contentPairs=contentStr.split("String_Node_Str");
  if (contentPairs.length == 0) {
    throw new CommandFormatException("String_Node_Str");
  }
  final String[] contentNames=new String[contentPairs.length];
  final File[] contentPaths=new File[contentPairs.length];
  for (int i=0; i < contentPairs.length; ++i) {
    final String pair=contentPairs[i];
    final int equalsIndex=pair.indexOf('=');
    if (equalsIndex < 0) {
      throw new CommandFormatException("String_Node_Str" + pair + "String_Node_Str");
    }
    contentNames[i]=pair.substring(0,equalsIndex);
    if (contentNames[i].length() == 0) {
      throw new CommandFormatException("String_Node_Str" + pair + "String_Node_Str");
    }
    String path=pair.substring(equalsIndex + 1);
    if (path.length() == 0) {
      throw new CommandFormatException("String_Node_Str" + pair + "String_Node_Str");
    }
    path=pathCompleter.translatePath(path);
    final File f=new File(path);
    if (!f.exists()) {
      throw new CommandFormatException("String_Node_Str" + f.getAbsolutePath());
    }
    contentPaths[i]=f;
  }
  final String deploymentsStr=deployments.getValue(args);
  if (deploymentsStr != null) {
    throw new CommandFormatException(deployments.getFullName() + "String_Node_Str");
  }
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ModelNode composite=new ModelNode();
  final OperationBuilder opBuilder=stream ? new OperationBuilder(composite,true) : null;
  composite.get(Util.OPERATION).set(Util.COMPOSITE);
  composite.get(Util.ADDRESS).setEmptyList();
  final ModelNode steps=composite.get(Util.STEPS);
  for (int i=0; i < contentNames.length; ++i) {
    final ModelNode op=new ModelNode();
    ModelNode address=op.get(Util.ADDRESS);
    address.add(Util.DEPLOYMENT_OVERLAY,name);
    address.add(Util.CONTENT,contentNames[i]);
    op.get(Util.OPERATION).set(Util.ADD);
    if (opBuilder != null) {
      op.get(Util.CONTENT).get(Util.INPUT_STREAM_INDEX).set(i);
      opBuilder.addFileAsAttachment(contentPaths[i]);
    }
 else {
      op.get(Util.CONTENT).get(Util.BYTES).set(Util.readBytes(contentPaths[i]));
    }
    steps.add(op);
  }
  if (redeployAffected.isPresent(args)) {
    if (ctx.isDomainMode()) {
      for (      String sgName : Util.getServerGroups(client)) {
        addRemoveRedeployLinksSteps(ctx,client,steps,name,sgName,null,false,REDEPLOY_ALL);
      }
    }
 else {
      addRemoveRedeployLinksSteps(ctx,client,steps,name,null,null,false,REDEPLOY_ALL);
    }
  }
 else {
    printWarning(ctx,client,name,contentStr,null);
  }
  if (opBuilder == null) {
    return composite;
  }
  try {
    final ModelNode result=client.execute(opBuilder.build());
    if (!Util.isSuccess(result)) {
      throw new CommandFormatException(Util.getFailureDescription(result));
    }
  }
 catch (  IOException e) {
    throw new CommandFormatException("String_Node_Str",e);
  }
  return null;
}