diff options
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r-- | app/src/main/java/com/wireguard/config/Attribute.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/src/main/java/com/wireguard/config/Attribute.java b/app/src/main/java/com/wireguard/config/Attribute.java index 375acc42..1e9e25f0 100644 --- a/app/src/main/java/com/wireguard/config/Attribute.java +++ b/app/src/main/java/com/wireguard/config/Attribute.java @@ -5,8 +5,7 @@ package com.wireguard.config; -import android.text.TextUtils; - +import java.util.Iterator; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -25,7 +24,17 @@ public final class Attribute { } public static String join(final Iterable<?> values) { - return TextUtils.join(", ", values); + final Iterator<?> it = values.iterator(); + if (!it.hasNext()) { + return ""; + } + final StringBuilder sb = new StringBuilder(); + sb.append(it.next()); + while (it.hasNext()) { + sb.append(", "); + sb.append(it.next()); + } + return sb.toString(); } public static Optional<Attribute> parse(final CharSequence line) { |