From 7e0c80a2f118a7fcdaa24ab0718ffe2da3655c21 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Tue, 11 Nov 2014 13:49:07 +0300 Subject: [PATCH] style --- .../org/zmlx/hg4idea/log/HgBaseLogParser.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgBaseLogParser.java b/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgBaseLogParser.java index 568e1165063e..54ff0d7f7831 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgBaseLogParser.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/log/HgBaseLogParser.java @@ -138,25 +138,20 @@ public abstract class HgBaseLogParser implements Function fileTypes = ContainerUtil.newArrayList("{file_adds}", "{file_mods}", "{file_dels}", "{file_copies}"); - if (currentVersion.isBuiltInFunctionSupported()) { - templates.addAll(ContainerUtil.map(fileTypes, new Function() { - @Override - public String fun(String s) { - return wrapInJoin(s); - } - })); - } - else { - templates.addAll(fileTypes); - } + List fileTemplates = ContainerUtil.newArrayList("file_adds", "file_mods", "file_dels", "file_copies"); + templates.addAll(wrapIn(fileTemplates, currentVersion)); return ArrayUtil.toStringArray(templates); } @NotNull - private static String wrapInJoin(@NotNull String filesType) { - int len = filesType.length(); - return "{join(" + filesType.substring(1, len - 1) + ",'" + HgChangesetUtil.FILE_SEPARATOR + "')}"; + private static List wrapIn(@NotNull List fileTemplates, @NotNull HgVersion currentVersion) { + final boolean supported = currentVersion.isBuiltInFunctionSupported(); + return ContainerUtil.map(fileTemplates, new Function() { + @Override + public String fun(String s) { + return supported ? "{join(" + s + ",'" + HgChangesetUtil.FILE_SEPARATOR + "')}" : "{" + s + "}"; + } + }); } @NotNull