GitLogRecord: shortBuffer is unnecessary since Java 7u6

GitOrigin-RevId: 161497515e65e21a3e508cbe644cc34de7142f60
This commit is contained in:
Tagir Valeev
2019-11-24 04:10:39 +00:00
committed by intellij-monorepo-bot
parent 25dc0f385c
commit 5115a4f13f
@@ -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<String> 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)}.
*/