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 5420c38  VFS-801 - Redundant local variable (#171)
5420c38 is described below

commit 5420c382a782a8fc37a4b787565aa3a0ba9c7cb2
Author: Arturo Bernal <[email protected]>
AuthorDate: Sun Mar 28 14:37:05 2021 +0200

    VFS-801 - Redundant local variable (#171)
---
 .../java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java     | 3 +--
 .../main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java  | 3 +--
 .../main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java  | 3 +--
 .../main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java  | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
index 8d48cac..beb5acb 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
@@ -125,8 +125,7 @@ public class StaticUserAuthenticator implements 
UserAuthenticator, Comparable<St
                 return 1;
             }
 
-            final int result = thisString.compareTo(otherString);
-            return result;
+            return thisString.compareTo(otherString);
         }
         if (otherString != null) {
             return -1;
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
index 01facb5..8826860 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
@@ -436,9 +436,8 @@ public class FtpFileObject extends 
AbstractFileObject<FtpFileSystem> {
             final boolean ok;
             final FtpClient ftpClient = getAbstractFileSystem().getClient();
             try {
-                final String oldName = relPath;
                 final String newName = ((FtpFileObject) 
FileObjectUtils.getAbstractFileObject(newFile)).getRelPath();
-                ok = ftpClient.rename(oldName, newName);
+                ok = ftpClient.rename(relPath, newName);
             } finally {
                 getAbstractFileSystem().putClient(ftpClient);
             }
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
index b11af1f..f2cb974 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
@@ -94,8 +94,7 @@ public class JarFileSystem extends ZipFileSystem {
     Object getAttribute(final Name attrName) throws FileSystemException {
         try {
             final Attributes attr = getAttributes();
-            final String value = attr.getValue(attrName);
-            return value;
+            return attr.getValue(attrName);
         } catch (final IOException ioe) {
             throw new FileSystemException(attrName.toString(), ioe);
         }
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
index 00dbd54..5421ef3 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
@@ -220,8 +220,7 @@ public class TarFileSystem extends AbstractFileSystem {
             }
             tarFile = null;
         }
-        final TarArchiveInputStream tarFile = createTarFile(this.file);
-        this.tarFile = tarFile;
+        this.tarFile = createTarFile(this.file);
     }
 
     /**

Reply via email to