From d46701cdbecec6f6c10f57432f3e6a484752f42c Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Sat, 18 Jan 2014 00:55:24 +0000
Subject: [PATCH] Simplify config framework exception hierarchy by removing and pulling up the following exceptions:

---
 opendj3-server-dev/src/server/org/opends/server/admin/DurationPropertyDefinition.java |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/admin/DurationPropertyDefinition.java b/opendj3-server-dev/src/server/org/opends/server/admin/DurationPropertyDefinition.java
index de31ee6..bb8a679 100644
--- a/opendj3-server-dev/src/server/org/opends/server/admin/DurationPropertyDefinition.java
+++ b/opendj3-server-dev/src/server/org/opends/server/admin/DurationPropertyDefinition.java
@@ -462,20 +462,20 @@
    * {@inheritDoc}
    */
   @Override
-  public void validateValue(Long value) throws IllegalPropertyValueException {
+  public void validateValue(Long value) throws PropertyException {
     ifNull(value);
 
     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);
     }
   }
 
@@ -485,7 +485,7 @@
    * {@inheritDoc}
    */
   @Override
-  public String encodeValue(Long value) throws IllegalPropertyValueException {
+  public String encodeValue(Long value) throws PropertyException {
     ifNull(value);
 
     // Make sure that we correctly encode negative values as
@@ -511,7 +511,7 @@
    */
   @Override
   public Long decodeValue(String value)
-      throws IllegalPropertyValueStringException {
+      throws PropertyException {
     ifNull(value);
 
     // First check for the special "unlimited" value when necessary.
@@ -526,21 +526,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);
-    } catch (IllegalPropertyValueException e) {
-      throw new IllegalPropertyValueStringException(this, value);
+    } catch (PropertyException e) {
+      throw PropertyException.illegalPropertyValueException(this, value);
     }
     return i;
   }

--
Gitblit v1.10.0