From 4ed3b08887c800fb6f02ecc90df9092691b78208 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 30 Mar 2016 08:51:11 +0000
Subject: [PATCH] Prep work for OPENDJ-2803 Migrate Attribute
---
opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java | 29 +++++++++--------------------
1 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
index afc0c8b..f3c97fe 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
@@ -704,9 +704,7 @@
if (pendingValues != null)
{
// We cannot have multiple pending value sets.
- LocalizableMessage message =
- ERR_CONFIG_ATTR_MULTIPLE_PENDING_VALUE_SETS.get(attrDesc.getNameOrOID());
- throw new ConfigException(message);
+ throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_PENDING_VALUE_SETS.get(attrDesc));
}
@@ -715,7 +713,7 @@
if (isRequired())
{
// This is illegal -- it must have a value.
- throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc.getNameOrOID()));
+ throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc));
}
// This is fine. The pending value set can be empty.
pendingValues = new ArrayList<>(0);
@@ -726,9 +724,7 @@
if (numValues > 1 && !isMultiValued())
{
// This is illegal -- the attribute is single-valued.
- LocalizableMessage message =
- ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc.getNameOrOID());
- throw new ConfigException(message);
+ throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc));
}
pendingValues = new ArrayList<>(numValues);
@@ -738,7 +734,7 @@
if (! allowedValues.contains(lowerValue))
{
// This is illegal -- the value is not allowed.
- throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(v, attrDesc.getNameOrOID()));
+ throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(v, attrDesc));
}
pendingValues.add(v.toString());
@@ -749,9 +745,7 @@
{
// This is illegal -- only the pending option is allowed for
// configuration attributes.
- LocalizableMessage message =
- ERR_CONFIG_ATTR_OPTIONS_NOT_ALLOWED.get(attrDesc.getNameOrOID());
- throw new ConfigException(message);
+ throw new ConfigException(ERR_CONFIG_ATTR_OPTIONS_NOT_ALLOWED.get(attrDesc));
}
}
else
@@ -760,9 +754,7 @@
if (activeValues!= null)
{
// We cannot have multiple active value sets.
- LocalizableMessage message =
- ERR_CONFIG_ATTR_MULTIPLE_ACTIVE_VALUE_SETS.get(attrDesc.getNameOrOID());
- throw new ConfigException(message);
+ throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_ACTIVE_VALUE_SETS.get(attrDesc));
}
@@ -771,8 +763,7 @@
if (isRequired())
{
// This is illegal -- it must have a value.
- LocalizableMessage message = ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc.getNameOrOID());
- throw new ConfigException(message);
+ throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc));
}
// This is fine. The active value set can be empty.
activeValues = new ArrayList<>(0);
@@ -783,9 +774,7 @@
if (numValues > 1 && ! isMultiValued())
{
// This is illegal -- the attribute is single-valued.
- LocalizableMessage message =
- ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc.getNameOrOID());
- throw new ConfigException(message);
+ throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc));
}
activeValues = new ArrayList<>(numValues);
@@ -795,7 +784,7 @@
if (! allowedValues.contains(lowerValue))
{
// This is illegal -- the value is not allowed.
- throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(v, attrDesc.getNameOrOID()));
+ throw new ConfigException(ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(v, attrDesc));
}
activeValues.add(v.toString());
--
Gitblit v1.10.0