Program: 136069
Project: 136069
Buggy source:
/** 
 * Reads the model parameters and constructs the corresponding command line arguments
 * @return string array with arguments
 * @throws CoreException
 */
public String[] constructProgramArguments() throws CoreException {
  Vector arguments=new Vector();
  ILaunchConfiguration config=launch.getLaunchConfiguration();
  boolean checkDeadlock=config.getAttribute(IModelConfigurationConstants.MODEL_CORRECTNESS_CHECK_DEADLOCK,IModelConfigurationDefaults.MODEL_CORRECTNESS_CHECK_DEADLOCK_DEFAULT);
  if (!checkDeadlock) {
    arguments.add("String_Node_Str");
  }
  arguments.add("String_Node_Str");
  arguments.add(String.valueOf(CHECKPOINT_INTERVAL));
  boolean runAsModelCheck=config.getAttribute(IModelConfigurationConstants.LAUNCH_MC_MODE,IModelConfigurationDefaults.LAUNCH_MC_MODE_DEFAULT);
  if (runAsModelCheck) {
    boolean isDepthFirst=config.getAttribute(IModelConfigurationConstants.LAUNCH_DFID_MODE,IModelConfigurationDefaults.LAUNCH_DFID_MODE_DEFAULT);
    if (isDepthFirst) {
      int dfidDepth=config.getAttribute(IModelConfigurationConstants.LAUNCH_DFID_DEPTH,IModelConfigurationDefaults.LAUNCH_DFID_DEPTH_DEFAULT);
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(dfidDepth));
    }
  }
 else {
    arguments.add("String_Node_Str");
    int traceDepth=config.getAttribute(IModelConfigurationConstants.LAUNCH_SIMU_DEPTH,IModelConfigurationDefaults.LAUNCH_SIMU_DEPTH_DEFAULT);
    if (traceDepth != IModelConfigurationDefaults.LAUNCH_SIMU_DEPTH_DEFAULT) {
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(traceDepth));
    }
    int aril=config.getAttribute(IModelConfigurationConstants.LAUNCH_SIMU_ARIL,IModelConfigurationDefaults.LAUNCH_SIMU_ARIL_DEFAULT);
    int seed=config.getAttribute(IModelConfigurationConstants.LAUNCH_SIMU_SEED,IModelConfigurationDefaults.LAUNCH_SIMU_SEED_DEFAULT);
    if (aril != IModelConfigurationDefaults.LAUNCH_SIMU_ARIL_DEFAULT) {
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(aril));
    }
    if (seed != IModelConfigurationDefaults.LAUNCH_SIMU_SEED_DEFAULT) {
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(seed));
    }
  }
  boolean recover=config.getAttribute(IModelConfigurationConstants.LAUNCH_RECOVER,IModelConfigurationDefaults.LAUNCH_RECOVER_DEFAULT);
  if (recover) {
    IResource[] checkpoints=ModelHelper.getCheckpoints(config);
    if (checkpoints.length > 0) {
      arguments.add("String_Node_Str");
      arguments.add(checkpoints[0].getName());
    }
  }
  arguments.add("String_Node_Str");
  arguments.add(cfgFile.getName());
  if (config.getAttribute(MODEL_BEHAVIOR_SPEC_TYPE,MODEL_BEHAVIOR_TYPE_DEFAULT) != MODEL_BEHAVIOR_TYPE_NO_SPEC) {
    arguments.add("String_Node_Str");
    arguments.add(String.valueOf(COVERAGE_INTERVAL));
  }
  arguments.add("String_Node_Str");
  arguments.add(String.valueOf(workers));
  arguments.add("String_Node_Str");
  arguments.add("String_Node_Str");
  arguments.add(launchDir.getLocation().toOSString());
  arguments.add(ResourceHelper.getModuleName(rootModule));
  return (String[])arguments.toArray(new String[arguments.size()]);
}

Fixed version (ground truth):
/** 
 * Reads the model parameters and constructs the corresponding command line arguments
 * @return string array with arguments
 * @throws CoreException
 */
public String[] constructProgramArguments() throws CoreException {
  Vector arguments=new Vector();
  ILaunchConfiguration config=launch.getLaunchConfiguration();
  boolean checkDeadlock=config.getAttribute(IModelConfigurationConstants.MODEL_CORRECTNESS_CHECK_DEADLOCK,IModelConfigurationDefaults.MODEL_CORRECTNESS_CHECK_DEADLOCK_DEFAULT);
  if (!checkDeadlock) {
    arguments.add("String_Node_Str");
  }
  arguments.add("String_Node_Str");
  arguments.add(String.valueOf(CHECKPOINT_INTERVAL));
  boolean runAsModelCheck=config.getAttribute(IModelConfigurationConstants.LAUNCH_MC_MODE,IModelConfigurationDefaults.LAUNCH_MC_MODE_DEFAULT);
  if (runAsModelCheck) {
    boolean isDepthFirst=config.getAttribute(IModelConfigurationConstants.LAUNCH_DFID_MODE,IModelConfigurationDefaults.LAUNCH_DFID_MODE_DEFAULT);
    if (isDepthFirst) {
      int dfidDepth=config.getAttribute(IModelConfigurationConstants.LAUNCH_DFID_DEPTH,IModelConfigurationDefaults.LAUNCH_DFID_DEPTH_DEFAULT);
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(dfidDepth));
    }
  }
 else {
    arguments.add("String_Node_Str");
    int traceDepth=config.getAttribute(IModelConfigurationConstants.LAUNCH_SIMU_DEPTH,IModelConfigurationDefaults.LAUNCH_SIMU_DEPTH_DEFAULT);
    if (traceDepth != IModelConfigurationDefaults.LAUNCH_SIMU_DEPTH_DEFAULT) {
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(traceDepth));
    }
    int aril=config.getAttribute(IModelConfigurationConstants.LAUNCH_SIMU_ARIL,IModelConfigurationDefaults.LAUNCH_SIMU_ARIL_DEFAULT);
    int seed=config.getAttribute(IModelConfigurationConstants.LAUNCH_SIMU_SEED,IModelConfigurationDefaults.LAUNCH_SIMU_SEED_DEFAULT);
    if (aril != IModelConfigurationDefaults.LAUNCH_SIMU_ARIL_DEFAULT) {
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(aril));
    }
    if (seed != IModelConfigurationDefaults.LAUNCH_SIMU_SEED_DEFAULT) {
      arguments.add("String_Node_Str");
      arguments.add(String.valueOf(seed));
    }
  }
  boolean recover=config.getAttribute(IModelConfigurationConstants.LAUNCH_RECOVER,IModelConfigurationDefaults.LAUNCH_RECOVER_DEFAULT);
  if (recover) {
    IResource[] checkpoints=ModelHelper.getCheckpoints(config,false);
    if (checkpoints.length > 0) {
      arguments.add("String_Node_Str");
      arguments.add(checkpoints[0].getName());
    }
  }
  arguments.add("String_Node_Str");
  arguments.add(cfgFile.getName());
  if (config.getAttribute(MODEL_BEHAVIOR_SPEC_TYPE,MODEL_BEHAVIOR_TYPE_DEFAULT) != MODEL_BEHAVIOR_TYPE_NO_SPEC) {
    arguments.add("String_Node_Str");
    arguments.add(String.valueOf(COVERAGE_INTERVAL));
  }
  arguments.add("String_Node_Str");
  arguments.add(String.valueOf(workers));
  arguments.add("String_Node_Str");
  arguments.add("String_Node_Str");
  arguments.add(launchDir.getLocation().toOSString());
  arguments.add(ResourceHelper.getModuleName(rootModule));
  return (String[])arguments.toArray(new String[arguments.size()]);
}