SubmoduleWalk is auto-closeable, and Eclipse warns that is is not
managed by try-with-resource. However in this case the resource should
not be closed, because the caller needs to use it. Instead, it is the
responsibility of the caller to close it after use.
Update the Javadoc to clarify this, and suppress the warning.
Change-Id: Ib7ba349353bfd3341bdcbe4bb19abaeb9f3aeba5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
*
* @param repository
* a {@link org.eclipse.jgit.lib.Repository} object.
- * @return generator over submodule index entries
+ * @return generator over submodule index entries. The caller is responsible
+ * for calling {@link #close()}.
* @throws java.io.IOException
*/
public static SubmoduleWalk forIndex(Repository repository)
throws IOException {
+ @SuppressWarnings("resource") // The caller closes it
SubmoduleWalk generator = new SubmoduleWalk(repository);
try {
DirCache index = repository.readDirCache();