private void exportIssues(File exportDir) {
File issuesFile = new File(exportDir, "issues.json");
FileWriter issueWriter = null;
try {
issueWriter = new FileWriter(issuesFile);
JsonWriter jsonWriter = JsonWriter.of(issueWriter);
jsonWriter
.beginObject().name("issues")
.beginArray();
for (Issue issue : issueCache.byModule(def.getKey())) {
jsonWriter.beginObject()
.prop("repository", issue.ruleKey().repository())
.prop("rule", issue.ruleKey().rule());
InputPath inputPath = issue.inputPath();
if (inputPath != null) {
jsonWriter.prop("path", inputPath.relativePath());
}
jsonWriter.prop("message", issue.message())
.prop("effortToFix", issue.effortToFix())
.prop("line", issue.line());
Severity overridenSeverity = issue.overridenSeverity();
if (overridenSeverity != null) {
jsonWriter.prop("severity", overridenSeverity.name());
}
jsonWriter.endObject();
}
jsonWriter.endArray()
.endObject()
.close();
} catch (IOException e) {
throw unableToExport(e);
} finally {