Source:
<code>public void run() { ILogData logData = null; do { try { Thread.currentThread().setName(namespace + listener.toString()); logData = txnStream.nextUpTo(Address.MAX); if (logData == null) { break; } MultiObjectSMREntry multiObjSMREntry = (MultiObjectSMREntry) logData.getPayload(runtime); long epoch = logData.getEpoch(); Map<TableSchema, List<CorfuStreamEntry>> entries = new HashMap<>(); logData.getStreams().stream().filter(tablesOfInterest::containsKey) .forEach(streamId -> entries.put(tablesOfInterest.get(streamId), multiObjSMREntry.getSMRUpdates(streamId).stream().map(smrEntry -> CorfuStreamEntry.fromSMREntry(smrEntry, epoch, tablesOfInterest.get(streamId).getKeyClass(), tablesOfInterest.get(streamId).getPayloadClass(), tablesOfInterest.get(streamId).getMetadataClass()) ).collect(Collectors.toList()))); if (!entries.isEmpty()) { CorfuStreamEntries callbackResult = new CorfuStreamEntries(entries); log.debug("{}::onNext with updates", listener.toString(), entries.size()); long onNextStart = System.nanoTime(); listener.onNext(callbackResult); long onNextEnd = System.nanoTime(); if (TimeUnit.NANOSECONDS.toSeconds(onNextEnd - onNextStart) > 0) { log.debug("{}::onNext took {}s", listener.toString(), TimeUnit.NANOSECONDS.toSeconds(onNextEnd - onNextStart)); } } } catch (Throwable throwable) { log.warn("{}::onError: {}", listener.toString(), throwable.toString()); listener.onError(throwable); streamManager.unsubscribe(listener); <START> break; <END> } } while (logData != null); }</code><technical_language>This check is need, if logData is null, break out of loop in line 201</technical_language>

Target:
public void run() { while (!isShutdown.get()) { try { Thread.currentThread().setName(namespace + listener.toString()); ILogData logData = txnStream.nextUpTo(Address.MAX); if (logData == null) { break; } MultiObjectSMREntry multiObjSMREntry = (MultiObjectSMREntry) logData.getPayload(runtime); long epoch = logData.getEpoch(); Map<TableSchema, List<CorfuStreamEntry>> entries = new HashMap<>(); logData.getStreams().stream().filter(tablesOfInterest::containsKey) .forEach(streamId -> entries.put(tablesOfInterest.get(streamId), multiObjSMREntry.getSMRUpdates(streamId).stream().map(smrEntry -> CorfuStreamEntry.fromSMREntry(smrEntry, epoch, tablesOfInterest.get(streamId).getKeyClass(), tablesOfInterest.get(streamId).getPayloadClass(), tablesOfInterest.get(streamId).getMetadataClass()) ).collect(Collectors.toList()))); if (!entries.isEmpty()) { CorfuStreamEntries callbackResult = new CorfuStreamEntries(entries); log.trace("{}::onNext with updates", listener.toString(), entries.size()); long onNextStart = System.nanoTime(); listener.onNext(callbackResult); long onNextEnd = System.nanoTime(); if (TimeUnit.NANOSECONDS.toSeconds(onNextEnd - onNextStart) >= StreamManager.DEFAULT_LONG_RUNNING_TIME_SECS) { log.info("{}::onNext took {}s", listener.toString(), TimeUnit.NANOSECONDS.toSeconds(onNextEnd - onNextStart)); } } } catch (Throwable throwable) { log.warn("{}::onError: {}", listener.toString(), throwable.toString()); StreamSubscriber self = streamManager.unsubscribeInternal(listener); listener.onError(throwable); self.getScheduledFuture().cancel(false); break; } } }