[errorprone] fix ReturnValueIgnored in PushCertificateStore#next

Change-Id: I8deb7fa702bb973436b7ca21edf3634a087047b7
This commit is contained in:
Matthias Sohn 2021-09-12 20:17:47 +02:00
parent f3eff2308f
commit 9ba3a521aa
1 changed files with 3 additions and 4 deletions

View File

@ -159,7 +159,7 @@ public PushCertificate get(String refName) throws IOException {
* 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 boolean hasNext() {
@Override
public PushCertificate next() {
hasNext();
PushCertificate n = next;
if (n == null) {
if (!hasNext()) {
throw new NoSuchElementException();
}
PushCertificate n = next;
next = null;
return n;
}