From 33f99d27d8acad1248de8417df9c443982da1d25 Mon Sep 17 00:00:00 2001
From: Chris Ridd <chris.ridd@forgerock.com>
Date: Wed, 06 Mar 2013 16:49:21 +0000
Subject: [PATCH] Fix OPENDJ-797 Custom Password policy did not survive upgrade to 2.5.0-Xpress1

---
 opends/src/server/org/opends/server/admin/client/ldap/LDAPDriver.java |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/client/ldap/LDAPDriver.java b/opends/src/server/org/opends/server/admin/client/ldap/LDAPDriver.java
index c979a74..4adebb5 100644
--- a/opends/src/server/org/opends/server/admin/client/ldap/LDAPDriver.java
+++ b/opends/src/server/org/opends/server/admin/client/ldap/LDAPDriver.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2008-2009 Sun Microsystems, Inc.
+ *      Portions Copyright 2013 ForgeRock, AS.
  */
 package org.opends.server.admin.client.ldap;
 
@@ -634,14 +635,6 @@
       activeValues.add(value);
     }
 
-    if (activeValues.isEmpty() && pd.hasOption(PropertyOption.MANDATORY)) {
-      // The active values maybe empty because of a previous
-      // exception.
-      if (exception == null) {
-        exception = new PropertyIsMandatoryException(pd);
-      }
-    }
-
     // Get the property's default values.
     Collection<PD> defaultValues;
     try {
@@ -652,6 +645,16 @@
     }
 
     newProperties.addProperty(pd, defaultValues, activeValues);
+
+    if (activeValues.isEmpty() && defaultValues.isEmpty()
+        && pd.hasOption(PropertyOption.MANDATORY)) {
+      // The active values maybe empty because of a previous
+      // exception.
+      if (exception == null) {
+        exception = new PropertyIsMandatoryException(pd);
+      }
+    }
+
     if (exception != null) {
       throw exception;
     }

--
Gitblit v1.10.0