commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1807537 - in /commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2: provider/ provider/compressed/ provider/ftp/ provider/hdfs/ provider/ram/ provider/webdav/ util/
Date Wed, 06 Sep 2017 22:08:08 GMT
Author: ggregory
Date: Wed Sep  6 22:08:08 2017
New Revision: 1807537

URL: http://svn.apache.org/viewvc?rev=1807537&view=rev
Log:
Do not need to nest else block.

Modified:
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java
    commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/RandomAccessMode.java

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
Wed Sep  6 22:08:08 2017
@@ -1423,11 +1423,8 @@ public abstract class AbstractFileObject
                 // Root file has no parent
                 return null;
             }
-            else
-            {
-                // Return the parent of the parent layer
-                return fs.getParentLayer().getParent();
-            }
+            // Return the parent of the parent layer
+            return fs.getParentLayer().getParent();
         }
 
         synchronized (fs)
@@ -1790,15 +1787,12 @@ public abstract class AbstractFileObject
             {
                 return doIsWriteable();
             }
-            else
+            final FileObject parent = getParent();
+            if (parent != null)
             {
-                final FileObject parent = getParent();
-                if (parent != null)
-                {
-                    return parent.isWriteable();
-                }
-                return true;
+                return parent.isWriteable();
             }
+            return true;
         }
         catch (final Exception exc)
         {

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
Wed Sep  6 22:08:08 2017
@@ -381,10 +381,7 @@ public final class DefaultFileContent im
             {
                 return certs;
             }
-            else
-            {
-                return new Certificate[0];
-            }
+            return new Certificate[0];
         }
         catch (final Exception e)
         {
@@ -625,12 +622,9 @@ public final class DefaultFileContent im
         {
             return true;
         }
-        else
-        {
-            // threadData.get() created empty entry
-            threadData.remove();
-            return false;
-        }
+        // threadData.get() created empty entry
+        threadData.remove();
+        return false;
     }
 
     /**

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java
Wed Sep  6 22:08:08 2017
@@ -153,10 +153,7 @@ public class DelegateFileObject<AFS exte
         {
             return file.isReadable();
         }
-        else
-        {
-            return true;
-        }
+        return true;
     }
 
     /**
@@ -169,10 +166,7 @@ public class DelegateFileObject<AFS exte
         {
             return file.isWriteable();
         }
-        else
-        {
-            return false;
-        }
+        return false;
     }
 
     /**
@@ -185,10 +179,7 @@ public class DelegateFileObject<AFS exte
         {
             return file.isExecutable();
         }
-        else
-        {
-            return false;
-        }
+        return false;
     }
 
     /**
@@ -201,10 +192,7 @@ public class DelegateFileObject<AFS exte
         {
             return file.isHidden();
         }
-        else
-        {
-            return false;
-        }
+        return false;
     }
 
     /**
@@ -234,10 +222,7 @@ public class DelegateFileObject<AFS exte
             }
             return childNames;
         }
-        else
-        {
-            return children.toArray(new String[children.size()]);
-        }
+        return children.toArray(new String[children.size()]);
     }
 
     /**

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
Wed Sep  6 22:08:08 2017
@@ -86,10 +86,7 @@ public class URLFileName extends Generic
             {
                 return URIUtil.encodePath(getPathDecoded(), charset);
             }
-            else
-            {
-                return URIUtil.encodePath(getPathDecoded());
-            }
+            return URIUtil.encodePath(getPathDecoded());
         }
 
         final StringBuilder sb = new StringBuilder(BUFFER_SIZE);

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java
Wed Sep  6 22:08:08 2017
@@ -75,10 +75,7 @@ public abstract class CompressedFileFile
         {
             return FileType.FOLDER;
         }
-        else
-        {
-            return FileType.FILE;
-        }
+        return FileType.FILE;
     }
 
     /**

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
Wed Sep  6 22:08:08 2017
@@ -570,10 +570,7 @@ public class FtpFileObject extends Abstr
                 }
                 return linkDest.getContent().getSize();
             }
-            else
-            {
-                return this.fileInfo.getSize();
-            }
+            return this.fileInfo.getSize();
         }
     }
 
@@ -597,10 +594,7 @@ public class FtpFileObject extends Abstr
                 }
                 return linkDest.getContent().getLastModifiedTime();
             }
-            else
-            {
-                return getTimestamp();
-            }
+            return getTimestamp();
         }
     }
 

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
Wed Sep  6 22:08:08 2017
@@ -101,18 +101,15 @@ public class HdfsFileObject extends Abst
         {
             return super.doGetAttributes();
         }
-        else
-        {
-            final Map<String, Object> attrs = new HashMap<>();
-            attrs.put(HdfsFileAttributes.LAST_ACCESS_TIME.toString(), this.stat.getAccessTime());
-            attrs.put(HdfsFileAttributes.BLOCK_SIZE.toString(), this.stat.getBlockSize());
-            attrs.put(HdfsFileAttributes.GROUP.toString(), this.stat.getGroup());
-            attrs.put(HdfsFileAttributes.OWNER.toString(), this.stat.getOwner());
-            attrs.put(HdfsFileAttributes.PERMISSIONS.toString(), this.stat.getPermission().toString());
-            attrs.put(HdfsFileAttributes.LENGTH.toString(), this.stat.getLen());
-            attrs.put(HdfsFileAttributes.MODIFICATION_TIME.toString(), this.stat.getModificationTime());
-            return attrs;
-        }
+        final Map<String, Object> attrs = new HashMap<>();
+        attrs.put(HdfsFileAttributes.LAST_ACCESS_TIME.toString(), this.stat.getAccessTime());
+        attrs.put(HdfsFileAttributes.BLOCK_SIZE.toString(), this.stat.getBlockSize());
+        attrs.put(HdfsFileAttributes.GROUP.toString(), this.stat.getGroup());
+        attrs.put(HdfsFileAttributes.OWNER.toString(), this.stat.getOwner());
+        attrs.put(HdfsFileAttributes.PERMISSIONS.toString(), this.stat.getPermission().toString());
+        attrs.put(HdfsFileAttributes.LENGTH.toString(), this.stat.getLen());
+        attrs.put(HdfsFileAttributes.MODIFICATION_TIME.toString(), this.stat.getModificationTime());
+        return attrs;
     }
 
     /**
@@ -143,10 +140,7 @@ public class HdfsFileObject extends Abst
         {
             return this.stat.getModificationTime();
         }
-        else
-        {
-            return -1;
-        }
+        return -1;
     }
 
     /**
@@ -180,10 +174,7 @@ public class HdfsFileObject extends Abst
             {
                 return FileType.FOLDER;
             }
-            else
-            {
-                return FileType.FILE;
-            }
+            return FileType.FILE;
         }
         catch (final FileNotFoundException fnfe)
         {

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
Wed Sep  6 22:08:08 2017
@@ -250,10 +250,7 @@ public class RamFileRandomAccessContent
         {
             return buf[filePointer++] & 0xFF;
         }
-        else
-        {
-            throw new EOFException();
-        }
+        throw new EOFException();
     }
 
     /*

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
Wed Sep  6 22:08:08 2017
@@ -719,10 +719,7 @@ public class WebdavFileObject extends Ht
             {
                 return node.getLocalName().equals(DavConstants.XML_COLLECTION);
             }
-            else
-            {
-                return false;
-            }
+            return false;
         }
         catch (final FileNotFoundException fse)
         {

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/Os.java
Wed Sep  6 22:08:08 2017
@@ -212,10 +212,7 @@ public final class Os
 
             return isFamily && isName && isArch && isVersion;
         }
-        else
-        {
-            return false;
-        }
+        return false;
     }
 
     /**
@@ -316,10 +313,7 @@ public final class Os
             {
                 return OS_FAMILY_WINNT;
             }
-            else
-            {
-                return OS_FAMILY_WIN9X;
-            }
+            return OS_FAMILY_WIN9X;
         }
         else if (OS_NAME.indexOf("os/2") > -1)
         {
@@ -335,10 +329,7 @@ public final class Os
             {
                 return OS_FAMILY_OSX;
             }
-            else
-            {
-                return OS_FAMILY_MAC;
-            }
+            return OS_FAMILY_MAC;
         }
         else if (PATH_SEP.equals(":"))
         {

Modified: commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/RandomAccessMode.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/RandomAccessMode.java?rev=1807537&r1=1807536&r2=1807537&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/RandomAccessMode.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/RandomAccessMode.java
Wed Sep  6 22:08:08 2017
@@ -63,10 +63,7 @@ public enum RandomAccessMode
             {
                 return "rw"; // NON-NLS
             }
-            else
-            {
-                return "r"; // NON-NLS
-            }
+            return "r"; // NON-NLS
         }
         else if (requestWrite())
         {



Mime
View raw message