svn commit: r1839926 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java

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

svn commit: r1839926 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java

pgil
Author: pgil
Date: Mon Sep  3 09:33:21 2018
New Revision: 1839926

URL: http://svn.apache.org/viewvc?rev=1839926&view=rev
Log:
Implemented: Refactor EntityUtil findBy methods using Stream API
(OFBIZ-10537)

Fixed variable name to make it more meaningful

Modified:
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java?rev=1839926&r1=1839925&r2=1839926&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java Mon Sep  3 09:33:21 2018
@@ -465,11 +465,11 @@ public final class EntityUtil {
             return null;
         }
 
-        Stream<T> tStream = genericValueList.stream().map(genericValue -> UtilGenerics.cast(genericValue.get(fieldName)));
+        Stream<T> fieldListStream = genericValueList.stream().map(genericValue -> UtilGenerics.cast(genericValue.get(fieldName)));
         if (distinct) {
-            return tStream.distinct().collect(toList());
+            return fieldListStream.distinct().collect(toList());
         } else {
-            return tStream.collect(toList());
+            return fieldListStream.collect(toList());
         }
     }