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/client/spi/PropertySet.java | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java b/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java
index c03de85..7d524e6 100644
--- a/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java
+++ b/opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java
@@ -33,11 +33,9 @@
import java.util.SortedSet;
import java.util.TreeSet;
-import org.forgerock.opendj.config.IllegalPropertyValueException;
+import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
-import org.forgerock.opendj.config.PropertyIsMandatoryException;
-import org.forgerock.opendj.config.PropertyIsSingleValuedException;
import org.forgerock.opendj.config.PropertyOption;
/**
@@ -285,13 +283,13 @@
* by this managed object.
* @param options
* Options to validate property definitions values.
- * @throws IllegalPropertyValueException
+ * @throws PropertyException
* If a new pending value is deemed to be invalid according to
* the property definition.
- * @throws PropertyIsSingleValuedException
+ * @throws PropertyException
* If an attempt was made to add multiple pending values to a
* single-valued property.
- * @throws PropertyIsMandatoryException
+ * @throws PropertyException
* If an attempt was made to remove a mandatory property.
* @throws IllegalArgumentException
* If the specified property definition is not associated with
@@ -302,13 +300,13 @@
MyProperty<T> property = (MyProperty<T>) getProperty(d);
if (values.size() > 1 && !d.hasOption(PropertyOption.MULTI_VALUED)) {
- throw new PropertyIsSingleValuedException(d);
+ throw PropertyException.propertyIsSingleValuedException(d);
}
if (values.isEmpty() && d.hasOption(PropertyOption.MANDATORY)) {
// But only if there are no default values.
if (property.getDefaultValues().isEmpty()) {
- throw new PropertyIsMandatoryException(d);
+ throw PropertyException.propertyIsMandatoryException(d);
}
}
--
Gitblit v1.10.0