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/quicksetup/org/opends/quicksetup/util/Utils.java | 40 ++--------------------------------------
1 files changed, 2 insertions(+), 38 deletions(-)
diff --git a/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java
index e405c65..9c4fcd2 100644
--- a/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -26,6 +26,7 @@
*/
package org.opends.quicksetup.util;
+import static org.forgerock.util.Utils.*;
import static org.opends.messages.QuickSetupMessages.*;
import static org.opends.server.util.DynamicConstants.SHORT_NAME;
@@ -603,32 +604,6 @@
}
/**
- * This is a helper method that gets a String representation of the elements
- * in the Collection. The String will display the different elements separated
- * by the separator String.
- *
- * @param col
- * the collection containing the String.
- * @param separator
- * the separator String to be used.
- * @return the String representation for the collection.
- */
- public static String getStringFromCollection(Collection<String> col,
- String separator)
- {
- StringBuilder msg = new StringBuilder();
- for (String m : col)
- {
- if (msg.length() > 0)
- {
- msg.append(separator);
- }
- msg.append(m);
- }
- return msg.toString();
- }
-
- /**
* This is a helper method that gets a LocalizableMessage representation of the elements
* in the Collection of Messages. The LocalizableMessage will display the different
* elements separated by the separator String.
@@ -1273,17 +1248,6 @@
* elements in the <code>list</code> separated by <code>separator</code>.
* @param list the list to print
* @param separator to use in separating elements
- * @return String representing the list
- */
- static public String listToString(List<?> list, String separator) {
- return listToString(list, separator, null, null);
- }
-
- /**
- * Creates a string consisting of the 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 in separating elements
* @param prefix prepended to each individual element in the list before
* adding to the returned string.
* @param suffix appended to each individual element in the list before
@@ -1805,7 +1769,7 @@
else if (options.getBaseDns().size() > 1)
{
msg = INFO_REVIEW_CREATE_SUFFIX.get(
- Utils.listToString(options.getBaseDns(), Constants.LINE_SEPARATOR),
+ joinAsString(Constants.LINE_SEPARATOR, options.getBaseDns()),
arg2);
}
else
--
Gitblit v1.10.0