Even more refactoring.
This commit is contained in:
parent
c32916bfae
commit
11c9636e21
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue