/** * Indexes an annotation by author name. * * @param annotation the new annotation */ private void addAuthorName(final FileAnnotation annotation) { String key = annotation.getAuthor(); if (!authorsByName.containsKey(key)) { Author container = new Author(key, annotation.getAuthorDetails(), annotation.getAuthorName(), annotation.getAuthorEmail(), Hierarchy.USER); authorsByName.put(key, container); authorsByHashCode.put(key.hashCode(), container); } authorsByName.get(key).addAnnotation(annotation); }
private void mergeResults(final BuildResult current, final Map<String, Integer[]> annotationCountByUser) { Collection<FileAnnotation> annotations = current.getAnnotations(); for (FileAnnotation annotation : annotations) { String author = annotation.getAuthor(); if (StringUtils.isNotBlank(author) && !"-".equals(author)) { if (annotationCountByUser.get(author) == null) { annotationCountByUser.put(author, new Integer[]{0, 0, 0}); } Integer[] priorities = annotationCountByUser.get(author); int index = annotation.getPriority().ordinal(); priorities[index]++; } } }