Skip to content

Commit f843218

Browse files
Made changePronenessRanker a field member
1 parent 92f5f2a commit f843218

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cost-benefit-calculator/src/main/java/org/hjug/cbc/CostBenefitCalculator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class CostBenefitCalculator {
2929
private String repositoryPath;
3030
private final GitLogReader gitLogReader = new GitLogReader();
3131
private Repository repository = null;
32+
private final ChangePronenessRanker changePronenessRanker;
3233

3334
public CostBenefitCalculator(String repositoryPath) {
3435
this.repositoryPath = repositoryPath;
@@ -43,6 +44,8 @@ public CostBenefitCalculator(String repositoryPath) {
4344
} catch (IOException e) {
4445
log.error("Failure to access Git repository", e);
4546
}
47+
48+
changePronenessRanker = new ChangePronenessRanker(repository, gitLogReader);
4649
}
4750

4851
// copied from PMD's PmdTaskImpl.java and modified
@@ -135,7 +138,6 @@ <T extends Disharmony> List<ScmLogInfo> getRankedChangeProneness(List<T> disharm
135138
}
136139
}
137140

138-
ChangePronenessRanker changePronenessRanker = new ChangePronenessRanker(repository, gitLogReader);
139141
changePronenessRanker.rankChangeProneness(scmLogInfos);
140142
return scmLogInfos;
141143
}

0 commit comments

Comments
 (0)