Check that int are positive.
This commit is contained in:
parent
4a1f9e45f5
commit
bae6497368
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue