]> source.dussan.org Git - jgit.git/commitdiff
BlameGenerator: Annotate #getRenameDetector as Nullable 23/89923/5
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 31 Jan 2017 05:52:52 +0000 (14:52 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 9 Feb 2017 21:40:56 +0000 (22:40 +0100)
The renameDetector member returned by this method will be null when
following file renames has been disabled by previously calling:

  setFollowFileRenames(false).

Annotate it as @Nullable and update the Javadoc to explicitly
document the null return.

Change-Id: I9bdf443a64cf3c45352d3ab023051a2e11f7426d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java

index fa6fe75e644d3daf30bb6efaf550e60c58efb63f..4ad58c38506f93065b719125b913bf61e440a90e 100644 (file)
@@ -51,6 +51,7 @@ import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
 
+import org.eclipse.jgit.annotations.Nullable;
 import org.eclipse.jgit.blame.Candidate.BlobCandidate;
 import org.eclipse.jgit.blame.Candidate.ReverseCandidate;
 import org.eclipse.jgit.blame.ReverseWalk.ReverseCommit;
@@ -238,11 +239,13 @@ public class BlameGenerator implements AutoCloseable {
        }
 
        /**
-        * Obtain the RenameDetector if {@code setFollowFileRenames(true)}.
+        * Obtain the RenameDetector, allowing the application to configure its
+        * settings for rename score and breaking behavior.
         *
-        * @return the rename detector, allowing the application to configure its
-        *         settings for rename score and breaking behavior.
+        * @return the rename detector, or {@code null} if
+        *         {@code setFollowFileRenames(false)}.
         */
+       @Nullable
        public RenameDetector getRenameDetector() {
                return renameDetector;
        }