Implemented: Refactor EntityUtil findBy methods using Stream API

(OFBIZ-10537)

Fixed variable name to make it more meaningful

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1839926 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gil Portenseigne
2018-09-03 09:33:21 +00:00
parent 1c73989942
commit 3f23e45b7b
@@ -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());
}
}