This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
The following commit(s) were added to refs/heads/master by this push: new 8eda3b4 Lambdas. 8eda3b4 is described below commit 8eda3b4735f2808a2f47b96a8105661e7a54d6f5 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Mar 29 17:57:45 2020 -0400 Lambdas. --- .../vfs2/provider/http5/Http5FileProvider.java | 11 +---------- .../commons/vfs2/function/VfsConsumerTest.java | 2 +- .../commons/vfs2/provider/zip/Jira733TestCase.java | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java index 51ae198..b10d36b 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java @@ -72,12 +72,9 @@ import org.apache.hc.core5.http.ConnectionReuseStrategy; import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpHeaders; import org.apache.hc.core5.http.HttpHost; -import org.apache.hc.core5.http.HttpRequest; -import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy; import org.apache.hc.core5.http.io.SocketConfig; import org.apache.hc.core5.http.message.BasicHeader; -import org.apache.hc.core5.http.protocol.HttpContext; import org.apache.hc.core5.http.ssl.TLS; import org.apache.hc.core5.ssl.SSLContextBuilder; @@ -178,13 +175,7 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider { final ConnectionReuseStrategy connectionReuseStrategy = builder.isKeepAlive(fileSystemOptions) ? DefaultConnectionReuseStrategy.INSTANCE - : new ConnectionReuseStrategy() { - @Override - public boolean keepAlive( - final HttpRequest request, final HttpResponse response, final HttpContext context) { - return false; - } - }; + : (request, response, context) -> false; final HttpClientBuilder httpClientBuilder = HttpClients.custom() diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/function/VfsConsumerTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/function/VfsConsumerTest.java index 227470c..61dc56d 100644 --- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/function/VfsConsumerTest.java +++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/function/VfsConsumerTest.java @@ -36,7 +36,7 @@ public class VfsConsumerTest { */ @Test public void test() throws FileSystemException { - test(fileObject -> fileObject.exists()); + test(FileObject::exists); } private void test(final VfsConsumer<FileObject> consumer) throws FileSystemException { diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java index 6a45dbd..43817ed 100644 --- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java +++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java @@ -69,7 +69,7 @@ public class Jira733TestCase { @Test public void testZipParentLayer_exists() throws Exception { - testZipParentLayer(fileObject -> fileObject.exists()); + testZipParentLayer(FileObject::exists); } @Test @@ -87,51 +87,51 @@ public class Jira733TestCase { @Test public void testZipParentLayer_getContents() throws Exception { - testZipParentLayer(fileObject -> fileObject.getContent()); + testZipParentLayer(FileObject::getContent); } @Test public void testZipParentLayer_getType() throws Exception { - testZipParentLayer(fileObject -> fileObject.getType()); + testZipParentLayer(FileObject::getType); } @Test public void testZipParentLayer_isAttached() throws Exception { - testZipParentLayer(fileObject -> fileObject.isAttached()); + testZipParentLayer(FileObject::isAttached); } @Test public void testZipParentLayer_isContentOpen() throws Exception { - testZipParentLayer(fileObject -> fileObject.isContentOpen()); + testZipParentLayer(FileObject::isContentOpen); } @Test public void testZipParentLayer_isExecutable() throws Exception { - testZipParentLayer(fileObject -> fileObject.isExecutable()); + testZipParentLayer(FileObject::isExecutable); } @Test public void testZipParentLayer_isFile() throws Exception { - testZipParentLayer(fileObject -> fileObject.isFile()); + testZipParentLayer(FileObject::isFile); } @Test public void testZipParentLayer_isFolder() throws Exception { - testZipParentLayer(fileObject -> fileObject.isFolder()); + testZipParentLayer(FileObject::isFolder); } @Test public void testZipParentLayer_isHidden() throws Exception { - testZipParentLayer(fileObject -> fileObject.isHidden()); + testZipParentLayer(FileObject::isHidden); } @Test public void testZipParentLayer_isReadable() throws Exception { - testZipParentLayer(fileObject -> fileObject.isReadable()); + testZipParentLayer(FileObject::isReadable); } @Test public void testZipParentLayer_isWriteable() throws Exception { - testZipParentLayer(fileObject -> fileObject.isWriteable()); + testZipParentLayer(FileObject::isWriteable); } }