use of aserg.gtf.model.authorship.File in project Truck-Factor by aserg-ufmg.
the class DOACalculator method getFiles.
private static List<File> getFiles(Repository repository, Collection<LogCommitInfo> commitFiles, List<NewFileInfo> filesInfo) {
List<File> tempfiles = new ArrayList<File>();
Map<String, List<LogCommitFileInfo>> mapFiles = getCommitFilesMap(commitFiles);
for (NewFileInfo fileInfo : filesInfo) {
if (!fileInfo.getFiltered()) {
File file = new File(fileInfo.getPath());
if (setFileHistory(file, repository, fileInfo, mapFiles))
tempfiles.add(file);
}
}
return tempfiles;
}
use of aserg.gtf.model.authorship.File in project Truck-Factor by aserg-ufmg.
the class GreedyTruckFactor method getFilesAuthorMap.
private Map<Developer, Set<File>> getFilesAuthorMap(Repository repository) {
Map<Developer, Set<File>> map = new HashMap<Developer, Set<File>>();
List<Developer> developers = repository.getDevelopers();
for (Developer developer : developers) {
Set<File> devFiles = new HashSet<File>();
List<AuthorshipInfo> authorships = developer.getAuthorshipInfos();
for (AuthorshipInfo authorshipInfo : authorships) {
if (authorshipInfo.isDOAAuthor())
devFiles.add(authorshipInfo.getFile());
}
if (devFiles.size() > 0)
map.put(developer, devFiles);
}
return map;
}
Aggregations