You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2019/05/26 10:20:52 UTC
svn commit: r1860049 -
/jmeter/trunk/test/src/org/apache/jmeter/engine/LocalHostTest.java
Author: fschumacher
Date: Sun May 26 10:20:52 2019
New Revision: 1860049
URL: http://svn.apache.org/viewvc?rev=1860049&view=rev
Log:
Shorten lambda expressions by using references and anyMatch
Modified:
jmeter/trunk/test/src/org/apache/jmeter/engine/LocalHostTest.java
Modified: jmeter/trunk/test/src/org/apache/jmeter/engine/LocalHostTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/engine/LocalHostTest.java?rev=1860049&r1=1860048&r2=1860049&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/engine/LocalHostTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/engine/LocalHostTest.java Sun May 26 10:20:52 2019
@@ -51,10 +51,8 @@ public class LocalHostTest {
.list(NetworkInterface.getNetworkInterfaces()).stream()
.flatMap(iface -> iface.getInterfaceAddresses().stream())
.filter(iface -> iface.getNetworkPrefixLength() <= 32) // hack to prevent checking IPv6
- .map(addr -> toSubnetInfo(addr))
- .filter(subnetInfo -> subnetInfo.isInRange(localHost))
- .findFirst()
- .isPresent();
+ .map(this::toSubnetInfo)
+ .anyMatch(subnetInfo -> subnetInfo.isInRange(localHost));
Assert.assertTrue(
"localHost: " + localHost + " is bound to an interface",
localHostIsBound);