}
// TODO(laurence): add more general support for AlertPolicy configuration
private static final AlertPolicy computeAlertPolicy(List<String> warnFlags,
List<String> errorFlags) {
ConfigurableAlertPolicy result = new ConfigurableAlertPolicy();
configureAlertPolicy(result, warnFlags, Severity.WARNING);
configureAlertPolicy(result, errorFlags, Severity.ERROR);
if (warnFlags.contains("error")) {
result.setTreatWarningsAsErrors(true);
}
return result;
}