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 cd43944 No need to initialize to default value. cd43944 is described below commit cd43944d94ecf6a5e43595defb90139f4c530c60 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri Nov 20 21:59:34 2020 -0500 No need to initialize to default value. --- .../commons/vfs2/provider/http/HttpFileContentInfoFactory.java | 5 +---- .../org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java | 4 +--- .../org/apache/commons/vfs2/util/MonitorRandomAccessContent.java | 2 +- .../vfs2/provider/sftp/test/AbstractSftpProviderTestCase.java | 3 +-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java index 86b5478..0b13a41 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java @@ -37,7 +37,6 @@ public class HttpFileContentInfoFactory implements FileContentInfoFactory { public FileContentInfo create(final FileContent fileContent) throws FileSystemException { String contentType = null; - String contentEncoding = null; HeadMethod headMethod; try (final HttpFileObject<HttpFileSystem> httpFile = (HttpFileObject<HttpFileSystem>) FileObjectUtils @@ -54,8 +53,6 @@ public class HttpFileContentInfoFactory implements FileContentInfoFactory { } } - contentEncoding = headMethod.getResponseCharSet(); - - return new DefaultFileContentInfo(contentType, contentEncoding); + return new DefaultFileContentInfo(contentType, headMethod.getResponseCharSet()); } } diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java index 5ef4898..2eaa7a0 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java @@ -68,8 +68,6 @@ public final class SftpClientFactory { final char[] password, final FileSystemOptions fileSystemOptions) throws FileSystemException { final JSch jsch = new JSch(); - File sshDir = null; - // new style - user passed final SftpFileSystemConfigBuilder builder = SftpFileSystemConfigBuilder.getInstance(); final File knownHostsFile = builder.getKnownHosts(fileSystemOptions); @@ -78,7 +76,7 @@ public final class SftpClientFactory { final ConfigRepository configRepository = builder.getConfigRepository(fileSystemOptions); final boolean loadOpenSSHConfig = builder.isLoadOpenSSHConfig(fileSystemOptions); - sshDir = findSshDir(); + File sshDir = findSshDir(); setKnownHosts(jsch, sshDir, knownHostsFile); diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java index cb54b2e..52190e3 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/MonitorRandomAccessContent.java @@ -54,7 +54,7 @@ public class MonitorRandomAccessContent implements RandomAccessContent { } // Close the output stream - IOException exc = null; + IOException exc; try { content.close(); } catch (final IOException ioe) { diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/test/AbstractSftpProviderTestCase.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/test/AbstractSftpProviderTestCase.java index db02798..2e1fbeb 100644 --- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/test/AbstractSftpProviderTestCase.java +++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/test/AbstractSftpProviderTestCase.java @@ -461,8 +461,7 @@ abstract class AbstractSftpProviderTestCase extends AbstractProviderTestConfig { private String[] extended; private SftpAttrs(final Buffer buf) { - int flags = 0; - flags = buf.getInt(); + int flags = buf.getInt(); if ((flags & SftpATTRS.SSH_FILEXFER_ATTR_SIZE) != 0) { size = buf.getLong();