updated to use corrected joinList function.

This commit is contained in:
okamosy 2011-08-23 22:58:19 +01:00
parent c374f474ed
commit 1a2fc307fd
5 changed files with 20 additions and 33 deletions

View file

@ -11,7 +11,6 @@ import java.net.URL;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Enumeration;
import java.util.GregorianCalendar;
@ -470,22 +469,34 @@ public class Util
}
public static String joinList(Object... list)
{
return joinList(", ", list);
}
public static String joinList(String seperator, Object... list)
{
StringBuilder buf = new StringBuilder();
for (Object each : list)
{
if (buf.length() > 0)
{
buf.append(", ");
buf.append(seperator);
}
if(each instanceof List)
{
buf.append(joinList(((List)each).toArray()));
buf.append(joinList(seperator, ((List)each).toArray()));
}
else
{
buf.append(each.toString());
try
{
buf.append(each.toString());
}
catch (Exception e)
{
buf.append(each.toString());
}
}
}
return buf.toString();