From ca669ae54f86dbeea277280690584d9f591c7571 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 18 Feb 2015 07:26:26 +0000
Subject: [PATCH] AutoRefactor: collapse if statements
---
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java | 40 +++++++++++++++++++---------------------
1 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
index b89d0f7..f1e5a94 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2014 ForgeRock AS
+ * Portions Copyright 2011-2015 ForgeRock AS
* Portions Copyright 2013 Manuel Gaupp
*/
package org.opends.server.authorization.dseecompat;
@@ -751,31 +751,29 @@
// type are being replaced or deleted. If only a subset is being
// deleted than this access check is skipped.
ModificationType modType = m.getModificationType();
- if ((modType == ModificationType.DELETE && modAttr.isEmpty())
- || modType == ModificationType.REPLACE
- || modType == ModificationType.INCREMENT)
+ if (((modType == ModificationType.DELETE && modAttr.isEmpty())
+ || modType == ModificationType.REPLACE
+ || modType == ModificationType.INCREMENT)
+ /*
+ * Check if we have rights to delete all values of an attribute
+ * type in the resource entry.
+ */
+ && resourceEntry.hasAttribute(modAttrType))
{
- /*
- * Check if we have rights to delete all values of an attribute
- * type in the resource entry.
- */
- if (resourceEntry.hasAttribute(modAttrType))
+ container.setCurrentAttributeType(modAttrType);
+ List<Attribute> attrList =
+ resourceEntry.getAttribute(modAttrType, modAttr.getOptions());
+ if (attrList != null)
{
- container.setCurrentAttributeType(modAttrType);
- List<Attribute> attrList =
- resourceEntry.getAttribute(modAttrType, modAttr.getOptions());
- if (attrList != null)
+ for (Attribute a : attrList)
{
- for (Attribute a : attrList)
+ for (ByteString v : a)
{
- for (ByteString v : a)
+ container.setCurrentAttributeValue(v);
+ container.setRights(ACI_WRITE_DELETE);
+ if (!skipAccessCheck && !accessAllowed(container))
{
- container.setCurrentAttributeValue(v);
- container.setRights(ACI_WRITE_DELETE);
- if (!skipAccessCheck && !accessAllowed(container))
- {
- return false;
- }
+ return false;
}
}
}
--
Gitblit v1.10.0