svn commit: r1860837 - /ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1860837 - /ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java

mthl
Author: mthl
Date: Sat Jun  8 14:57:08 2019
New Revision: 1860837

URL: http://svn.apache.org/viewvc?rev=1860837&view=rev
Log:
Improved: Rewrite ‘EntityDataLoadContainer#isDataReadersEnabled’
(OFBIZ-11070)

Use a boolean expression instead of a conditional.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java

Modified: ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=1860837&r1=1860836&r2=1860837&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java Sat Jun  8 14:57:08 2019
@@ -500,14 +500,10 @@ public class EntityDataLoadContainer imp
         return fileList;
     }
 
-    private boolean isDataReadersEnabled(List<String> files, String directory, String readers) {
+    private static boolean isDataReadersEnabled(List<String> files, String directory, String readers) {
         /* if files or directories are passed by the user and no readers are
          * passed then set readers to "none" */
-        if (readers == null && (!files.isEmpty() || directory != null)) {
-            return false;
-        } else {
-            return true;
-        }
+        return readers != null || (files.isEmpty() && directory == null);
     }
 
     private List<String> prepareTenantLoadComponents(Delegator delegator, Delegator baseDelegator,