in src/org/jetbrains/tfsIntegration/checkin/CheckinParameters.java [394:441]
public Pair<String/*message*/, Severity> getValidationMessage(final Severity severity) {
StringBuilder result = new StringBuilder();
Severity resultingSeverity = Severity.WARNING;
final boolean checkError = severity == Severity.ERROR || severity == Severity.BOTH;
boolean checkWarning = severity == Severity.WARNING || severity == Severity.BOTH;
if (!myPoliciesEvaluated && checkWarning) {
if (evaluationEnabled()) {
result.append("Checkin policies were not evaluated");
}
checkWarning = false;
}
for (Map.Entry<ServerInfo, ServerData> entry : myData.entrySet()) {
final ServerData data = entry.getValue();
if ((checkError && !data.myEmptyNotes.isEmpty()) || (checkWarning && !data.myPolicyFailures.isEmpty())) {
if (result.length() > 0) {
result.append("\n");
}
if (myData.size() > 1) {
result.append(entry.getKey().getPresentableUri()).append("\n");
}
if (checkError && !data.myEmptyNotes.isEmpty()) {
resultingSeverity = Severity.ERROR;
final String message;
if (data.myEmptyNotes.size() > 1) {
message = MessageFormat
.format("Checkin notes ''{0}'' are required to commit", StringUtil.join(ArrayUtilRt.toStringArray(data.myEmptyNotes), "', '"));
}
else {
message = MessageFormat.format("Checkin note ''{0}'' is required to commit", data.myEmptyNotes.iterator().next());
}
result.append(message);
}
if (checkWarning && !data.myPolicyFailures.isEmpty()) {
if (checkError && !data.myEmptyNotes.isEmpty()) {
result.append("\n");
}
result.append("Checkin policy warnings found");
}
}
}
return result.length() > 0 ? Pair.create(result.toString(), resultingSeverity) : null;
}