diff --git a/plugins/git4idea/src/git4idea/history/GitLogRecord.java b/plugins/git4idea/src/git4idea/history/GitLogRecord.java index 2cd081261c52..dace4a7e0557 100644 --- a/plugins/git4idea/src/git4idea/history/GitLogRecord.java +++ b/plugins/git4idea/src/git4idea/history/GitLogRecord.java @@ -48,9 +48,9 @@ class GitLogRecord { private static final Logger LOG = Logger.getInstance(GitLogRecord.class); private static final String UTF_8 = "UTF-8"; - private final Map myOptions; - private final List myPaths; - private final List myStatusInfo; + @NotNull private final Map myOptions; + @NotNull private final List myPaths; + @NotNull private final List myStatusInfo; private final boolean mySupportsRawBody; private GitHandler myHandler; @@ -65,6 +65,7 @@ class GitLogRecord { mySupportsRawBody = supportsRawBody; } + @NotNull private List getPaths() { return myPaths; } @@ -75,7 +76,7 @@ class GitLogRecord { } @NotNull - public List getFilePaths(VirtualFile root) throws VcsException { + public List getFilePaths(@NotNull VirtualFile root) throws VcsException { List res = new ArrayList(); String prefix = root.getPath() + "/"; for (String strPath : getPaths()) { @@ -97,42 +98,52 @@ class GitLogRecord { } // trivial access methods + @NotNull String getHash() { return lookup(HASH); } + @NotNull String getAuthorName() { return decode(lookup(AUTHOR_NAME)); } + @NotNull String getAuthorEmail() { return lookup(AUTHOR_EMAIL); } + @NotNull String getCommitterName() { return decode(lookup(COMMITTER_NAME)); } + @NotNull String getCommitterEmail() { return lookup(COMMITTER_EMAIL); } + @NotNull String getSubject() { return decode(lookup(SUBJECT)); } + @NotNull String getBody() { return decode(lookup(BODY)); } + @NotNull String getRawBody() { return decode(lookup(RAW_BODY)); } + @NotNull String getEncoding() { return lookup(ENCODING); } + @NotNull String getShortenedRefLog() { return lookup(SHORT_REF_LOG_SELECTOR); } @@ -188,12 +199,14 @@ class GitLogRecord { return ((getSubject() + "\n\n" + getBody()).trim()); } + @NotNull String[] getParentsHashes() { final String parents = lookup(PARENTS); if (parents.trim().length() == 0) return ArrayUtil.EMPTY_STRING_ARRAY; return parents.split(" "); } + @NotNull public Collection getRefs() { final String decorate = myOptions.get(REF_NAMES); return parseRefNames(decorate); @@ -260,7 +273,8 @@ class GitLogRecord { return new String(raw); } - public List parseChanges(Project project, VirtualFile vcsRoot) throws VcsException { + @NotNull + public List parseChanges(@NotNull Project project, @NotNull VirtualFile vcsRoot) throws VcsException { return GitChangesParser.parse(project, vcsRoot, myStatusInfo, getHash(), getDate(), Arrays.asList(getParentsHashes())); }