From 88cdfff756887b6d8d1cedc3bb6d5db82ecdac48 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 03 Feb 2014 15:46:52 +0000
Subject: [PATCH] Factorized a lot of String joining code into Utils.joinAsString().
---
opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java | 50 +++-----------------------------------------------
1 files changed, 3 insertions(+), 47 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java b/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java
index 7c08fbb..c2a344a 100644
--- a/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java
+++ b/opendj3-server-dev/src/server/org/opends/server/util/StaticUtils.java
@@ -43,17 +43,17 @@
import javax.naming.NamingException;
import javax.naming.ldap.InitialLdapContext;
-import org.forgerock.util.Reject;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.forgerock.i18n.LocalizableMessageDescriptor;
+import org.forgerock.i18n.slf4j.LocalizedLogger;
+import org.forgerock.opendj.ldap.ByteSequence;
+import org.forgerock.util.Reject;
import org.opends.messages.ToolMessages;
import org.opends.server.api.ClientConnection;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.ServerContext;
-import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.opends.server.types.*;
-import org.forgerock.opendj.ldap.ByteSequence;
import org.opends.server.util.args.Argument;
import org.opends.server.util.args.ArgumentException;
@@ -3378,50 +3378,6 @@
}
/**
- * Creates a string representation of the elements in the
- * <code>list</code> separated by <code>separator</code>.
- *
- * @param list the list to print
- * @param separator to use between elements
- *
- * @return String representing the list
- */
- static public String listToString(List<?> list, String separator)
- {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < list.size(); i++) {
- sb.append(list.get(i));
- if (i < list.size() - 1) {
- sb.append(separator);
- }
- }
- return sb.toString();
- }
-
- /**
- * Creates a string representation of the elements in the
- * <code>collection</code> separated by <code>separator</code>.
- *
- * @param collection to print
- * @param separator to use between elements
- *
- * @return String representing the collection
- */
- static public String collectionToString(Collection<?> collection,
- String separator)
- {
- StringBuilder sb = new StringBuilder();
- for (Iterator<?> iter = collection.iterator(); iter.hasNext();) {
- sb.append(iter.next());
- if (iter.hasNext()) {
- sb.append(separator);
- }
- }
- return sb.toString();
- }
-
-
- /**
* Retrieves an array list containing the contents of the provided array.
*
* @param stringArray The string array to convert to an array list.
--
Gitblit v1.10.0