From 3d2247dc6913a8ab1fd570e6db4c38a3f6460039 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 29 Jan 2015 10:33:47 +0000
Subject: [PATCH] AutoRefactor'ed code cleanups

---
 opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
index c5f0c30..436545e 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
@@ -135,14 +135,14 @@
             final Object value = principals.get(key);
             if (isJSONPrimitive(value)) {
                 values[i] = String.valueOf(value);
-            } else if (value == null) {
-                throw new ForbiddenException(i18n(
-                        "The request could not be authorized because the required "
-                                + "security principal '%s' could not be determined", key));
-            } else {
+            } else if (value != null) {
                 throw new ForbiddenException(i18n(
                         "The request could not be authorized because the required "
                                 + "security principal '%s' had an invalid data type", key));
+            } else {
+                throw new ForbiddenException(i18n(
+                        "The request could not be authorized because the required "
+                                + "security principal '%s' could not be determined", key));
             }
         }
         return values;

--
Gitblit v1.10.0