From: David Pursehouse Date: Thu, 18 Jan 2018 01:45:07 +0000 (+0900) Subject: RevWalk: Annotate methods documented to return "Never null" as @NonNull X-Git-Tag: v4.11.0.201803080745-r~147 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F115576%2F1;p=jgit.git RevWalk: Annotate methods documented to return "Never null" as @NonNull Change-Id: If1a1bed4b04dd48c9573fd3c4eacbf73de40622f Signed-off-by: David Pursehouse --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java index 5568241b67..91c15a1e70 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java @@ -53,6 +53,7 @@ import java.util.EnumSet; import java.util.Iterator; import java.util.List; +import org.eclipse.jgit.annotations.NonNull; import org.eclipse.jgit.errors.CorruptObjectException; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.LargeObjectException; @@ -513,6 +514,7 @@ public class RevWalk implements Iterable, AutoCloseable { * * @return the current filter. Never null as a filter is always needed. */ + @NonNull public RevFilter getRevFilter() { return filter; } @@ -552,6 +554,7 @@ public class RevWalk implements Iterable, AutoCloseable { * {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} is * returned. */ + @NonNull public TreeFilter getTreeFilter() { return treeFilter; } @@ -649,6 +652,7 @@ public class RevWalk implements Iterable, AutoCloseable { * name of the blob object. * @return reference to the blob object. Never null. */ + @NonNull public RevBlob lookupBlob(final AnyObjectId id) { RevBlob c = (RevBlob) objects.get(id); if (c == null) { @@ -668,6 +672,7 @@ public class RevWalk implements Iterable, AutoCloseable { * name of the tree object. * @return reference to the tree object. Never null. */ + @NonNull public RevTree lookupTree(final AnyObjectId id) { RevTree c = (RevTree) objects.get(id); if (c == null) { @@ -690,6 +695,7 @@ public class RevWalk implements Iterable, AutoCloseable { * name of the commit object. * @return reference to the commit object. Never null. */ + @NonNull public RevCommit lookupCommit(final AnyObjectId id) { RevCommit c = (RevCommit) objects.get(id); if (c == null) { @@ -709,6 +715,7 @@ public class RevWalk implements Iterable, AutoCloseable { * name of the tag object. * @return reference to the tag object. Never null. */ + @NonNull public RevTag lookupTag(final AnyObjectId id) { RevTag c = (RevTag) objects.get(id); if (c == null) { @@ -730,6 +737,7 @@ public class RevWalk implements Iterable, AutoCloseable { * type of the object. Must be a valid Git object type. * @return reference to the object. Never null. */ + @NonNull public RevObject lookupAny(final AnyObjectId id, final int type) { RevObject r = objects.get(id); if (r == null) { @@ -784,6 +792,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ + @NonNull public RevCommit parseCommit(final AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { @@ -811,6 +820,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ + @NonNull public RevTree parseTree(final AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { @@ -845,6 +855,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ + @NonNull public RevTag parseTag(final AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { RevObject c = parseAny(id); @@ -870,6 +881,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ + @NonNull public RevObject parseAny(final AnyObjectId id) throws MissingObjectException, IOException { RevObject r = objects.get(id);