From 5cd7bdbbda0fa9f1aa6e12d9171c3811b73feb07 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 09 Jul 2015 14:01:31 +0000
Subject: [PATCH] Code cleanup
---
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java | 39 ++++++++++++---------------------------
1 files changed, 12 insertions(+), 27 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java
index 2e6eaa8..526a89a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java
@@ -26,11 +26,14 @@
*/
package org.opends.server.authorization.dseecompat;
-import java.util.List;
+import static org.opends.messages.AccessControlMessages.*;
+import static org.opends.server.util.CollectionUtils.*;
+
import java.util.ArrayList;
-import java.util.TreeMap;
-import java.util.Set;
import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeMap;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
@@ -41,8 +44,6 @@
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.*;
-import static org.opends.messages.AccessControlMessages.*;
-
/**
* This class is used to match RDN patterns containing wildcards in either
* the attribute types or the attribute values.
@@ -53,19 +54,10 @@
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
- /**
- * Indicate whether the RDN contains a wildcard in any of its attribute
- * types.
- */
+ /** Indicate whether the RDN contains a wildcard in any of its attribute types. */
private boolean hasTypeWildcard;
-
-
- /**
- * The set of attribute type patterns.
- */
+ /** The set of attribute type patterns. */
private String[] typePatterns;
-
-
/**
* The set of attribute value patterns.
* The value pattern is split into a list according to the positions of any
@@ -75,11 +67,7 @@
* of three elements "", A and "".
*/
private ArrayList<ArrayList<ByteString>> valuePatterns;
-
-
- /**
- * The number of attribute-value pairs in this RDN pattern.
- */
+ /** The number of attribute-value pairs in this RDN pattern. */
private int numValues;
@@ -90,8 +78,7 @@
* @param dnString The DN pattern containing the attribute-value pair.
* @throws DirectoryException If the attribute-value pair is not valid.
*/
- public PatternRDN(String type, ArrayList<ByteString> valuePattern,
- String dnString)
+ public PatternRDN(String type, ArrayList<ByteString> valuePattern, String dnString)
throws DirectoryException
{
// Only Whole-Type wildcards permitted.
@@ -109,8 +96,7 @@
numValues = 1;
typePatterns = new String[] { type };
- valuePatterns = new ArrayList<>(1);
- valuePatterns.add(valuePattern);
+ valuePatterns = newArrayList(valuePattern);
}
@@ -133,8 +119,7 @@
{
LocalizableMessage message =
WARN_PATTERN_DN_TYPE_WILDCARD_IN_MULTIVALUED_RDN.get(dnString);
- throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
- message);
+ throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX, message);
}
numValues++;
--
Gitblit v1.10.0