use of org.revapi.CompatibilityType in project revapi by revapi.
the class AntReporter method report.
@Override
public void report(@Nonnull Report report) {
Element element = report.getOldElement();
if (element == null) {
element = report.getNewElement();
}
if (element == null) {
throw new IllegalStateException("This should not ever happen. Both elements in a report were null.");
}
for (Difference difference : report.getDifferences()) {
DifferenceSeverity maxSeverity = DifferenceSeverity.NON_BREAKING;
for (Map.Entry<CompatibilityType, DifferenceSeverity> e : difference.classification.entrySet()) {
if (e.getValue().compareTo(maxSeverity) >= 0) {
maxSeverity = e.getValue();
}
}
if (maxSeverity.compareTo(minSeverity) < 0) {
continue;
}
StringBuilder message = new StringBuilder();
message.append(element.getFullHumanReadableString()).append(": ").append(difference.code).append(": ").append(difference.description).append(" [");
for (Map.Entry<CompatibilityType, DifferenceSeverity> e : difference.classification.entrySet()) {
message.append(e.getKey()).append(": ").append(e.getValue()).append(", ");
}
message.replace(message.length() - 2, message.length(), "]");
logger.log(message.toString(), Project.MSG_ERR);
}
}
Aggregations