I'm new to the Stream API but I find this code a bit obscure. I also don't like
the need to catch the exception. The three call of getMaximumTimeBetweenPings
makes it very long and the third call is hard to understand initially.
After fumbling around for a while in my IDE I came up with this which I think
is easier to understand. It compiles; I'm not sure it does all the right things
at runtime:
final long delay =
dr.getGemFireCache().getCacheServers().stream().mapToLong(o ->
o.getMaximumTimeBetweenPings()).max().orElse(0L);
[ Full content available at: https://github.com/apache/geode/pull/2340 ]
This message was relayed via gitbox.apache.org for [email protected]