Check that int are positive.

This commit is contained in:
Erik C. Thauvin 2019-04-16 14:26:33 -07:00
parent 4a1f9e45f5
commit bae6497368

View file

@ -165,7 +165,7 @@ public class VersionProcessor extends AbstractProcessor {
private int parseIntProperty(final Properties p, final String property, final int defaultValue) { private int parseIntProperty(final Properties p, final String property, final int defaultValue) {
try { try {
return Integer.parseInt(p.getProperty(property, Integer.toString(defaultValue)).trim()); return Math.abs(Integer.parseInt(p.getProperty(property, Integer.toString(defaultValue)).trim()));
} catch (NumberFormatException ignore) { } catch (NumberFormatException ignore) {
warn("Invalid property value: " + property); warn("Invalid property value: " + property);
return defaultValue; return defaultValue;