From 9314d4add5ffbc40b21347539a0e503964dae207 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Sat, 18 Jan 2014 00:58:42 +0000
Subject: [PATCH] Simplify config framework exception hierarchy by removing and pulling up the following exceptions:
---
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java b/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java
index 868e81a..245bff8 100644
--- a/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java
+++ b/opendj-sdk/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;
}
--
Gitblit v1.10.0