diff options
author | Alexander Kurtakov | 2017-09-09 08:43:54 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-09-09 08:43:54 +0000 |
commit | e68d8740242fc3d667d6108ff939fa371e427692 (patch) | |
tree | 9278ba0a17e08f9585f2b1aebe625f5555eb71a9 /org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util | |
parent | 036789af5311c1c0a09543a958f3538030ab6612 (diff) | |
download | eclipse.platform.ua-e68d8740242fc3d667d6108ff939fa371e427692.tar.gz eclipse.platform.ua-e68d8740242fc3d667d6108ff939fa371e427692.tar.xz eclipse.platform.ua-e68d8740242fc3d667d6108ff939fa371e427692.zip |
Bug 522083 - Simplify StringUtils classes
No need for multiple concat methods - just use varargs.
No need for split method - pre 1.4 JVM is not supported now.
Change-Id: I1c1e349746d7c817933c1451393b8abfd67ba37a
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util')
-rw-r--r-- | org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/StringUtil.java | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/StringUtil.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/StringUtil.java index 3b57ab79a..77eccf017 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/StringUtil.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/StringUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,40 +10,13 @@ *******************************************************************************/ package org.eclipse.ui.internal.intro.universal.util; - - public class StringUtil { - public static StringBuffer concat(String string1, String string2, - String string3) { - StringBuffer buffer = new StringBuffer(string1); - buffer.append(string2); - buffer.append(string3); - return buffer; - } - - public static StringBuffer concat(String string1, String string2, - String string3, String string4) { - StringBuffer buffer = concat(string1, string2, string3); - buffer.append(string4); - return buffer; - } - - public static StringBuffer concat(String string1, String string2, - String string3, String string4, String string5) { - StringBuffer buffer = concat(string1, string2, string3, string4); - buffer.append(string5); - return buffer; + public static StringBuffer concat(String... strings) { + StringBuffer buffer = new StringBuffer(); + for (String string : strings) { + buffer.append(string); + } + return buffer; } - - public static StringBuffer concat(String string1, String string2, - String string3, String string4, String string5, String string6) { - StringBuffer buffer = concat(string1, string2, string3, string4, - string5); - buffer.append(string6); - return buffer; - } - - - } |