diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2021-09-12 20:17:47 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-09-29 17:13:02 +0200 |
commit | 9ba3a521aa96502ba7411408d3ecf5958a90f34d (patch) | |
tree | b997ccfefd33adc0784764dc3c56c5c4499d4b25 /org.eclipse.jgit | |
parent | f3eff2308f4a128029e65a46de2ba2a5533cdc6b (diff) | |
download | jgit-9ba3a521aa96502ba7411408d3ecf5958a90f34d.tar.gz jgit-9ba3a521aa96502ba7411408d3ecf5958a90f34d.zip |
[errorprone] fix ReturnValueIgnored in PushCertificateStore#next
Change-Id: I8deb7fa702bb973436b7ca21edf3634a087047b7
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java index 5634ac0843..a9e93b6be6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java @@ -159,7 +159,7 @@ public class PushCertificateStore implements AutoCloseable { * close resources. */ public Iterable<PushCertificate> getAll(String refName) { - return () -> new Iterator<PushCertificate>() { + return () -> new Iterator<>() { private final String path = pathName(refName); private PushCertificate next; @@ -219,11 +219,10 @@ public class PushCertificateStore implements AutoCloseable { @Override public PushCertificate next() { - hasNext(); - PushCertificate n = next; - if (n == null) { + if (!hasNext()) { throw new NoSuchElementException(); } + PushCertificate n = next; next = null; return n; } |