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