From: Robert Varga Date: Wed, 10 Nov 2021 13:43:58 +0000 (+0100) Subject: Fix Eclipse compilation error X-Git-Tag: v4.0.7~28 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=25e140045dd07b173278460f20e17bd2c704e806;ds=sidebyside Fix Eclipse compilation error JDT has trouble with Scala classes here, make sure we specify more general scala.collections.Set instead of its immutable counterpart. Change-Id: I60b56e6b7ec5705409aee8d1e30a8ae9e5579bfb Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java index a1b3d4ecde..a298508cc9 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java @@ -124,6 +124,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory; import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import scala.collection.Set; import scala.concurrent.Await; import scala.concurrent.Future; import scala.concurrent.duration.FiniteDuration; @@ -1266,9 +1267,9 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest { Member follower2Member = follower2Cluster.readView().self(); await().atMost(10, TimeUnit.SECONDS) - .until(() -> leaderCluster.readView().unreachableMembers().contains(follower2Member)); + .until(() -> containsUnreachable(leaderCluster, follower2Member)); await().atMost(10, TimeUnit.SECONDS) - .until(() -> followerCluster.readView().unreachableMembers().contains(follower2Member)); + .until(() -> containsUnreachable(followerCluster, follower2Member)); ActorRef followerCars = followerDistributedDataStore.getActorUtils().findLocalShard("cars").get(); @@ -1290,6 +1291,13 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest { ds2.close(); } + private static Boolean containsUnreachable(final Cluster cluster, final Member member) { + // unreachableMembers() returns scala.collection.immutable.Set, but we are using scala.collection.Set to fix JDT + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=468276#c32 + final Set members = cluster.readView().unreachableMembers(); + return members.contains(member); + } + @Test public void testInstallSnapshot() throws Exception { final String testName = "testInstallSnapshot";