Program: 125318
Project: 125318
Buggy source:
/** 
 * ftang Comment method "collectionGeneratedDocumentation".
 * @param exportFileResource
 * @param jobVersion
 * @param targetPath
 * @throws MalformedURLException
 */
private void collectGeneratedDocumentation(ExportFileResource exportFileResource,String targetPath,String[] jobVersion) throws MalformedURLException {
  Item item=exportFileResource.getItem();
  String jobName=item.getProperty().getLabel();
  String jobPath=item.getProperty().getItem().getState().getPath();
  String subFolder=null;
  if (ERepositoryObjectType.GENERATED != null && targetPath.endsWith(new Path(ERepositoryObjectType.GENERATED.getFolder()).lastSegment().toLowerCase())) {
    ERepositoryObjectType itemType=ERepositoryObjectType.getItemType(item);
    if (itemType != null) {
      subFolder=new Path(itemType.getFolder()).lastSegment().toLowerCase();
    }
 else {
      if (item instanceof JobDocumentationItem && ERepositoryObjectType.JOB_DOC != null) {
        subFolder=new Path(ERepositoryObjectType.JOB_DOC.getFolder()).lastSegment().toLowerCase();
      }
 else       if (item instanceof JobletDocumentationItem && ERepositoryObjectType.JOBLET_DOC != null) {
        subFolder=new Path(ERepositoryObjectType.JOBLET_DOC.getFolder()).lastSegment().toLowerCase();
      }
 else {
        subFolder="String_Node_Str";
      }
    }
    targetPath=targetPath + IPath.SEPARATOR + subFolder;
  }
  targetPath=targetPath + IPath.SEPARATOR + jobPath+ IPath.SEPARATOR+ jobName;
  String version="String_Node_Str";
  if (jobVersion != null && jobVersion.length == 1) {
    version=jobVersion[0];
  }
 else {
    version=item.getProperty().getVersion();
  }
  targetPath=targetPath + "String_Node_Str" + version;
  List<URL> resultFiles=new ArrayList<URL>(5);
  List<URL> picList=new ArrayList<URL>(5);
  File file=new File(targetPath);
  if (file.exists()) {
    File[] listFiles=file.listFiles();
    for (    File file2 : listFiles) {
      if (!(file2.exists())) {
        continue;
      }
      if (file2.isFile()) {
        resultFiles.add(file2.toURL());
      }
 else       if (file2.isDirectory() && file2.getName().equals(IHTMLDocConstants.PIC_FOLDER_NAME)) {
        for (        File tempFile : file2.listFiles()) {
          if (tempFile.exists() && tempFile.isFile()) {
            picList.add(tempFile.toURL());
          }
        }
      }
    }
    exportFileResource.addResources(resultFiles);
    exportFileResource.addResources(IHTMLDocConstants.PIC_FOLDER_NAME,picList);
  }
}

Fixed version (ground truth):
/** 
 * ftang Comment method "collectionGeneratedDocumentation".
 * @param exportFileResource
 * @param jobVersion
 * @param targetPath
 * @throws MalformedURLException
 */
private void collectGeneratedDocumentation(ExportFileResource exportFileResource,String targetPath,String[] jobVersion) throws MalformedURLException {
  Item item=exportFileResource.getItem();
  String jobName=item.getProperty().getLabel();
  String jobPath=item.getProperty().getItem().getState().getPath();
  String subFolder=null;
  if (ERepositoryObjectType.GENERATED != null && targetPath.endsWith(new Path(ERepositoryObjectType.GENERATED.getFolder()).lastSegment().toLowerCase())) {
    ERepositoryObjectType itemType=ERepositoryObjectType.getItemType(item);
    if (itemType != null) {
      subFolder=new Path(itemType.getFolder()).lastSegment().toLowerCase();
    }
    targetPath=targetPath + IPath.SEPARATOR + subFolder;
  }
  targetPath=targetPath + IPath.SEPARATOR + jobPath+ IPath.SEPARATOR+ jobName;
  String version="String_Node_Str";
  if (jobVersion != null && jobVersion.length == 1) {
    version=jobVersion[0];
  }
 else {
    version=item.getProperty().getVersion();
  }
  targetPath=targetPath + "String_Node_Str" + version;
  List<URL> resultFiles=new ArrayList<URL>(5);
  List<URL> picList=new ArrayList<URL>(5);
  File file=new File(targetPath);
  if (file.exists()) {
    File[] listFiles=file.listFiles();
    for (    File file2 : listFiles) {
      if (!(file2.exists())) {
        continue;
      }
      if (file2.isFile()) {
        resultFiles.add(file2.toURL());
      }
 else       if (file2.isDirectory() && file2.getName().equals(IHTMLDocConstants.PIC_FOLDER_NAME)) {
        for (        File tempFile : file2.listFiles()) {
          if (tempFile.exists() && tempFile.isFile()) {
            picList.add(tempFile.toURL());
          }
        }
      }
    }
    exportFileResource.addResources(resultFiles);
    exportFileResource.addResources(IHTMLDocConstants.PIC_FOLDER_NAME,picList);
  }
}