Source:
void c4StatusChanged(C4ReplicatorStatus c4Status) { final ReplicatorChange change; final List<ReplicatorChangeListenerToken> tokens; Log.i( DOMAIN, "%s: status changed: (%d, %d) @%s", this, pendingResolutions.size(), pendingStatusNotifications.size(), c4Status); synchronized (lock) { final int c4ActivityLevel = c4Status.getActivityLevel(); if (!pendingResolutions.isEmpty() && ((c4ActivityLevel == C4ReplicatorStatus.ActivityLevel.IDLE) || (c4ActivityLevel == C4ReplicatorStatus.ActivityLevel.STOPPED)) && !actuallyMeansOffline(c4Status.getC4Error())) { pendingStatusNotifications.add(c4Status); } if (!pendingStatusNotifications.isEmpty()) { return; } if ((responseHeaders == null) && (c4repl != null)) { final byte[] h = c4repl.getResponseHeaders(); if (h != null) { responseHeaders = FLValue.fromData(h).asDict(); } } switch (c4ActivityLevel) { case C4ReplicatorStatus.ActivityLevel.IDLE: case C4ReplicatorStatus.ActivityLevel.BUSY: resetRetryCount(); if (reachabilityManager != null) { reachabilityManager.removeNetworkReachabilityListener(this); } break; case C4ReplicatorStatus.ActivityLevel.STOPPED: final C4Error error = c4Status.getC4Error(); if (actuallyMeansOffline(error)) { handleError(error); c4Status = c4Status.copyAtlevel(C4ReplicatorStatus.ActivityLevel.OFFLINE); } break; default: break; } updateStateProperties(c4Status); change = new ReplicatorChange((Replicator) this, this.getStatus()); tokens = new ArrayList<>(changeListenerTokens); if (c4Status.getActivityLevel() == C4ReplicatorStatus.ActivityLevel.STOPPED) { cancelScheduledRetry(); clearRepl(); config.getDatabase().removeActiveReplicator((Replicator) this); } } for (ReplicatorChangeListenerToken token : tokens) { token.notify(change); } }

Target:
void c4StatusChanged(C4ReplicatorStatus c4Status) { final ReplicatorChange change; final List<ReplicatorChangeListenerToken> tokens; Log.i( DOMAIN, "%s: status changed: (%d, %d) @%s", this, pendingResolutions.size(), pendingStatusNotifications.size(), c4Status); synchronized (lock) { final int c4ActivityLevel = c4Status.getActivityLevel(); if (!pendingResolutions.isEmpty() && ((c4ActivityLevel == C4ReplicatorStatus.ActivityLevel.IDLE) || (c4ActivityLevel == C4ReplicatorStatus.ActivityLevel.STOPPED)) && !actuallyMeansOffline(c4Status.getC4Error())) { pendingStatusNotifications.add(c4Status); } if (!pendingStatusNotifications.isEmpty()) { return; } if ((responseHeaders == null) && (c4repl != null)) { final byte[] h = c4repl.getResponseHeaders(); if (h != null) { responseHeaders = FLValue.fromData(h).asDict(); } } switch (c4ActivityLevel) { case C4ReplicatorStatus.ActivityLevel.IDLE: case C4ReplicatorStatus.ActivityLevel.BUSY: resetRetryCount(); if (reachabilityManager != null) { reachabilityManager.removeNetworkReachabilityListener(this); } break; case C4ReplicatorStatus.ActivityLevel.STOPPED: final C4Error error = c4Status.getC4Error(); if (actuallyMeansOffline(error)) { handleError(error); c4Status = c4Status.copyAtlevel(C4ReplicatorStatus.ActivityLevel.OFFLINE); } break; default: Log.w(DOMAIN, "%s: received unrecognized activity level: ", this, c4Status); break; } updateStateProperties(c4Status); change = new ReplicatorChange((Replicator) this, this.getStatus()); tokens = new ArrayList<>(changeListenerTokens); if (c4Status.getActivityLevel() == C4ReplicatorStatus.ActivityLevel.STOPPED) { cancelScheduledRetry(); clearRepl(); config.getDatabase().removeActiveReplicator((Replicator) this); } } for (ReplicatorChangeListenerToken token : tokens) { token.notify(change); } }