Even more refactoring.

This commit is contained in:
nnh 2015-11-19 12:54:06 +01:00
parent c32916bfae
commit 11c9636e21
1 changed files with 2 additions and 12 deletions

View File

@ -4,11 +4,9 @@ import java.util.stream.Collectors;
public class CalculateDaysSpent {
static String whooseCommitsToLookFor = null;
public static void main (String [] args) throws Exception {
whooseCommitsToLookFor = Util.getCommentAuthorEmail(args);
final String whooseCommitsToLookFor = Util.getCommentAuthorEmail(args);
System.out.println("The commit author email to filter commits by: " + whooseCommitsToLookFor);
List<Commit> allCommits = CommitLoader.loadCommits("exported-commit-logs");
@ -16,7 +14,7 @@ public class CalculateDaysSpent {
List<Commit> commitsOwnedByAuthor = allCommits
.stream()
.filter(CalculateDaysSpent::isCommitByMe)
.filter(commit -> commit.getAuthor().contains(whooseCommitsToLookFor))
.collect(Collectors.toList());
System.out.println("Number of commits owned by commit author \"" + whooseCommitsToLookFor + "\": " +
@ -31,12 +29,4 @@ public class CalculateDaysSpent {
}
private static boolean isCommitByMe(Commit commit) {
if (commit.getAuthor().contains(whooseCommitsToLookFor)) {
return true;
} else {
return false;
}
}
}