码迷,mamicode.com
首页 > 其他好文 > 详细

CoverageBuilder

时间:2020-07-23 16:48:59      阅读:83      评论:0      收藏:0      [点我收藏+]

标签:builder   his   lis   ring   empty   info   xutils   rem   source   

public CoverageBuilder(String gitPath, String newBranchName, String oldBranchName, List<String> exclusionList) {
this.classes = new HashMap<String, IClassCoverage>();
this.sourcefiles = new HashMap<String, ISourceFileCoverage>();
List<ClassInfo> classInfoList = CodeDiff.diffBranchToBranch(gitPath, newBranchName, oldBranchName);
if(exclusionList != null && !exclusionList.isEmpty()){
List<Pattern> nameList = new ArrayList<Pattern>();
List<Pattern> packageList = new ArrayList<Pattern>();
for(String item : exclusionList){
item = RegExUtils.removeAll(item, "\\*\\*\\/");
item = RegExUtils.removeAll(item, "\\/\\*\\*");
if(StringUtils.endsWith(item, ".java")||StringUtils.endsWith(item,".class")){
nameList.add(Pattern.compile(RegExUtils.replaceAll(StringUtils.remove(StringUtils.remove(item, ".java"), ".class"), "\\*", ".*")));
} else {
packageList.add(Pattern.compile(RegExUtils.replaceAll(item, "\\*", ".*")));
}
}
for (int i = classInfoList.size() -1; i >=0; i--) {
if(excludeClass(classInfoList.get(i), packageList, nameList)){
exclusionList.remove(i);
}
}
}
classInfos = classInfoList;
}

CoverageBuilder

标签:builder   his   lis   ring   empty   info   xutils   rem   source   

原文地址:https://www.cnblogs.com/exmyth/p/13366267.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!