Search in sources :

Example 1 with File

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;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) File(aserg.gtf.model.authorship.File) NewFileInfo(aserg.gtf.model.NewFileInfo)

Example 2 with File

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;
}
Also used : AuthorshipInfo(aserg.gtf.model.authorship.AuthorshipInfo) Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) Developer(aserg.gtf.model.authorship.Developer) File(aserg.gtf.model.authorship.File) HashSet(java.util.HashSet)

Aggregations

File (aserg.gtf.model.authorship.File)2 NewFileInfo (aserg.gtf.model.NewFileInfo)1 AuthorshipInfo (aserg.gtf.model.authorship.AuthorshipInfo)1 Developer (aserg.gtf.model.authorship.Developer)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1