File tree Expand file tree Collapse file tree
src/main/java/com/couchbase/lite Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2417,9 +2417,13 @@ private boolean postChangeNotifications() {
24172417
24182418 protected Replication findActiveReplicator (Replication replicator ) {
24192419 synchronized (activeReplicators ) {
2420- for (Replication active : activeReplicators ) {
2421- if (active .equals (replicator ) && active .isRunning ())
2422- return active ;
2420+ String remoteCheckpointDocID = replicator .remoteCheckpointDocID ();
2421+ if (remoteCheckpointDocID == null )
2422+ return null ;
2423+
2424+ for (Replication r : activeReplicators ) {
2425+ if (remoteCheckpointDocID .equals (r .remoteCheckpointDocID ()) && r .isRunning ())
2426+ return r ;
24232427 }
24242428 }
24252429 return null ;
Original file line number Diff line number Diff line change @@ -464,7 +464,8 @@ protected void setLastError(Throwable lastError) {
464464 /**
465465 * Following two methods for temporary methods instead of CBL_ReplicatorSettings implementation.
466466 */
467- protected String remoteCheckpointDocID () {
467+ @ InterfaceAudience .Private
468+ public String remoteCheckpointDocID () {
468469 return replicationInternal .remoteCheckpointDocID ();
469470 }
470471
@@ -938,19 +939,4 @@ private void addProperties(ReplicationInternal replicationInternal) {
938939 public String toString () {
939940 return "Replication{" + remote + ", " + (isPull () ? "pull" : "push" ) + '}' ;
940941 }
941-
942- @ Override
943- public int hashCode () {
944- return replicationInternal .remoteCheckpointDocID ().hashCode ();
945- }
946-
947- @ Override
948- public boolean equals (Object obj ) {
949- if (obj instanceof Replication ) {
950- Replication replication = (Replication )obj ;
951- return this .replicationInternal .remoteCheckpointDocID ().equals (
952- replication .replicationInternal .remoteCheckpointDocID ());
953- }
954- return false ;
955- }
956942}
You can’t perform that action at this time.
0 commit comments