Author: doogie
Date: Mon May 13 18:02:08 2013
New Revision: 1482004
URL:
http://svn.apache.org/r1482004Log:
FEATURE: getFirst/getOnly now use UtilValidate to verify non-emptiness.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java?rev=1482004&r1=1482003&r2=1482004&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java Mon May 13 18:02:08 2013
@@ -70,7 +70,7 @@ public class EntityUtil {
public static GenericValue getFirst(List<GenericValue> values) {
- if ((values != null) && (values.size() > 0)) {
+ if (UtilValidate.isNotEmpty(values)) {
return values.get(0);
} else {
return null;
@@ -78,10 +78,7 @@ public class EntityUtil {
}
public static GenericValue getOnly(List<GenericValue> values) {
- if (values != null) {
- if (values.size() <= 0) {
- return null;
- }
+ if (UtilValidate.isNotEmpty(values)) {
if (values.size() == 1) {
return values.get(0);
} else {