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/ClassPropertyDefinition.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java b/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
index b9bc49e..f5f1284 100644
--- a/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
+++ b/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
@@ -157,8 +157,8 @@
try {
validateValue(value, options);
- } catch (IllegalPropertyValueException e) {
- throw new IllegalPropertyValueStringException(this, value, e.getCause());
+ } catch (PropertyException e) {
+ throw PropertyException.illegalPropertyValueException(this, value, e.getCause());
}
return value;
@@ -187,7 +187,7 @@
* The class representing the requested type.
* @return Returns the named class cast to a subclass of the specified
* class.
- * @throws IllegalPropertyValueException
+ * @throws PropertyException
* If the named class was invalid, could not be loaded, or did
* not implement the required interfaces.
* @throws ClassCastException
@@ -240,7 +240,7 @@
private void validateClassName(String className) {
String nvalue = className.trim();
if (!nvalue.matches(CLASS_RE)) {
- throw new IllegalPropertyValueException(this, className);
+ throw PropertyException.illegalPropertyValueException(this, className);
}
}
@@ -253,7 +253,7 @@
for (String i : instanceOfInterfaces) {
Class<?> instanceOfClass = loadClassForValidation(className, i, initialize);
if (!instanceOfClass.isAssignableFrom(theClass)) {
- throw new IllegalPropertyValueException(this, className);
+ throw PropertyException.illegalPropertyValueException(this, className);
}
}
return theClass;
@@ -264,10 +264,10 @@
return loadClass(classToBeLoaded.trim(), initialize);
} catch (ClassNotFoundException e) {
// If the class cannot be loaded then it is an invalid value.
- throw new IllegalPropertyValueException(this, componentClassName, e);
+ throw PropertyException.illegalPropertyValueException(this, componentClassName, e);
} catch (LinkageError e) {
// If the class cannot be initialized then it is an invalid value.
- throw new IllegalPropertyValueException(this, componentClassName, e);
+ throw PropertyException.illegalPropertyValueException(this, componentClassName, e);
}
}
}
--
Gitblit v1.10.0