Program: 38183
Project: 38183
Buggy source:
/** 
 * Adds all the files in the specified folder to the database's File table. They will all be treated as profile files.
 * @param String expId - The ID name of the experiment
 * @param String folderPath - The path to the folder containing the profile files. (This should be exactly the same path as returned by the processRawToProfile(expId) method)
 * @param String inputFileName - The name of the input file or null if no input file was generated
 * @param String metaData - A String specifying the parameters used for processing the raw file.
 * @param String genomeReleaseVersion - The genome release version used in processing. OBS! this is a reference to a genome release stored in the database/on the server and must therefore be valid.
 * @param String uploader - The user that commissioned the processing
 * @param boolean isPrivate - True if the files are to be private to theuploader, otherwise false.
 * @throws SQLException - If the request uses invalid arguments or the database could not be reached. Possible reasons: invalid genomeRelease.
 * @throws IOException
 */
public void addGeneratedProfiles(String expId,String folderPath,String inputFileName,String metaData,String grVersion,String uploader,boolean isPrivate) throws SQLException, IOException {
  Experiment e=expMethods.getExperiment(expId);
  File profileFolder=new File(folderPath);
  if (!profileFolder.exists()) {
    throw new IOException("String_Node_Str");
  }
  for (  File f : profileFolder.listFiles()) {
    if (!f.getName().equals(inputFileName)) {
      FileTuple ft=fileMethods.addNewFile(e.getID(),FileTuple.PROFILE,f.getName(),inputFileName,metaData,"String_Node_Str",uploader,isPrivate,grVersion);
      fileMethods.fileReadyForDownload(ft.id);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds all the files in the specified folder to the database's File table. They will all be treated as profile files.
 * @param String expId - The ID name of the experiment
 * @param String folderPath - The path to the folder containing the profile files. (This should be exactly the same path as returned by the processRawToProfile(expId) method)
 * @param String inputFileName - The name of the input file or null if no input file was generated
 * @param String metaData - A String specifying the parameters used for processing the raw file.
 * @param String genomeReleaseVersion - The genome release version used in processing. OBS! this is a reference to a genome release stored in the database/on the server and must therefore be valid.
 * @param String uploader - The user that commissioned the processing
 * @param boolean isPrivate - True if the files are to be private to theuploader, otherwise false.
 * @throws SQLException - If the request uses invalid arguments or the database could not be reached. Possible reasons: invalid genomeRelease.
 * @throws IOException
 */
public void addGeneratedProfiles(String expId,String folderPath,String inputFileName,String metaData,String grVersion,String uploader,boolean isPrivate) throws SQLException, IOException {
  Experiment e=expMethods.getExperiment(expId);
  File profileFolder=new File(folderPath);
  if (!profileFolder.exists()) {
    throw new IOException("String_Node_Str");
  }
  for (  File f : profileFolder.listFiles()) {
    if (!f.getName().equals(inputFileName)) {
      FileTuple ft=fileMethods.addGeneratedFile(e.getID(),FileTuple.PROFILE,f.getPath(),inputFileName,metaData,uploader,isPrivate,grVersion);
      fileMethods.fileReadyForDownload(ft.id);
    }
  }
}