DBZ-8054 Workaround bug with ISPN and toList() collection

This commit is contained in:
Jeremy Ford 2024-07-31 14:57:24 -04:00 committed by Chris Cranford
parent 28ca70c396
commit 86582a3802

View File

@ -13,8 +13,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.TreeMap;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@ -163,16 +161,9 @@ protected List<String> getTransactionKeysWithPrefix(String prefix) {
return getEventCache()
.streamAndReturn(stream -> stream.map(LogMinerCache.Entry::getKey)
.filter(k -> k.startsWith(prefix))
.collect(
Collectors.toMap(
Function.identity(),
x -> Boolean.TRUE,
(v1, v2) -> {
throw new IllegalStateException();
},
() -> new TreeMap<>(EventKeySortComparator.INSTANCE.reversed())))
.keySet())
.stream().toList();
.sorted(EventKeySortComparator.INSTANCE.reversed())
.collect(Collectors.toList()) // must use Collectors.toList to avoid bug in ISPN for now
);
}
@Override