commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1403399 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
Date Mon, 29 Oct 2012 16:16:02 GMT
Author: ggregory
Date: Mon Oct 29 16:16:02 2012
New Revision: 1403399

URL: http://svn.apache.org/viewvc?rev=1403399&view=rev
Log:
Use ternary return expression instead of if-return-else-return;

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java?rev=1403399&r1=1403398&r2=1403399&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
Mon Oct 29 16:16:02 2012
@@ -626,14 +626,7 @@ public abstract class AbstractFileObject
     {
         try
         {
-            if (exists())
-            {
-                return doIsExecutable();
-            }
-            else
-            {
-                return false;
-            }
+            return exists() ? doIsExecutable() : false;
         }
         catch (final Exception exc)
         {
@@ -651,14 +644,7 @@ public abstract class AbstractFileObject
     {
         try
         {
-            if (exists())
-            {
-                return doIsHidden();
-            }
-            else
-            {
-                return false;
-            }
+            return exists() ? doIsHidden() : false;
         }
         catch (final Exception exc)
         {
@@ -676,14 +662,7 @@ public abstract class AbstractFileObject
     {
         try
         {
-            if (exists())
-            {
-                return doIsReadable();
-            }
-            else
-            {
-                return false;
-            }
+            return exists() ? doIsReadable() : false;
         }
         catch (final Exception exc)
         {
@@ -696,14 +675,7 @@ public abstract class AbstractFileObject
     {
         try
         {
-            if (exists())
-            {
-                return doSetReadable(readable, ownerOnly);
-            }
-            else
-            {
-                return false;
-            }
+            return exists() ? doSetReadable(readable, ownerOnly) : false;
         }
         catch (final Exception exc)
         {
@@ -746,14 +718,7 @@ public abstract class AbstractFileObject
     {
         try
         {
-            if (exists())
-            {
-                return doSetWritable(readable, ownerOnly);
-            }
-            else
-            {
-                return false;
-            }
+            return exists() ? doSetWritable(readable, ownerOnly) : false;
         }
         catch (final Exception exc)
         {
@@ -766,14 +731,7 @@ public abstract class AbstractFileObject
     {
         try
         {
-            if (exists())
-            {
-                return doSetExecutable(readable, ownerOnly);
-            }
-            else
-            {
-                return false;
-            }
+            return exists() ? doSetExecutable(readable, ownerOnly) : false;
         }
         catch (final Exception exc)
         {



Mime
View raw message