From 67431e1745fab88eff5ce83b044c6fc1cb86c1b4 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 9 Mar 2016 10:32:46 +0000 Subject: [PATCH] Refactor --- source/net/filebot/Settings.java | 8 ++------ source/net/filebot/WebServices.java | 3 +-- source/net/filebot/util/StringUtilities.java | 4 ---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/source/net/filebot/Settings.java b/source/net/filebot/Settings.java index 55259273..f6dc7bdc 100644 --- a/source/net/filebot/Settings.java +++ b/source/net/filebot/Settings.java @@ -1,7 +1,6 @@ package net.filebot; import static net.filebot.util.FileUtilities.*; -import static net.filebot.util.StringUtilities.*; import java.awt.GraphicsEnvironment; import java.io.File; @@ -297,14 +296,11 @@ public final class Settings { } public static String getApplicationIdentifier() { - return join(" ", getApplicationName(), getApplicationVersion(), String.format("(r%s)", getApplicationRevisionNumber())); + return String.format("%s %s (r%d)", getApplicationName(), getApplicationVersion(), getApplicationRevisionNumber()); } public static String getJavaRuntimeIdentifier() { - String name = System.getProperty("java.runtime.name"); - String version = System.getProperty("java.version"); - String headless = GraphicsEnvironment.isHeadless() ? "(headless)" : null; - return join(" ", name, version, headless); + return String.format("%s %s %s", System.getProperty("java.runtime.name"), System.getProperty("java.version"), GraphicsEnvironment.isHeadless() ? "(headless)" : "").trim(); } private static String[] applicationArgumentArray; diff --git a/source/net/filebot/WebServices.java b/source/net/filebot/WebServices.java index a407077a..897867bf 100644 --- a/source/net/filebot/WebServices.java +++ b/source/net/filebot/WebServices.java @@ -6,7 +6,6 @@ import static java.util.stream.Collectors.*; import static net.filebot.Settings.*; import static net.filebot.media.MediaDetection.*; import static net.filebot.util.FileUtilities.*; -import static net.filebot.util.StringUtilities.*; import java.util.Collection; import java.util.List; @@ -255,7 +254,7 @@ public final class WebServices { if (LOGIN_OPENSUBTITLES.equals(id)) { String password_md5 = md5(password); OpenSubtitles.setUser(user, password_md5); - Settings.forPackage(WebServices.class).put(id, join(LOGIN_SEPARATOR, user, password_md5)); + Settings.forPackage(WebServices.class).put(id, user + LOGIN_SEPARATOR + password_md5); } else { throw new IllegalArgumentException(); } diff --git a/source/net/filebot/util/StringUtilities.java b/source/net/filebot/util/StringUtilities.java index 35cdb87a..7a943301 100644 --- a/source/net/filebot/util/StringUtilities.java +++ b/source/net/filebot/util/StringUtilities.java @@ -78,10 +78,6 @@ public final class StringUtilities { return join(values.stream(), delimiter, "", ""); } - public static String join(CharSequence delimiter, Object... values) { - return join(stream(values), delimiter, "", ""); - } - public static String join(Object[] values, CharSequence delimiter) { return join(stream(values), delimiter, "", ""); }