mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
18.58.2014 a94c41b1759c23f849376a5f5448bc6e819f1c11
opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java
@@ -397,15 +397,15 @@
        long nvalue = baseUnit.toMilliSeconds(value);
        if (!allowUnlimited && nvalue < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
            // unlimited allowed
        } else if (nvalue >= 0 && nvalue < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        if ((upperLimit != null) && (nvalue > upperLimit)) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
@@ -451,21 +451,21 @@
        try {
            ms = DurationUnit.parseValue(value);
        } catch (NumberFormatException e) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        // Check the unit is in range - values must not be more granular
        // than the base unit.
        if ((ms % baseUnit.getDuration()) != 0) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        // Convert the value a long in the property's required unit.
        Long i = (long) baseUnit.fromMilliSeconds(ms);
        try {
            validateValue(i, options);
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value);
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        return i;
    }