Search in sources :

Example 6 with Repository

use of aserg.gtf.model.authorship.Repository in project Truck-Factor by aserg-ufmg.

the class RepositoryDAO method update.

public void update(Repository o) {
    Repository persistedRepository = this.em.find(Repository.class, o.getId());
    if (persistedRepository != null) {
        persistedRepository.setAuthorshipInfoMap(o.getAuthorshipInfoMap());
        persistedRepository.setDevelopers(o.getDevelopers());
        persistedRepository.setFiles(o.getFiles());
        persistedRepository.setFullName(o.getFullName());
        persistedRepository.setStatus(o.getStatus());
        super.merge(persistedRepository);
    }
}
Also used : Repository(aserg.gtf.model.authorship.Repository)

Example 7 with Repository

use of aserg.gtf.model.authorship.Repository in project Truck-Factor by aserg-ufmg.

the class AliasesIdentifier method main.

public static void main(String[] args) {
    RepositoryDAO repDAO = new RepositoryDAO();
    DeveloperDAO devDAO = new DeveloperDAO();
    //StringUtils.getLevenshteinDistance("", "");
    for (Repository rep : repDAO.findAll()) {
        if (rep.getStatus() != RepositoryStatus.REMOVED) {
            joinAlias(rep.getFullName(), devDAO);
            List<Developer> developers = devDAO.getAllDevelopers(rep.getFullName());
            Map<Developer, List<Developer>> aliases = findAliases(developers, 1, 3);
            List<Developer> devAliases = treatAliases(rep.getFullName(), aliases);
            updateDeveloperAliases(devDAO, devAliases);
        }
    }
}
Also used : RepositoryDAO(aserg.gtf.dao.authorship.RepositoryDAO) DeveloperDAO(aserg.gtf.dao.authorship.DeveloperDAO) Repository(aserg.gtf.model.authorship.Repository) Developer(aserg.gtf.model.authorship.Developer) ArrayList(java.util.ArrayList) List(java.util.List) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList)

Aggregations

Repository (aserg.gtf.model.authorship.Repository)7 LogCommitInfo (aserg.gtf.model.LogCommitInfo)3 NewFileInfo (aserg.gtf.model.NewFileInfo)3 DOACalculator (aserg.gtf.task.DOACalculator)3 GreedyTruckFactor (aserg.gtf.truckfactor.GreedyTruckFactor)2 TFInfo (aserg.gtf.truckfactor.TFInfo)2 TruckFactor (aserg.gtf.truckfactor.TruckFactor)2 List (java.util.List)2 DeveloperDAO (aserg.gtf.dao.authorship.DeveloperDAO)1 RepositoryDAO (aserg.gtf.dao.authorship.RepositoryDAO)1 Developer (aserg.gtf.model.authorship.Developer)1 NewAliasHandler (aserg.gtf.task.NewAliasHandler)1 FileInfoExtractor (aserg.gtf.task.extractor.FileInfoExtractor)1 GitLogExtractor (aserg.gtf.task.extractor.GitLogExtractor)1 LinguistExtractor (aserg.gtf.task.extractor.LinguistExtractor)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1