-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
49 lines (40 loc) · 1.25 KB
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package mining_software_repositories;
import java.io.File;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class Main {
public static void main(String[] args) {
// mine multiple-file bug reports
File dir = new File(Constants.HBASE_BUG_REPORT_DIR);
if (!dir.exists() || !dir.isDirectory()) {
return;
}
File[] bugReports = dir.listFiles();
if(bugReports != null && bugReports.length > 0) {
MiningBugReport.miningMulFiles(bugReports);
}
// mine one-file bug reports
SAXReader saxreader = new SAXReader();
try {
String[] onePaths = {
Constants.CRIMSON_XML_PATH,
Constants.TOMCAT_7_XML_PATH,
Constants.HTTPD_13_XML_PATH,
Constants.LOG4J_XML_PATH
};
for (String onePath : onePaths) {
Document document = saxreader.read(onePath);
Element root = document.getRootElement();
if (root != null && !Constants.LOG4J_XML_PATH.equals(onePath)) {
MiningBugReport.miningOneFile(root, false);
} else {
MiningBugReport.miningOneFile(root, true);
}
}
} catch(Throwable t) {
System.out.println(t.getMessage());
}
return;
}
}