Program: 96795
Project: 96795
Buggy source:
@Override public void runOperation(VariableMap variableMap,IProgressMonitor monitor) throws Exception {
  IOseeBranch branch=variableMap.getBranch("String_Node_Str");
  if (branch == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  List<TraceTypeEnum> traceTypes=getCheckedTraceItems(variableMap);
  if (traceTypes.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  boolean isExcelOutput=variableMap.getBoolean("String_Node_Str");
  boolean isResultEditorOutput=variableMap.getBoolean("String_Node_Str");
  OutputType output=OutputType.asType(isExcelOutput,isResultEditorOutput);
  if (output == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  ISheetWriter writer=null;
  CharBackedInputStream excelInputStream=null;
  Map<String,AbstractArtifactRelationReport> reports=new LinkedHashMap<>();
  List<BaseTraceDataCache> traceCache=new ArrayList<>();
  RequirementData reqData=new RequirementData(branch);
  CodeUnitData codeUnit=null;
  TestUnitData testUnit=null;
  try {
    int TOTAL_WORK=Integer.MAX_VALUE;
    int TASK_WORK=TOTAL_WORK / 5;
    monitor.beginTask("String_Node_Str",TOTAL_WORK);
    SubProgressMonitor subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    reqData.initialize(subMonitor);
    traceCache.add(reqData);
    subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    if (TraceTypeEnum.Code_Unit_Trace.isIn(traceTypes)) {
      codeUnit=new CodeUnitData(branch);
      codeUnit.initialize(subMonitor);
      traceCache.add(codeUnit);
    }
 else {
      subMonitor.done();
    }
    subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    if (TraceTypeEnum.containsTestEnum(traceTypes)) {
      testUnit=new TestUnitData(branch);
      testUnit.initialize(subMonitor);
      traceCache.add(testUnit);
    }
 else {
      subMonitor.done();
    }
    if (!monitor.isCanceled()) {
      if (isExcelOutput(output)) {
        excelInputStream=new CharBackedInputStream();
        writer=new ExcelXmlWriter(excelInputStream.getWriter());
      }
      buildReport(reports,"String_Node_Str",output,writer,getTraceUnitToReqReport(codeUnit,testUnit,traceTypes));
      buildReport(reports,"String_Node_Str",output,writer,getDisconnectedTraceUnitReport(codeUnit,testUnit,traceTypes));
      buildReport(reports,"String_Node_Str",output,writer,getTraceCountReport(reqData,traceTypes));
      subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
      executeReports(subMonitor,reports);
    }
    subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    displayReports(subMonitor,writer,excelInputStream,output);
  }
  finally {
    try {
      for (      AbstractArtifactRelationReport report : reports.values()) {
        report.clear();
      }
      for (      BaseTraceDataCache cache : traceCache) {
        cache.reset();
      }
      reports.clear();
      traceCache.clear();
      resultsTabs.clear();
    }
  finally {
      monitor.done();
    }
  }
}

Fixed version (ground truth):
@Override public void runOperation(VariableMap variableMap,IProgressMonitor monitor) throws Exception {
  BranchId branch=variableMap.getBranch("String_Node_Str");
  if (branch == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  List<TraceTypeEnum> traceTypes=getCheckedTraceItems(variableMap);
  if (traceTypes.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  boolean isExcelOutput=variableMap.getBoolean("String_Node_Str");
  boolean isResultEditorOutput=variableMap.getBoolean("String_Node_Str");
  OutputType output=OutputType.asType(isExcelOutput,isResultEditorOutput);
  if (output == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  ISheetWriter writer=null;
  CharBackedInputStream excelInputStream=null;
  Map<String,AbstractArtifactRelationReport> reports=new LinkedHashMap<>();
  List<BaseTraceDataCache> traceCache=new ArrayList<>();
  RequirementData reqData=new RequirementData(branch);
  CodeUnitData codeUnit=null;
  TestUnitData testUnit=null;
  try {
    int TOTAL_WORK=Integer.MAX_VALUE;
    int TASK_WORK=TOTAL_WORK / 5;
    monitor.beginTask("String_Node_Str",TOTAL_WORK);
    SubProgressMonitor subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    reqData.initialize(subMonitor);
    traceCache.add(reqData);
    subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    if (TraceTypeEnum.Code_Unit_Trace.isIn(traceTypes)) {
      codeUnit=new CodeUnitData(branch);
      codeUnit.initialize(subMonitor);
      traceCache.add(codeUnit);
    }
 else {
      subMonitor.done();
    }
    subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    if (TraceTypeEnum.containsTestEnum(traceTypes)) {
      testUnit=new TestUnitData(branch);
      testUnit.initialize(subMonitor);
      traceCache.add(testUnit);
    }
 else {
      subMonitor.done();
    }
    if (!monitor.isCanceled()) {
      if (isExcelOutput(output)) {
        excelInputStream=new CharBackedInputStream();
        writer=new ExcelXmlWriter(excelInputStream.getWriter());
      }
      buildReport(reports,"String_Node_Str",output,writer,getTraceUnitToReqReport(codeUnit,testUnit,traceTypes));
      buildReport(reports,"String_Node_Str",output,writer,getDisconnectedTraceUnitReport(codeUnit,testUnit,traceTypes));
      buildReport(reports,"String_Node_Str",output,writer,getTraceCountReport(reqData,traceTypes));
      subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
      executeReports(subMonitor,reports);
    }
    subMonitor=new SubProgressMonitor(monitor,TASK_WORK);
    displayReports(subMonitor,writer,excelInputStream,output);
  }
  finally {
    try {
      for (      AbstractArtifactRelationReport report : reports.values()) {
        report.clear();
      }
      for (      BaseTraceDataCache cache : traceCache) {
        cache.reset();
      }
      reports.clear();
      traceCache.clear();
      resultsTabs.clear();
    }
  finally {
      monitor.done();
    }
  }
}