in log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/MinValueConstraint.java [32:60]
public void validate(boolean isRequestContext, String name, String value, String minValue, StringBuilder error) {
if (isBlank(minValue)) {
appendNewline(error);
if (isRequestContext) {
error.append("ThreadContext key ");
}
error.append(name).append(" has no value for the minimum value defined");
return;
}
if (!isBlank(value)) {
try {
BigDecimal minVal = new BigDecimal(minValue);
BigDecimal val = new BigDecimal(value);
if (val.compareTo(minVal) < 0) {
appendNewline(error);
if (isRequestContext) {
error.append("ThreadContext key ");
}
error.append(name).append(" is less than ").append(minValue);
}
} catch (Exception ex) {
appendNewline(error);
if (isRequestContext) {
error.append("ThreadContext key ");
}
error.append(name).append(" encountered an error trying to determine the minimum value: ").append(ex.getMessage());
}
}
}