From ce84f28d6af965a86ae45c80976a67a4ef972fa9 Mon Sep 17 00:00:00 2001 From: Hellblazer Date: Tue, 21 May 2024 21:45:55 -0700 Subject: [PATCH] arg --- .../java/com/salesforce/apollo/choam/CHOAM.java | 13 +++++++------ .../java/com/salesforce/apollo/choam/Session.java | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java b/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java index 877c4a896..242f46e96 100644 --- a/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java +++ b/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java @@ -7,7 +7,6 @@ package com.salesforce.apollo.choam; import com.chiralbehaviors.tron.Fsm; -import com.google.common.base.Function; import com.google.protobuf.ByteString; import com.google.protobuf.Empty; import com.google.protobuf.InvalidProtocolBufferException; @@ -56,6 +55,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -109,10 +109,9 @@ public CHOAM(Parameters params) { rotateViewKeys(); var bContext = new DelegatedContext<>(params.context()); - var adapter = new MessageAdapter(_ -> true, (Function) this::signatureHash, - (Function>) _ -> Collections.emptyList(), - (_, any) -> any, - (Function) AgedMessageOrBuilder::getContent); + var adapter = new MessageAdapter(_ -> true, this::signatureHash, + _ -> Collections.emptyList(), + (_, any) -> any, AgedMessageOrBuilder::getContent); combine = new ReliableBroadcaster(bContext, params.member(), params.combine(), params.communications(), params.metrics() == null ? null : params.metrics().getCombineMetrics(), @@ -234,7 +233,9 @@ public static Block reconfigure(Digest nextViewId, Map joins, Hash } public static Map rosterMap(Context baseContext, Collection members) { - return members.stream().collect(Collectors.toMap(m -> m, baseContext::getMember)); + return members.stream() + .map(baseContext::getMember) + .collect(Collectors.toMap(Member::getId, Function.identity())); } public static List toGenesisData(List initializationData) { diff --git a/choam/src/main/java/com/salesforce/apollo/choam/Session.java b/choam/src/main/java/com/salesforce/apollo/choam/Session.java index 31c09603e..b680d0737 100644 --- a/choam/src/main/java/com/salesforce/apollo/choam/Session.java +++ b/choam/src/main/java/com/salesforce/apollo/choam/Session.java @@ -7,7 +7,6 @@ package com.salesforce.apollo.choam; import com.codahale.metrics.Timer; -import com.google.common.base.Function; import com.google.protobuf.Message; import com.netflix.concurrency.limits.Limiter; import com.netflix.concurrency.limits.internal.EmptyMetricRegistry; @@ -33,6 +32,7 @@ import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; import java.util.function.Supplier; /**