From 5115a4f13f18bc6fa6d1090baaf24189ffb430c8 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Sun, 24 Nov 2019 09:14:03 +0700 Subject: [PATCH] GitLogRecord: shortBuffer is unnecessary since Java 7u6 GitOrigin-RevId: 161497515e65e21a3e508cbe644cc34de7142f60 --- .../git4idea/src/git4idea/history/GitLogRecord.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/git4idea/src/git4idea/history/GitLogRecord.java b/plugins/git4idea/src/git4idea/history/GitLogRecord.java index 26c490ab16b9..8bb1499746b8 100644 --- a/plugins/git4idea/src/git4idea/history/GitLogRecord.java +++ b/plugins/git4idea/src/git4idea/history/GitLogRecord.java @@ -42,7 +42,7 @@ class GitLogRecord { LOG.error("Missing value for option " + key + ", while executing " + myHandler); return ""; } - return shortBuffer(value); + return value; } // trivial access methods @@ -164,21 +164,17 @@ class GitLogRecord { final String POINTER = " -> "; // HEAD -> refs/heads/master in Git 2.4.3+ if (item.contains(POINTER)) { List parts = StringUtil.split(item, POINTER); - result.addAll(ContainerUtil.map(parts, s -> shortBuffer(s.trim()))); + result.addAll(ContainerUtil.map(parts, String::trim)); } else { int colon = item.indexOf(':'); // tags have the "tag:" prefix. - result.add(shortBuffer(colon > 0 ? item.substring(colon + 1).trim() : item)); + String raw = colon > 0 ? item.substring(colon + 1).trim() : item; + result.add(raw); } } return result; } - @NotNull - private static String shortBuffer(@NotNull String raw) { - return new String(raw); - } - /** * for debugging purposes - see {@link GitUtil#parseTimestampWithNFEReport(String, git4idea.commands.GitHandler, String)}. */