| | |
| | | public static String getStringFromCollection(Collection<String> col, |
| | | String separator) |
| | | { |
| | | String msg = null; |
| | | StringBuffer msg = new StringBuffer(); |
| | | for (String m : col) |
| | | { |
| | | if (msg == null) |
| | | |
| | | if (msg.length() > 0) |
| | | { |
| | | msg = m; |
| | | } else |
| | | { |
| | | msg += separator + m; |
| | | msg.append(separator); |
| | | } |
| | | msg.append(m); |
| | | } |
| | | return msg; |
| | | return msg.toString(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param te the exception. |
| | | * @return a localized representation of the provide TopologyCacheException. |
| | | */ |
| | | public static String getStringRepresentation(TopologyCacheException te) |
| | | public static Message getMessage(TopologyCacheException te) |
| | | { |
| | | MessageBuilder buf = new MessageBuilder(); |
| | | |
| | |
| | | // This is unexpected. |
| | | buf.append(getThrowableMsg(INFO_BUG_MSG.get(), te.getCause())); |
| | | } |
| | | return buf.toString(); |
| | | return buf.toMessage(); |
| | | } |
| | | |
| | | /** |