From e8e29cb9380a58d0f3b1e6608f89fed6bfbbfc5c Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 21 Sep 2015 12:42:50 +0200 Subject: [PATCH] Fixed StringSet.toString to use comma as separator. --- src/fr/devinsy/util/strings/StringSet.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fr/devinsy/util/strings/StringSet.java b/src/fr/devinsy/util/strings/StringSet.java index 4d12790..d4e10b5 100644 --- a/src/fr/devinsy/util/strings/StringSet.java +++ b/src/fr/devinsy/util/strings/StringSet.java @@ -190,7 +190,14 @@ public class StringSet extends HashSet { StringSet result; - String merge = this.toString(); + StringBuffer buffer = new StringBuffer(length()); + + for (String string : this) + { + buffer.append(string); + } + + String merge = buffer.toString(); clear(); add(merge); @@ -382,14 +389,7 @@ public class StringSet extends HashSet { String result; - StringBuffer buffer = new StringBuffer(length()); - - for (String string : this) - { - buffer.append(string); - } - - result = buffer.toString(); + result = toStringList().toStringWithCommas(); // return result;