nus-yam/ex-repair huggingface dataset:
Program: 47514
Project: 47514
Buggy source:
public Map<String,InputStream> getModrianSchemaFiles(String catalogName){
  Map<String,InputStream> values=new HashMap<String,InputStream>();
  RepositoryFile catalogFolder=repository.getFile(ETC_MONDRIAN_JCR_FOLDER + RepositoryFile.SEPARATOR + catalogName);
  for (  RepositoryFile repoFile : repository.getChildren(catalogFolder.getId())) {
    RepositoryFileInputStream is;
    try {
      is=new RepositoryFileInputStream(repoFile);
    }
 catch (    Exception e) {
      return null;
    }
    values.put(repoFile.getName(),is);
  }
  return values;
}

Fixed version (ground truth):
public Map<String,InputStream> getModrianSchemaFiles(String catalogName){
  Map<String,InputStream> values=new HashMap<String,InputStream>();
  RepositoryFile catalogFolder=repository.getFile(ETC_MONDRIAN_JCR_FOLDER + RepositoryFile.SEPARATOR + catalogName);
  for (  RepositoryFile repoFile : repository.getChildren(catalogFolder.getId())) {
    RepositoryFileInputStream is;
    try {
      if (repoFile.getName().equals("String_Node_Str")) {
        continue;
      }
      is=new RepositoryFileInputStream(repoFile);
    }
 catch (    Exception e) {
      return null;
    }
    values.put(repoFile.getName(),is);
  }
  return values;
}
Program: 47515
Project: 47515
Buggy source:
public FileSolutionRepositoryImportSource(final File sourceFile,final String filename,final String charSet){
  Assert.notNull(sourceFile);
  Assert.hasText(filename);
  Assert.hasText(charSet);
  this.sourceFile=sourceFile;
  this.filename=filename;
  this.charSet=charSet;
  this.recursive=sourceFile.isDirectory();
  addFileToList(sourceFile,false);
  log.debug("String_Node_Str" + files.size());
}

Fixed version (ground truth):
public FileSolutionRepositoryImportSource(final File sourceFile,final String filename,final String charSet){
  Assert.notNull(sourceFile);
  Assert.hasText(filename);
  Assert.hasText(charSet);
  this.filename=filename;
  this.charSet=charSet;
  this.recursive=sourceFile.isDirectory();
  this.sourceParentFilePath=sourceFile.getAbsoluteFile().getPath();
  addFileToList(sourceFile,false);
  log.debug("String_Node_Str" + files.size());
}
Program: 47516
Project: 47516
Buggy source:
protected IRepositoryFileBundle getFile(final File currentFile,final String filename){
  if (WAQRFilesMigrationHelper.isOldXWAQRFile(filename)) {
    WAQRFilesMigrationHelper.convertToNewXWAQR(currentFile);
  }
 else   if (WAQRFilesMigrationHelper.isOldXreportSpecFile(filename)) {
    WAQRFilesMigrationHelper.convertToNewXreportSpec(currentFile);
  }
  final RepositoryFile repoFile=new RepositoryFile.Builder(WAQRFilesMigrationHelper.convertToNewExtension(filename)).folder(currentFile.isDirectory()).hidden(WAQRFilesMigrationHelper.hideFileCheck(filename)).lastModificationDate(new Date(currentFile.lastModified())).build();
  final String extension=RepositoryFilenameUtils.getExtension(filename);
  String repoPath="String_Node_Str";
  if (recursive) {
    final String parentFilePath=currentFile.getParentFile().getAbsolutePath();
    final String sourceParentFilePath=sourceFile.getParentFile().getAbsolutePath();
    repoPath=parentFilePath.substring(sourceParentFilePath.length());
  }
  return new RepositoryFileBundle(repoFile,null,repoPath,currentFile,charSet,getMimeType(extension.toLowerCase()));
}

Fixed version (ground truth):
protected IRepositoryFileBundle getFile(final File currentFile,final String filename){
  if (WAQRFilesMigrationHelper.isOldXWAQRFile(filename)) {
    WAQRFilesMigrationHelper.convertToNewXWAQR(currentFile);
  }
 else   if (WAQRFilesMigrationHelper.isOldXreportSpecFile(filename)) {
    WAQRFilesMigrationHelper.convertToNewXreportSpec(currentFile);
  }
  final String name=WAQRFilesMigrationHelper.convertToNewExtension(filename);
  final boolean directory=currentFile.isDirectory();
  final boolean hidden=WAQRFilesMigrationHelper.hideFileCheck(filename);
  final Date lastModifiedDate=new Date(currentFile.lastModified());
  final RepositoryFile repoFile=new RepositoryFile.Builder(name).folder(directory).hidden(hidden).lastModificationDate(lastModifiedDate).build();
  final String repoPath=getRepositoryPath(currentFile);
  final String extension=RepositoryFilenameUtils.getExtension(filename);
  return new RepositoryFileBundle(repoFile,null,repoPath,currentFile,charSet,getMimeType(extension.toLowerCase()));
}
Program: 47518
Project: 47518
Buggy source:
/** 
 * Copies file. Folders are recursive. Throws exception on collision (merging does not occur).
 * @param fileId id of file or folder to copy
 * @param destAbsPath path to destination; if only copying (without name change) then destAbsPath will be an existing folder
 * @param versionMessage optional version comment to be applied to destination parent folder
 */
void copyFile(final Serializable fileId,final String destAbsPath,final String versionMessage);

Fixed version (ground truth):
/** 
 * Copies file. Folders are recursive. Throws exception on collision (merging does not occur).
 * @param fileId         id of file or folder to copy
 * @param destAbsPath    path to destination; if only copying (without name change) then destAbsPath will be an existingfolder
 * @param versionMessage optional version comment to be applied to destination parent folder
 */
void copyFile(final Serializable fileId,final String destAbsPath,final String versionMessage);
Program: 47519
Project: 47519
Buggy source:
/** 
 * Locks a file.
 * @param fileId file id
 * @param lock message
 */
void lockFile(final Serializable fileId,final String message);

Fixed version (ground truth):
/** 
 * Locks a file.
 * @param fileId file id
 * @param lock   message
 */
void lockFile(final Serializable fileId,final String message);
Program: 47520
Project: 47520
Buggy source:
/** 
 * Returns   {@code true} if user has all permissions given. Note that {@code false} is returned when the path does not exist.
 * @param path path to file or folder
 * @param permissions permissions to check
 * @return {@code true} if user has all permissions given
 */
boolean hasAccess(final String path,final EnumSet<RepositoryFilePermission> permissions);

Fixed version (ground truth):
/** 
 * Returns   {@code true} if user has all permissions given. Note that {@code false} is returned when the path does notexist.
 * @param path        path to file or folder
 * @param permissions permissions to check
 * @return {@code true} if user has all permissions given
 */
boolean hasAccess(final String path,final EnumSet<RepositoryFilePermission> permissions);
Program: 47521
Project: 47521
Buggy source:
/** 
 * Returns a version summary for every   {@link RepositoryFile} provided.  Each {@link RepositoryFile} may or may not contain a version number.  If a version number is omitted it is assumed the latest version for the  {@link RepositoryFile} is being requested.
 * @param files Repository files to fetch version summaries for. Only {@link RepositoryFile#getId()} and {@link RepositoryFile#getVersionId()}are used to identify   {@link VersionSummary} objects to return.
 * @return version summary for every file provided
 */
List<VersionSummary> getVersionSummaryInBatch(final List<RepositoryFile> files);

Fixed version (ground truth):
/** 
 * Returns a version summary for every   {@link RepositoryFile} provided.  Each {@link RepositoryFile} may or may not contain aversion number.  If a version number is omitted it is assumed the latest version for the  {@link RepositoryFile}is being requested.
 * @param files Repository files to fetch version summaries for. Only {@link RepositoryFile#getId()} and {@link RepositoryFile#getVersionId()}are used to identify   {@link VersionSummary} objects to return.
 * @return version summary for every file provided
 */
List<VersionSummary> getVersionSummaryInBatch(final List<RepositoryFile> files);
Program: 47522
Project: 47522
Buggy source:
/** 
 * Returns the list of access control entries (ACEs) that will be used to make an access control decision. This method is equivalent to   {@code getEffectiveAces(get_parent_id(fileId))}.  Note that   {@code get_parent_id} is not a real method.
 * @param fileId file id
 * @param forceEntriesInheriting {@code true} to treat ACL as if {@code isEntriesInheriting} was true; this avoids having the caller fetch the parent of ACL belonging to file with  {@code fileId}; no change is persisted to the ACL
 * @return list of ACEs
 */
List<RepositoryFileAce> getEffectiveAces(final Serializable fileId,final boolean forceEntriesInheriting);

Fixed version (ground truth):
/** 
 * Returns the list of access control entries (ACEs) that will be used to make an access control decision. This method is equivalent to   {@code getEffectiveAces(get_parent_id(fileId))}.  Note that   {@code get_parent_id} is not a realmethod.
 * @param fileId                 file id
 * @param forceEntriesInheriting {@code true} to treat ACL as if {@code isEntriesInheriting} was true; this avoidshaving the caller fetch the parent of ACL belonging to file with  {@code fileId}; no change is persisted to the ACL
 * @return list of ACEs
 */
List<RepositoryFileAce> getEffectiveAces(final Serializable fileId,final boolean forceEntriesInheriting);
Program: 47523
Project: 47523
Buggy source:
/** 
 * Returns a version summary for the given file id and version id.
 * @param fileId file id
 * @param versionId version id (if {@code null}, returns the last version)
 * @return version summary
 */
VersionSummary getVersionSummary(Serializable fileId,Serializable versionId);

Fixed version (ground truth):
/** 
 * Returns a version summary for the given file id and version id.
 * @param fileId    file id
 * @param versionId version id (if {@code null}, returns the last version)
 * @return version summary
 */
VersionSummary getVersionSummary(Serializable fileId,Serializable versionId);
Program: 47524
Project: 47524
Buggy source:
/** 
 * Same as   {@link #getFile(String)} except that if {@code loadMaps} is {@code true}, the maps for localized strings  will be loaded as well. (Normally these are not loaded.) Use   {@code true} in editing tools that can show the mapsfor editing purposes.
 * @param path path to file
 * @param loadLocaleMaps {@code true} to load localized string maps
 * @return file or {@code null} if the file does not exist or access is denied
 */
RepositoryFile getFile(final String path,final boolean loadLocaleMaps);

Fixed version (ground truth):
/** 
 * Same as   {@link #getFile(String)} except that if {@code loadMaps} is {@code true}, the maps for localized strings will be loaded as well. (Normally these are not loaded.) Use   {@code true} in editing tools that can show the mapsfor editing purposes.
 * @param path           path to file
 * @param loadLocaleMaps {@code true} to load localized string maps
 * @return file or {@code null} if the file does not exist or access is denied
 */
RepositoryFile getFile(final String path,final boolean loadLocaleMaps);
Program: 47525
Project: 47525
Buggy source:
/** 
 * Creates a file.
 * @param parentFolderId parent folder id
 * @param file file to create
 * @param data file data
 * @param acl file acl
 * @param versionMessage optional version comment to be applied to parentFolder
 * @return file that is equal to given file except with id populated
 */
RepositoryFile createFile(final Serializable parentFolderId,final RepositoryFile file,final IRepositoryFileData data,final RepositoryFileAcl acl,final String versionMessage);

Fixed version (ground truth):
/** 
 * Creates a file.
 * @param parentFolderId parent folder id
 * @param file           file to create
 * @param data           file data
 * @param acl            file acl
 * @param versionMessage optional version comment to be applied to parentFolder
 * @return file that is equal to given file except with id populated
 */
RepositoryFile createFile(final Serializable parentFolderId,final RepositoryFile file,final IRepositoryFileData data,final RepositoryFileAcl acl,final String versionMessage);
Program: 47526
Project: 47526
Buggy source:
/** 
 * Gets a tree rooted at path.
 * @param path path to file
 * @param depth 0 fetches just file at path; positive integer n fetches node at path plus n levels of children; negative integer fetches all children
 * @param filter filter may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these; filter does not apply to root node
 * @param showHidden is a boolean which identify whether to include the hidden files/folders in the list or not
 * @return file or {@code null} if the file does not exist or access is denied
 */
RepositoryFileTree getTree(final String path,final int depth,final String filter,final boolean showHidden);

Fixed version (ground truth):
/** 
 * Gets a tree rooted at path.
 * @param path       path to file
 * @param depth      0 fetches just file at path; positive integer n fetches node at path plus n levels of children;negative integer fetches all children
 * @param filter     filter may be a full name or a partial name with one or more wildcard characters ("*"), or adisjunction (using the "|" character to represent logical OR) of these; filter does not apply to root node
 * @param showHidden is a boolean which identify whether to include the hidden files/folders in the list or not
 * @return file or {@code null} if the file does not exist or access is denied
 */
RepositoryFileTree getTree(final String path,final int depth,final String filter,final boolean showHidden);
Program: 47527
Project: 47527
Buggy source:
/** 
 * Gets data at given version for read.
 * @param fileId file id
 * @param versionId version id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataAtVersionForExecute(final Serializable fileId,final Serializable versionId,final Class<T> dataClass);

Fixed version (ground truth):
/** 
 * Gets data at given version for read.
 * @param fileId    file id
 * @param versionId version id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataAtVersionForExecute(final Serializable fileId,final Serializable versionId,final Class<T> dataClass);
Program: 47528
Project: 47528
Buggy source:
/** 
 * Sets a metadata object for the given fileid
 * @param fileId file id
 * @param metadataMap Map of properties to apply to this file.
 */
void setFileMetadata(final Serializable fileId,final Map<String,Serializable> metadataMap);

Fixed version (ground truth):
/** 
 * Sets a metadata object for the given fileid
 * @param fileId      file id
 * @param metadataMap Map of properties to apply to this file.
 */
void setFileMetadata(final Serializable fileId,final Map<String,Serializable> metadataMap);
Program: 47529
Project: 47529
Buggy source:
/** 
 * Gets the data for multiple   {@link RepositoryFile}s for read.  Each   {@link RepositoryFile} may or may not contain a version number.  If a version number is omitted it is assumed the latest data for the  {@link RepositoryFile} is being requested.
 * @param < T > Type of {@link IRepositoryFileData}
 * @param files Repository files to fetch data for. Only {@link RepositoryFile#getId()} and {@link RepositoryFile#getVersionId()}are used to identify   {@link IRepositoryFileData} objects to return.
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>java.util.List<T> getDataForReadInBatch(final List<RepositoryFile> files,final Class<T> dataClass);

Fixed version (ground truth):
/** 
 * Gets the data for multiple   {@link RepositoryFile}s for read.  Each   {@link RepositoryFile} may or may not contain aversion number.  If a version number is omitted it is assumed the latest data for the  {@link RepositoryFile}is being requested.
 * @param < T >       Type of {@link IRepositoryFileData}
 * @param files     Repository files to fetch data for. Only {@link RepositoryFile#getId()} and {@link RepositoryFile#getVersionId()}are used to identify   {@link IRepositoryFileData} objects to return.
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>java.util.List<T> getDataForReadInBatch(final List<RepositoryFile> files,final Class<T> dataClass);
Program: 47530
Project: 47530
Buggy source:
/** 
 * Creates a folder.
 * @param parentFolderId parent folder id
 * @param file file to create
 * @param acl file acl
 * @param versionMessage optional version comment to be applied to parentFolder
 * @return file that is equal to given file except with id populated
 */
RepositoryFile createFolder(final Serializable parentFolderId,final RepositoryFile file,final RepositoryFileAcl acl,final String versionMessage);

Fixed version (ground truth):
/** 
 * Creates a folder.
 * @param parentFolderId parent folder id
 * @param file           file to create
 * @param acl            file acl
 * @param versionMessage optional version comment to be applied to parentFolder
 * @return file that is equal to given file except with id populated
 */
RepositoryFile createFolder(final Serializable parentFolderId,final RepositoryFile file,final RepositoryFileAcl acl,final String versionMessage);
Program: 47531
Project: 47531
Buggy source:
/** 
 * Same as   {@link #getFile(String)} except that if {@code loadMaps} is {@code true}, the maps for localized strings  will be loaded as well. (Normally these are not loaded.) Use   {@code true} in editing tools that can show the mapsfor editing purposes.
 * @param fileId file id
 * @param loadLocaleMaps {@code true} to load localized string maps
 * @return file or {@code null} if the file does not exist or access is denied
 */
RepositoryFile getFileById(final Serializable fileId,final boolean loadLocaleMaps);

Fixed version (ground truth):
/** 
 * Same as   {@link #getFile(String)} except that if {@code loadMaps} is {@code true}, the maps for localized strings will be loaded as well. (Normally these are not loaded.) Use   {@code true} in editing tools that can show the mapsfor editing purposes.
 * @param fileId         file id
 * @param loadLocaleMaps {@code true} to load localized string maps
 * @return file or {@code null} if the file does not exist or access is denied
 */
RepositoryFile getFileById(final Serializable fileId,final boolean loadLocaleMaps);
Program: 47532
Project: 47532
Buggy source:
/** 
 * Gets data at base version for read.
 * @param fileId file id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataForRead(final Serializable fileId,final Class<T> dataClass);

Fixed version (ground truth):
/** 
 * Gets data at base version for read.
 * @param fileId    file id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataForRead(final Serializable fileId,final Class<T> dataClass);
Program: 47533
Project: 47533
Buggy source:
/** 
 * Deletes a file in a recoverable manner.
 * @param fileId file id
 * @param versionMessage optional version comment
 */
void deleteFile(final Serializable fileId,final String versionMessage);

Fixed version (ground truth):
/** 
 * Deletes a file in a recoverable manner.
 * @param fileId         file id
 * @param versionMessage optional version comment
 */
void deleteFile(final Serializable fileId,final String versionMessage);
Program: 47534
Project: 47534
Buggy source:
/** 
 * Permanently deletes a specific version of a file. The version is removed from the version history of the given file.
 * @param fileId file id
 * @param versionId version id (MUST not be null)
 */
void deleteFileAtVersion(final Serializable fileId,final Serializable versionId);

Fixed version (ground truth):
/** 
 * Permanently deletes a specific version of a file. The version is removed from the version history of the given file.
 * @param fileId    file id
 * @param versionId version id (MUST not be null)
 */
void deleteFileAtVersion(final Serializable fileId,final Serializable versionId);
Program: 47535
Project: 47535
Buggy source:
/** 
 * Gets the data for multiple   {@link RepositoryFile}s for execute.  Each   {@link RepositoryFile} may or may not contain a version number.  If a version number is omitted it is assumed the latest data for the  {@link RepositoryFile} is being requested.
 * @param < T > Type of {@link IRepositoryFileData}
 * @param files Repository files to fetch data for. Only {@link RepositoryFile#getId()} and {@link RepositoryFile#getVersionId()}are used to identify   {@link IRepositoryFileData} objects to return.
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>java.util.List<T> getDataForExecuteInBatch(final List<RepositoryFile> files,final Class<T> dataClass);

Fixed version (ground truth):
/** 
 * Gets the data for multiple   {@link RepositoryFile}s for execute.  Each   {@link RepositoryFile} may or may not contain aversion number.  If a version number is omitted it is assumed the latest data for the  {@link RepositoryFile}is being requested.
 * @param < T >       Type of {@link IRepositoryFileData}
 * @param files     Repository files to fetch data for. Only {@link RepositoryFile#getId()} and {@link RepositoryFile#getVersionId()}are used to identify   {@link IRepositoryFileData} objects to return.
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>java.util.List<T> getDataForExecuteInBatch(final List<RepositoryFile> files,final Class<T> dataClass);
Program: 47536
Project: 47536
Buggy source:
/** 
 * Makes a file, as it was at the given version, the latest version. Result should be the same as if the user had  called   {@link #updateFile(RepositoryFile,IRepositoryFileData,String)} with a file and data that matched the stateof the file and data at the given version.
 * @param fileId file id
 * @param versionId version id
 * @param versionMessage optional version comment
 */
void restoreFileAtVersion(final Serializable fileId,final Serializable versionId,final String versionMessage);

Fixed version (ground truth):
/** 
 * Makes a file, as it was at the given version, the latest version. Result should be the same as if the user had called   {@link #updateFile(RepositoryFile,IRepositoryFileData,String)} with a file and data that matched the stateof the file and data at the given version.
 * @param fileId         file id
 * @param versionId      version id
 * @param versionMessage optional version comment
 */
void restoreFileAtVersion(final Serializable fileId,final Serializable versionId,final String versionMessage);
Program: 47537
Project: 47537
Buggy source:
/** 
 * Moves and/or renames file. Folders are recursive. Throws exception on collision (merging does not occur).
 * @param fileId id of file or folder to move and/or rename
 * @param destAbsPath path to destination; if only moving then destAbsPath will be an existing folder
 * @param versionMessage optional version comment to be applied to source and destination parent folders
 */
void moveFile(final Serializable fileId,final String destAbsPath,final String versionMessage);

Fixed version (ground truth):
/** 
 * Moves and/or renames file. Folders are recursive. Throws exception on collision (merging does not occur).
 * @param fileId         id of file or folder to move and/or rename
 * @param destAbsPath    path to destination; if only moving then destAbsPath will be an existing folder
 * @param versionMessage optional version comment to be applied to source and destination parent folders
 */
void moveFile(final Serializable fileId,final String destAbsPath,final String versionMessage);
Program: 47538
Project: 47538
Buggy source:
/** 
 * Gets file as it was at the given version.
 * @param fileId file id
 * @param versionId version id
 * @return file at version
 */
RepositoryFile getFileAtVersion(final Serializable fileId,final Serializable versionId);

Fixed version (ground truth):
/** 
 * Gets file as it was at the given version.
 * @param fileId    file id
 * @param versionId version id
 * @return file at version
 */
RepositoryFile getFileAtVersion(final Serializable fileId,final Serializable versionId);
Program: 47539
Project: 47539
Buggy source:
/** 
 * Get a list of   {@link RepositoryFile}s that reference the RepositoryFile identified by fileId. 
 * @param fileId file id
 * @return list of repository files that reference the fileId repository file 
 */
List<RepositoryFile> getReferrers(final Serializable fileId);

Fixed version (ground truth):
/** 
 * Get a list of   {@link RepositoryFile}s that reference the RepositoryFile identified by fileId.
 * @param fileId file id
 * @return list of repository files that reference the fileId repository file
 */
List<RepositoryFile> getReferrers(final Serializable fileId);
Program: 47540
Project: 47540
Buggy source:
/** 
 * Returns the children of this folder that match the specified filter.
 * @param folderId id of folder whose children to fetch
 * @param filter filter may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these
 * @return list of children (never {@code null})
 */
List<RepositoryFile> getChildren(final Serializable folderId,final String filter);

Fixed version (ground truth):
/** 
 * Returns the children of this folder that match the specified filter.
 * @param folderId id of folder whose children to fetch
 * @param filter   filter may be a full name or a partial name with one or more wildcard characters ("*"), or adisjunction (using the "|" character to represent logical OR) of these
 * @return list of children (never {@code null})
 */
List<RepositoryFile> getChildren(final Serializable folderId,final String filter);
Program: 47541
Project: 47541
Buggy source:
/** 
 * Gets data at base version for execute.
 * @param fileId file id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataForExecute(final Serializable fileId,final Class<T> dataClass);

Fixed version (ground truth):
/** 
 * Gets data at base version for execute.
 * @param fileId    file id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataForExecute(final Serializable fileId,final Class<T> dataClass);
Program: 47542
Project: 47542
Buggy source:
/** 
 * Updates a file and/or the data of a file.
 * @param file updated file (not a folder); must have non-null id
 * @param data updated data
 * @param versionMessage (optional) version comment
 * @return updated file (possibly with new version number)
 */
RepositoryFile updateFile(final RepositoryFile file,final IRepositoryFileData data,final String versionMessage);

Fixed version (ground truth):
/** 
 * Updates a file and/or the data of a file.
 * @param file           updated file (not a folder); must have non-null id
 * @param data           updated data
 * @param versionMessage (optional) version comment
 * @return updated file (possibly with new version number)
 */
RepositoryFile updateFile(final RepositoryFile file,final IRepositoryFileData data,final String versionMessage);
Program: 47543
Project: 47543
Buggy source:
/** 
 * Gets data at given version for read.
 * @param fileId file id
 * @param versionId version id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataAtVersionForRead(final Serializable fileId,final Serializable versionId,final Class<T> dataClass);

Fixed version (ground truth):
/** 
 * Gets data at given version for read.
 * @param fileId    file id
 * @param versionId version id
 * @param dataClass class that implements {@link IRepositoryFileData}
 * @return data
 */
<T extends IRepositoryFileData>T getDataAtVersionForRead(final Serializable fileId,final Serializable versionId,final Class<T> dataClass);
Program: 47544
Project: 47544
Buggy source:
/** 
 * Recovers a deleted file if it was not permanently deleted. File is recovered to its original folder.
 * @param fileId deleted file id
 * @param versionMessage optional version comment to be applied to original parent folder
 */
void undeleteFile(final Serializable fileId,final String versionMessage);

Fixed version (ground truth):
/** 
 * Recovers a deleted file if it was not permanently deleted. File is recovered to its original folder.
 * @param fileId         deleted file id
 * @param versionMessage optional version comment to be applied to original parent folder
 */
void undeleteFile(final Serializable fileId,final String versionMessage);
Program: 47546
Project: 47546
Buggy source:
/** 
 * {@inheritDoc}<p> Delegates to   {@link #getStreamForRead(RepositoryFile)} but assumes that some external system (e.g. Spring Security)is protecting this method with different authorization rules than  {@link #getStreamForRead(RepositoryFile)}. </p> <p> In a direct contradiction of the previous paragraph, this implementation is not currently protected by Spring Security. </p>
 * @see #getDataForRead(RepositoryFile,Class)
 */
public <T extends IRepositoryFileData>T getDataForExecute(final Serializable fileId,final Class<T> dataClass){
  return getDataAtVersionForExecute(fileId,null,dataClass);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p/> <p> Delegates to   {@link #getStreamForRead(RepositoryFile)} but assumes that some external system (e.g. Spring Security)is protecting this method with different authorization rules than  {@link #getStreamForRead(RepositoryFile)}. </p> <p/> <p> In a direct contradiction of the previous paragraph, this implementation is not currently protected by Spring Security. </p>
 * @see #getDataForRead(RepositoryFile,Class)
 */
public <T extends IRepositoryFileData>T getDataForExecute(final Serializable fileId,final Class<T> dataClass){
  return getDataAtVersionForExecute(fileId,null,dataClass);
}
Program: 47549
Project: 47549
Buggy source:
/** 
 * Creates a new file in the repository
 * @param bundle
 * @param destinationPath
 * @param bundlePath
 * @param ext
 * @param data
 * @param comment
 */
protected RepositoryFile createFile(final ImportSource.IRepositoryFileBundle bundle,final String destinationPath,final String bundlePath,final String ext,final IRepositoryFileData data,final String comment){
  final boolean hidden=!executableTypes.contains(ext.toLowerCase());
  log.trace("String_Node_Str" + hidden + "String_Node_Str"+ ext.toLowerCase());
  final RepositoryFile file=new RepositoryFile.Builder(bundle.getFile()).hidden(hidden).build();
  final Serializable parentId=getParentId(destinationPath,bundlePath);
  return repository.createFile(parentId,file,data,bundle.getAcl(),comment);
}

Fixed version (ground truth):
/** 
 * Creates a new file in the repository
 * @param bundle
 * @param destinationPath
 * @param bundlePath
 * @param ext
 * @param data
 * @param comment
 */
protected RepositoryFile createFile(final ImportSource.IRepositoryFileBundle bundle,final String destinationPath,final String bundlePath,final String ext,final IRepositoryFileData data,final String comment){
  final boolean hidden=!executableTypes.contains(ext.toLowerCase());
  log.trace("String_Node_Str" + hidden + "String_Node_Str"+ ext.toLowerCase());
  final RepositoryFile file=new RepositoryFile.Builder(bundle.getFile()).hidden(hidden).build();
  final Serializable parentId=getParentId(destinationPath,bundlePath);
  final RepositoryFileAcl acl=bundle.getAcl();
  if (null == acl) {
    return repository.createFile(parentId,file,data,comment);
  }
 else {
    return repository.createFile(parentId,file,data,acl,comment);
  }
}
Program: 47552
Project: 47552
Buggy source:
private static final File createTempDir() throws IOException {
  final File tempDir=File.createTempFile("String_Node_Str","String_Node_Str");
  assertTrue(tempDir.delete());
  assertTrue(tempDir.mkdir());
  return tempDir;
}

Fixed version (ground truth):
private static File createTempDir() throws IOException {
  final File tempDir=File.createTempFile("String_Node_Str","String_Node_Str");
  assertTrue(tempDir.delete());
  assertTrue(tempDir.mkdir());
  return tempDir;
}
Program: 47553
Project: 47553
Buggy source:
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  for (  MondrianCatalog mondrianCatalog : mondrianCatalogService.listCatalogs(PentahoSessionHolder.getSession(),true)) {
    Domain domain=metadataDomainRepository.getDomain(mondrianCatalog.getName());
    if (domain == null) {
      datasourceInfoList.add(new GenericDatasourceInfo(mondrianCatalog.getName(),TYPE));
    }
  }
  return datasourceInfoList;
}

Fixed version (ground truth):
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  for (  MondrianCatalog mondrianCatalog : mondrianCatalogService.listCatalogs(PentahoSessionHolder.getSession(),true)) {
    String domainId=mondrianCatalog.getName() + METADATA_EXT;
    Domain domain=metadataDomainRepository.getDomain(domainId);
    if (domain == null) {
      datasourceInfoList.add(new GenericDatasourceInfo(mondrianCatalog.getName(),TYPE));
    }
  }
  return datasourceInfoList;
}
Program: 47554
Project: 47554
Buggy source:
public GenericDatasourceInfo(String id,String type){
  super();
  this.id=id;
  this.type=type;
}

Fixed version (ground truth):
public GenericDatasourceInfo(String name,String id,String type){
  super();
  this.name=name;
  this.id=id;
  this.type=type;
}
Program: 47555
Project: 47555
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public String toString(){
  return "String_Node_Str" + id + "String_Node_Str"+ type+ "String_Node_Str";
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public String toString(){
  return "String_Node_Str" + name + "String_Node_Str"+ id+ "String_Node_Str"+ type+ "String_Node_Str";
}
Program: 47556
Project: 47556
Buggy source:
public JDBCDatasource(IDatabaseConnection datasource,String id,String type){
  super(id,type);
  this.datasource=datasource;
}

Fixed version (ground truth):
public JDBCDatasource(IDatabaseConnection datasource,String name,String id,String type){
  super(name,id,type);
  this.datasource=datasource;
}
Program: 47557
Project: 47557
Buggy source:
@Override public List<IGenericDatasource> getAll() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasource> jdbcDatasourceList=new ArrayList<IGenericDatasource>();
  try {
    for (    IDatabaseConnection databaseConnection : datasourceMgmtService.getDatasources()) {
      jdbcDatasourceList.add(new JDBCDatasource(databaseConnection,databaseConnection.getName(),TYPE));
    }
    return jdbcDatasourceList;
  }
 catch (  DatasourceMgmtServiceException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public List<IGenericDatasource> getAll() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasource> jdbcDatasourceList=new ArrayList<IGenericDatasource>();
  try {
    for (    IDatabaseConnection databaseConnection : datasourceMgmtService.getDatasources()) {
      jdbcDatasourceList.add(new JDBCDatasource(databaseConnection,databaseConnection.getName(),databaseConnection.getName(),TYPE));
    }
    return jdbcDatasourceList;
  }
 catch (  DatasourceMgmtServiceException e) {
    return null;
  }
}
Program: 47558
Project: 47558
Buggy source:
@Override public JDBCDatasource get(String id) throws GenericDatasourceServiceException, PentahoAccessControlException {
  helper.checkAdministratorAccess();
  try {
    IDatabaseConnection databaseConnection=datasourceMgmtService.getDatasourceByName(id);
    return new JDBCDatasource(databaseConnection,databaseConnection.getName(),TYPE);
  }
 catch (  DatasourceMgmtServiceException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public JDBCDatasource get(String id) throws GenericDatasourceServiceException, PentahoAccessControlException {
  helper.checkAdministratorAccess();
  try {
    IDatabaseConnection databaseConnection=datasourceMgmtService.getDatasourceByName(id);
    return new JDBCDatasource(databaseConnection,databaseConnection.getName(),databaseConnection.getName(),TYPE);
  }
 catch (  DatasourceMgmtServiceException e) {
    return null;
  }
}
Program: 47559
Project: 47559
Buggy source:
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  try {
    for (    IDatabaseConnection databaseConnection : datasourceMgmtService.getDatasources()) {
      datasourceInfoList.add(new GenericDatasourceInfo(databaseConnection.getName(),TYPE));
    }
    return datasourceInfoList;
  }
 catch (  DatasourceMgmtServiceException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  try {
    for (    IDatabaseConnection databaseConnection : datasourceMgmtService.getDatasources()) {
      datasourceInfoList.add(new GenericDatasourceInfo(databaseConnection.getName(),databaseConnection.getName(),TYPE));
    }
    return datasourceInfoList;
  }
 catch (  DatasourceMgmtServiceException e) {
    return null;
  }
}
Program: 47560
Project: 47560
Buggy source:
public MetadataDatasource(Domain datasource,String id,String type){
  super(id,type);
  this.datasource=datasource;
}

Fixed version (ground truth):
public MetadataDatasource(Domain datasource,String name,String id,String type){
  super(name,id,type);
  this.datasource=datasource;
}
Program: 47561
Project: 47561
Buggy source:
@Override public MetadataDatasource get(String id) throws GenericDatasourceServiceException, PentahoAccessControlException {
  helper.checkAdministratorAccess();
  Domain domain=metadataDomainRepository.getDomain(id);
  if (domain != null) {
    return new MetadataDatasource(domain,domain.getId(),TYPE);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public MetadataDatasource get(String id) throws GenericDatasourceServiceException, PentahoAccessControlException {
  helper.checkAdministratorAccess();
  Domain domain=metadataDomainRepository.getDomain(id);
  if (domain != null) {
    return new MetadataDatasource(domain,domain.getId(),domain.getId(),TYPE);
  }
 else {
    return null;
  }
}
Program: 47562
Project: 47562
Buggy source:
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  for (  String id : metadataDomainRepository.getDomainIds()) {
    try {
      if (isMetadataDatasource(id)) {
        datasourceInfoList.add(new GenericDatasourceInfo(id,TYPE));
      }
    }
 catch (    GenericDatasourceServiceException e) {
      e.printStackTrace();
    }
  }
  return datasourceInfoList;
}

Fixed version (ground truth):
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  for (  String id : metadataDomainRepository.getDomainIds()) {
    try {
      if (isMetadataDatasource(id)) {
        datasourceInfoList.add(new GenericDatasourceInfo(id,id,TYPE));
      }
    }
 catch (    GenericDatasourceServiceException e) {
      e.printStackTrace();
    }
  }
  return datasourceInfoList;
}
Program: 47563
Project: 47563
Buggy source:
public MondrianDatasource(MondrianCatalog datasource,String id,String type){
  super(id,type);
  this.datasource=datasource;
}

Fixed version (ground truth):
public MondrianDatasource(MondrianCatalog datasource,String name,String id,String type){
  super(name,id,type);
  this.datasource=datasource;
}
Program: 47564
Project: 47564
Buggy source:
@Override public List<IGenericDatasource> getAll() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasource> mondrianDatasourceList=new ArrayList<IGenericDatasource>();
  for (  MondrianCatalog mondrianCatalog : mondrianCatalogService.listCatalogs(PentahoSessionHolder.getSession(),true)) {
    mondrianDatasourceList.add(new MondrianDatasource(mondrianCatalog,mondrianCatalog.getName(),TYPE));
  }
  return mondrianDatasourceList;
}

Fixed version (ground truth):
@Override public List<IGenericDatasource> getAll() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasource> mondrianDatasourceList=new ArrayList<IGenericDatasource>();
  for (  MondrianCatalog mondrianCatalog : mondrianCatalogService.listCatalogs(PentahoSessionHolder.getSession(),true)) {
    mondrianDatasourceList.add(new MondrianDatasource(mondrianCatalog,mondrianCatalog.getName(),mondrianCatalog.getName(),TYPE));
  }
  return mondrianDatasourceList;
}
Program: 47565
Project: 47565
Buggy source:
@Override public MondrianDatasource get(String id) throws GenericDatasourceServiceException, PentahoAccessControlException {
  helper.checkAdministratorAccess();
  MondrianCatalog mondrianCatalog=mondrianCatalogService.getCatalog(id,PentahoSessionHolder.getSession());
  return new MondrianDatasource(mondrianCatalog,mondrianCatalog.getName(),TYPE);
}

Fixed version (ground truth):
@Override public MondrianDatasource get(String id) throws GenericDatasourceServiceException, PentahoAccessControlException {
  helper.checkAdministratorAccess();
  MondrianCatalog mondrianCatalog=mondrianCatalogService.getCatalog(id,PentahoSessionHolder.getSession());
  return new MondrianDatasource(mondrianCatalog,mondrianCatalog.getName(),mondrianCatalog.getName(),TYPE);
}
Program: 47566
Project: 47566
Buggy source:
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  for (  MondrianCatalog mondrianCatalog : mondrianCatalogService.listCatalogs(PentahoSessionHolder.getSession(),true)) {
    String domainId=mondrianCatalog.getName() + METADATA_EXT;
    Domain domain=metadataDomainRepository.getDomain(domainId);
    if (domain == null) {
      datasourceInfoList.add(new GenericDatasourceInfo(mondrianCatalog.getName(),TYPE));
    }
  }
  return datasourceInfoList;
}

Fixed version (ground truth):
@Override public List<IGenericDatasourceInfo> getIds() throws PentahoAccessControlException {
  helper.checkAdministratorAccess();
  List<IGenericDatasourceInfo> datasourceInfoList=new ArrayList<IGenericDatasourceInfo>();
  for (  MondrianCatalog mondrianCatalog : mondrianCatalogService.listCatalogs(PentahoSessionHolder.getSession(),true)) {
    String domainId=mondrianCatalog.getName() + METADATA_EXT;
    Domain domain=metadataDomainRepository.getDomain(domainId);
    if (domain == null) {
      datasourceInfoList.add(new GenericDatasourceInfo(mondrianCatalog.getName(),mondrianCatalog.getName(),TYPE));
    }
  }
  return datasourceInfoList;
}
Program: 47567
Project: 47567
Buggy source:
@GET @Path("String_Node_Str") @Produces({APPLICATION_XML,APPLICATION_JSON}) public List<GenericDatasourceInfo> getDatasources() throws PentahoAccessControlException {
  List<GenericDatasourceInfo> infoList=new ArrayList<GenericDatasourceInfo>();
  for (  IGenericDatasourceInfo datasourceInfo : datasourceServiceManager.getIds()) {
    infoList.add(new GenericDatasourceInfo(datasourceInfo.getId(),datasourceInfo.getType()));
  }
  return infoList;
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces({APPLICATION_XML,APPLICATION_JSON}) public List<GenericDatasourceInfo> getDatasources() throws PentahoAccessControlException {
  List<GenericDatasourceInfo> infoList=new ArrayList<GenericDatasourceInfo>();
  for (  IGenericDatasourceInfo datasourceInfo : datasourceServiceManager.getIds()) {
    infoList.add(new GenericDatasourceInfo(datasourceInfo.getName(),datasourceInfo.getId(),datasourceInfo.getType()));
  }
  return infoList;
}
Program: 47568
Project: 47568
Buggy source:
/** 
 * Returns the specified folder in the current repository. If it can not be found, it will optionally be created. The missing parent folders can also be created if needed
 * @param path the full path to the requested folder in the repository
 * @param createIfNotExist {@code true} indicates the folder will be created if it doesn't exist
 * @param createParents {@code true} indicates that any missing parent folders will be created if they do not exist
 * @param versionMessage the message used if any folders are created
 * @return the {@link RepositoryFile} of the request folders, or {@code null} if it does not exist and theparameters do not allow for it to be created
 */
public RepositoryFile getFolder(final String path,final boolean createIfNotExist,final boolean createParents,final String versionMessage){
  RepositoryFile folder=repository.getFile(path);
  if (null == folder && createIfNotExist) {
    final String parentPath=getParentPath(path);
    if (null != parentPath) {
      final RepositoryFile parentFolder=getFolder(parentPath,createParents,createParents,versionMessage);
      if (null != parentFolder) {
        final String folderName=FilenameUtils.getName(path);
        folder=new RepositoryFile.Builder(folderName).path(path).folder(true).build();
        folder=repository.createFolder(parentFolder.getId(),folder,versionMessage);
      }
    }
  }
  return folder;
}

Fixed version (ground truth):
public RepositoryFile getFolder(final String path,final RepositoryFileAcl acl,final boolean createIfNotExist,final boolean createParents,final String versionMessage){
  RepositoryFile folder=repository.getFile(path);
  if (null == folder && createIfNotExist) {
    final String parentPath=getParentPath(path);
    if (null != parentPath) {
      final RepositoryFile parentFolder=getFolder(parentPath,createParents,createParents,versionMessage);
      if (null != parentFolder) {
        final String folderName=FilenameUtils.getName(path);
        folder=new RepositoryFile.Builder(folderName).path(path).folder(true).build();
        if (null != acl) {
          folder=repository.createFolder(parentFolder.getId(),folder,acl,versionMessage);
        }
 else {
          folder=repository.createFolder(parentFolder.getId(),folder,versionMessage);
        }
      }
    }
  }
  return folder;
}
Program: 47569
Project: 47569
Buggy source:
public Importer(final IUnifiedRepository unifiedRepository,final Map<String,Converter> converters){
  super();
  Assert.notNull(unifiedRepository);
  Assert.notNull(converters);
  this.unifiedRepository=unifiedRepository;
  this.converters=converters;
  try {
    pluginManager=PentahoSystem.get(IPluginManager.class,null);
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str");
  }
  contentHandlers=new ArrayList<ImportContentHandler>();
  contentHandlers.add(new PentahoMetadataImportContentHandler());
}

Fixed version (ground truth):
public Importer(final IUnifiedRepository unifiedRepository,final Map<String,Converter> converters){
  super();
  Assert.notNull(unifiedRepository);
  Assert.notNull(converters);
  this.unifiedRepository=unifiedRepository;
  this.converters=converters;
  try {
    pluginManager=PentahoSystem.get(IPluginManager.class,null);
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str");
  }
  contentHandlers=new ArrayList<ImportContentHandler>();
  contentHandlers.add(new PentahoMetadataImportContentHandler());
  repositoryUtils=new RepositoryUtils(unifiedRepository);
}