You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/11/24 00:41:40 UTC

svn commit: r883549 [3/3] - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/invoice/ applications/accounting/src/org/ofbiz/accounting/payment/ applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/ applications/a...

Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java (original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java Mon Nov 23 23:41:34 2009
@@ -149,7 +149,7 @@
                     
                     // first check auto-granted permissions
                     List<String> grantedPerms = autoGrant.get();
-                    if (grantedPerms != null && grantedPerms.size() > 0) {
+                    if (UtilValidate.isNotEmpty(grantedPerms)) {
                         Debug.logVerbose("Auto-Grant permissions found; looking for a match", module);
                         for (String granted : grantedPerms) {
                             if (Debug.verboseOn()) Debug.logVerbose("Testing - " + granted + " - with - " + joined.toString(), module);
@@ -192,7 +192,7 @@
     
     protected void handleAutoGrantPermissions(String userId, String expandedPermission, Map<String, ? extends Object> context) {                
         List<String> granted = getAutoGrantPermissions(userId, expandedPermission, context);
-        if (granted != null && granted.size() > 0) {
+        if (UtilValidate.isNotEmpty(granted)) {
             List<String> alreadyGranted = autoGrant.get();
             if (alreadyGranted == null) {
                 alreadyGranted = FastList.newInstance();

Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java (original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java Mon Nov 23 23:41:34 2009
@@ -53,7 +53,7 @@
         while (checking) {
             if (Debug.verboseOn()) Debug.logVerbose("Looking for auto-grant permissions for : " + checkString, module);
             List<String> autoGrant = getPermissionAutoGrant(checkString);
-            if (autoGrant != null && autoGrant.size() > 0) {
+            if (UtilValidate.isNotEmpty(autoGrant)) {
                 return autoGrant;
             }
             if (checkString.indexOf(":") > -1) {
@@ -183,7 +183,7 @@
                 Debug.logWarning(e, module);
             }
             
-            if (values != null && values.size() > 0) {
+            if (UtilValidate.isNotEmpty(values)) {
                 for (GenericValue v : values) {
                     autoGrants.add(v.getString("grantPermission"));
                 }

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java Mon Nov 23 23:41:34 2009
@@ -23,6 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
+import org.ofbiz.base.util.UtilValidate;
+
 /**
  * Service Permission Group Model Class
  */
@@ -37,7 +39,7 @@
     public String joinType;
 
     public boolean evalPermissions(DispatchContext dctx, Map<String, ? extends Object> context) {
-        if (permissions != null && permissions.size() > 0)  {
+        if (UtilValidate.isNotEmpty(permissions))  {
             boolean foundOne = false;
             for (ModelPermission perm: permissions) {
                 if (perm.evalPermission(dctx, context)) {

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java Mon Nov 23 23:41:34 2009
@@ -869,13 +869,13 @@
                 String key = param.name;
 
                 // internal map of strings
-                if (param.stringMapPrefix != null && param.stringMapPrefix.length() > 0 && !source.containsKey(key)) {
+                if (UtilValidate.isNotEmpty(param.stringMapPrefix) && !source.containsKey(key)) {
                     Map<String, Object> paramMap = this.makePrefixMap(source, param);
                     if (UtilValidate.isNotEmpty(paramMap)) {
                         target.put(key, paramMap);
                     }
                 // internal list of strings
-                } else if (param.stringListSuffix != null && param.stringListSuffix.length() > 0 && !source.containsKey(key)) {
+                } else if (UtilValidate.isNotEmpty(param.stringListSuffix) && !source.containsKey(key)) {
                     List<Object> paramList = this.makeSuffixList(source, param);
                     if (UtilValidate.isNotEmpty(paramList)) {
                         target.put(key, paramList);
@@ -928,7 +928,7 @@
     }
 
     public boolean containsPermissions() {
-        return (this.permissionGroups != null && this.permissionGroups.size() > 0);
+        return (UtilValidate.isNotEmpty(this.permissionGroups));
     }
 
     /**
@@ -1097,7 +1097,7 @@
             }
 
             // handle interfaces
-            if (implServices != null && implServices.size() > 0 && dctx != null) {
+            if (UtilValidate.isNotEmpty(implServices) && dctx != null) {
                 for (ModelServiceIface iface: implServices) {
                     String serviceName = iface.getService();
                     boolean optional = iface.isOptional();

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelServiceReader.java Mon Nov 23 23:41:34 2009
@@ -430,7 +430,7 @@
             ModelPermission perm = new ModelPermission();
             perm.nameOrRole = element.getAttribute("permission").intern();
             perm.action = element.getAttribute("action").intern();
-            if (perm.action != null && perm.action.length() > 0) {
+            if (UtilValidate.isNotEmpty(perm.action)) {
                 perm.permissionType = ModelPermission.ENTITY_PERMISSION;
             } else {
                 perm.permissionType = ModelPermission.PERMISSION;

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java Mon Nov 23 23:41:34 2009
@@ -142,7 +142,7 @@
         }
 
         // put the results in to the defined map
-        if (resultMapName != null && resultMapName.length() > 0) {
+        if (UtilValidate.isNotEmpty(resultMapName)) {
             Map<String, Object> resultMap = UtilGenerics.checkMap(context.get(resultMapName));
             if (resultMap == null) {
                 resultMap = FastMap.newInstance();

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java Mon Nov 23 23:41:34 2009
@@ -137,7 +137,7 @@
 
         Object lhsValue = null;
         Object rhsValue = null;
-        if (lhsMapName != null && lhsMapName.length() > 0) {
+        if (UtilValidate.isNotEmpty(lhsMapName)) {
             try {
                 if (context.containsKey(lhsMapName)) {
                     Map<String, ? extends Object> envMap = UtilGenerics.checkMap(context.get(lhsMapName));
@@ -158,7 +158,7 @@
 
         if (isConstant) {
             rhsValue = rhsValueName;
-        } else if (rhsMapName != null && rhsMapName.length() > 0) {
+        } else if (UtilValidate.isNotEmpty(rhsMapName)) {
             try {
                 if (context.containsKey(rhsMapName)) {
                     Map<String, ? extends Object> envMap = UtilGenerics.checkMap(context.get(rhsMapName));

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java Mon Nov 23 23:41:34 2009
@@ -49,6 +49,7 @@
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.JNDIContextFactory;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.entity.serialize.XmlSerializer;
 import org.ofbiz.entity.transaction.GenericTransactionException;
@@ -96,7 +97,7 @@
         throws GenericServiceException, JMSException {
         List<String> outParams = modelService.getParameterNames(ModelService.OUT_PARAM, false);
 
-        if (outParams != null && outParams.size() > 0)
+        if (UtilValidate.isNotEmpty(outParams))
             throw new GenericServiceException("JMS service cannot have required OUT parameters; no parameters will be returned.");
         String xmlContext = null;
 

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java Mon Nov 23 23:41:34 2009
@@ -411,7 +411,7 @@
                 "serviceName", serviceName, "statusId", "SERVICE_PENDING", "recurrenceInfoId", infoId, "runtimeDataId", dataId);
 
         // set the pool ID
-        if (poolName != null && poolName.length() > 0) {
+        if (UtilValidate.isNotEmpty(poolName)) {
             jFields.put("poolId", poolName);
         } else {
             jFields.put("poolId", ServiceConfigUtil.getSendPool());

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java Mon Nov 23 23:41:34 2009
@@ -95,7 +95,7 @@
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
 
         // load the factories
-        if (clientProp != null && clientProp.value != null && clientProp.value.length() > 0) {
+        if (clientProp != null && UtilValidate.isNotEmpty(clientProp.value)) {
             try {
                 Class<?> c = loader.loadClass(clientProp.value);
                 csf = (RMIClientSocketFactory) c.newInstance();
@@ -103,7 +103,7 @@
                 throw new ContainerException(e);
             }
         }
-        if (serverProp != null && serverProp.value != null && serverProp.value.length() > 0) {
+        if (serverProp != null && UtilValidate.isNotEmpty(serverProp.value)) {
             try {
                 Class<?> c = loader.loadClass(serverProp.value);
                 ssf = (RMIServerSocketFactory) c.newInstance();

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Mon Nov 23 23:41:34 2009
@@ -168,7 +168,7 @@
 
         // check if we are told to redirect everthing
         String redirectAllTo = config.getInitParameter("forceRedirectAll");
-        if (redirectAllTo != null && redirectAllTo.length() > 0) {
+        if (UtilValidate.isNotEmpty(redirectAllTo)) {
             // little trick here so we don't loop on ourself
             if (httpRequest.getSession().getAttribute("_FORCE_REDIRECT_") == null) {
                 httpRequest.getSession().setAttribute("_FORCE_REDIRECT_", "true");

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Mon Nov 23 23:41:34 2009
@@ -264,11 +264,11 @@
                 // NOTE: not using the old _PREVIOUS_PARAMS_ attribute at all because it was a security hole as it was used to put data in the URL (never encrypted) that was originally in a form field that may have been encrypted
                 // keep 2 maps: one for URL parameters and one for form parameters
                 Map<String, Object> urlParams = UtilHttp.getUrlOnlyParameterMap(request);
-                if (urlParams != null && urlParams.size() > 0) {
+                if (UtilValidate.isNotEmpty(urlParams)) {
                     session.setAttribute("_PREVIOUS_PARAM_MAP_URL_", urlParams);
                 }
                 Map<String, Object> formParams = UtilHttp.getParameterMap(request, urlParams.keySet(), false);
-                if (formParams != null && formParams.size() > 0) {
+                if (UtilValidate.isNotEmpty(formParams)) {
                     session.setAttribute("_PREVIOUS_PARAM_MAP_FORM_", formParams);
                 }
 

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java Mon Nov 23 23:41:34 2009
@@ -313,7 +313,7 @@
         }
 
         // some conversions
-        if (serviceTime != null && serviceTime.length() > 0) {
+        if (UtilValidate.isNotEmpty(serviceTime)) {
             try {
                 Timestamp ts1 = Timestamp.valueOf(serviceTime);
                 startTime = ts1.getTime();
@@ -330,7 +330,7 @@
                 errorBuf.append("<li>" + errMsg);
             }
         }
-        if (serviceEndTime != null && serviceEndTime.length() > 0) {
+        if (UtilValidate.isNotEmpty(serviceEndTime)) {
             try {
                 Timestamp ts1 = Timestamp.valueOf(serviceEndTime);
                 endTime = ts1.getTime();
@@ -347,7 +347,7 @@
                 errorBuf.append("<li>" + errMsg);
             }
         }
-        if (serviceIntr != null && serviceIntr.length() > 0) {
+        if (UtilValidate.isNotEmpty(serviceIntr)) {
             try {
                 interval = Integer.parseInt(serviceIntr);
             } catch (NumberFormatException nfe) {
@@ -355,7 +355,7 @@
                 errorBuf.append("<li>" + errMsg);
             }
         }
-        if (serviceCnt != null && serviceCnt.length() > 0) {
+        if (UtilValidate.isNotEmpty(serviceCnt)) {
             try {
                 count = Integer.parseInt(serviceCnt);
             } catch (NumberFormatException nfe) {
@@ -363,7 +363,7 @@
                 errorBuf.append("<li>" + errMsg);
             }
         }
-        if (serviceFreq != null && serviceFreq.length() > 0) {
+        if (UtilValidate.isNotEmpty(serviceFreq)) {
             int parsedValue = 0;
 
             try {
@@ -382,7 +382,7 @@
                 }
             }
         }
-        if (retryCnt != null && retryCnt.length() > 0) {
+        if (UtilValidate.isNotEmpty(retryCnt)) {
             int parsedValue = -2;
 
             try {

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java Mon Nov 23 23:41:34 2009
@@ -242,11 +242,11 @@
             if ("timeZone".equals(name)) continue;
 
             Object value = null;
-            if (modelParam.stringMapPrefix != null && modelParam.stringMapPrefix.length() > 0) {
+            if (UtilValidate.isNotEmpty(modelParam.stringMapPrefix)) {
                 Map<String, Object> paramMap = UtilHttp.makeParamMapWithPrefix(request, multiPartMap, modelParam.stringMapPrefix, null);
                 value = paramMap;
                 if (Debug.verboseOn()) Debug.log("Set [" + modelParam.name + "]: " + paramMap, module);
-            } else if (modelParam.stringListSuffix != null && modelParam.stringListSuffix.length() > 0) {
+            } else if (UtilValidate.isNotEmpty(modelParam.stringListSuffix)) {
                 List<Object> paramList = UtilHttp.makeParamListWithSuffix(request, multiPartMap, modelParam.stringListSuffix, null);
                 value = paramList;
             } else {

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java Mon Nov 23 23:41:34 2009
@@ -210,10 +210,10 @@
                     if ("timeZone".equals(paramName)) continue;
 
                     Object value = null;
-                    if (modelParam.stringMapPrefix != null && modelParam.stringMapPrefix.length() > 0) {
+                    if (UtilValidate.isNotEmpty(modelParam.stringMapPrefix)) {
                         Map<String, Object> paramMap = UtilHttp.makeParamMapWithPrefix(request, modelParam.stringMapPrefix, curSuffix);
                         value = paramMap;
-                    } else if (modelParam.stringListSuffix != null && modelParam.stringListSuffix.length() > 0) {
+                    } else if (UtilValidate.isNotEmpty(modelParam.stringListSuffix)) {
                         List<Object> paramList = UtilHttp.makeParamListWithSuffix(request, modelParam.stringListSuffix, null);
                         value = paramList;
                     } else {

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsJXlsViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsJXlsViewHandler.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsJXlsViewHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsJXlsViewHandler.java Mon Nov 23 23:41:34 2009
@@ -103,7 +103,7 @@
             JasperPrint jp = null;
             if (jrDataSource == null) {
                 String datasourceName = delegator.getEntityHelperName(info);
-                if (datasourceName != null && datasourceName.length() > 0) {
+                if (UtilValidate.isNotEmpty(datasourceName)) {
                     Debug.logInfo("Filling report with connection from datasource: " + datasourceName, module);
                     jp = JasperFillManager.fillReport(report, parameters, ConnectionFactory.getConnection(datasourceName));
                 } else {

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPdfViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPdfViewHandler.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPdfViewHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPdfViewHandler.java Mon Nov 23 23:41:34 2009
@@ -101,7 +101,7 @@
             JasperPrint jp = null;
             if (jrDataSource == null) {
                 String datasourceName = delegator.getEntityHelperName(info);
-                if (datasourceName != null && datasourceName.length() > 0) {
+                if (UtilValidate.isNotEmpty(datasourceName)) {
                     Debug.logInfo("Filling report with connection from datasource: " + datasourceName, module);
                     jp = JasperFillManager.fillReport(report, parameters, ConnectionFactory.getConnection(datasourceName));
                 } else {

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPoiXlsViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPoiXlsViewHandler.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPoiXlsViewHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPoiXlsViewHandler.java Mon Nov 23 23:41:34 2009
@@ -103,7 +103,7 @@
             JasperPrint jp = null;
             if (jrDataSource == null) {
                 String datasourceName = delegator.getEntityHelperName(info);
-                if (datasourceName != null && datasourceName.length() > 0) {
+                if (UtilValidate.isNotEmpty(datasourceName)) {
                     Debug.logInfo("Filling report with connection from datasource: " + datasourceName, module);
                     jp = JasperFillManager.fillReport(report, parameters, ConnectionFactory.getConnection(datasourceName));
                 } else {

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsXmlViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsXmlViewHandler.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsXmlViewHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsXmlViewHandler.java Mon Nov 23 23:41:34 2009
@@ -89,7 +89,7 @@
             PipedOutputStream fillToPrintOutputStream = new PipedOutputStream();
             PipedInputStream fillToPrintInputStream = new PipedInputStream(fillToPrintOutputStream);
 
-            if (datasourceName != null && datasourceName.length() > 0) {
+            if (UtilValidate.isNotEmpty(datasourceName)) {
                 JasperFillManager.fillReportToStream(report, fillToPrintOutputStream, parameters, ConnectionFactory.getConnection(datasourceName));
             } else {
                 JasperFillManager.fillReportToStream(report, fillToPrintOutputStream, parameters, new JREmptyDataSource());

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java Mon Nov 23 23:41:34 2009
@@ -22,6 +22,7 @@
 
 import javolution.util.FastList;
 
+import org.ofbiz.base.util.UtilValidate;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -39,7 +40,7 @@
     
     public Element createPropElement(List<Element> propList) {
         Element element = this.responseDocument.createElementNS(DAV_NAMESPACE_URI, "D:prop");
-        if (propList != null && propList.size() > 0) {
+        if (UtilValidate.isNotEmpty(propList)) {
             for (Element propElement : propList) {
                 element.appendChild(propElement);
             }

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java Mon Nov 23 23:41:34 2009
@@ -31,6 +31,7 @@
 import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
@@ -132,7 +133,7 @@
             }
 
             String fval = request.getParameter(field.getName());
-            if (fval != null && fval.length() > 0) {
+            if (UtilValidate.isNotEmpty(fval)) {
                 try {
                     findByEntity.setString(field.getName(), fval);
                 } catch (Exception e) {
@@ -180,7 +181,7 @@
             }
 
             String fval = request.getParameter(field.getName());
-            if (fval != null && fval.length() > 0) {
+            if (UtilValidate.isNotEmpty(fval)) {
                 try {
                     findByEntity.setString(field.getName(), fval);
                 } catch (Exception e) {

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Mon Nov 23 23:41:34 2009
@@ -126,7 +126,7 @@
         // #############################
         // The filename to parse is prepared
         // #############################
-        if (filename != null && filename.length() > 0) {
+        if (UtilValidate.isNotEmpty(filename)) {
             try {
                 url = isUrl?FlexibleLocation.resolveLocation(filename):UtilURL.fromFilename(filename);
                 InputStream is = url.openStream();
@@ -143,7 +143,7 @@
         // #############################
         // The text to parse is prepared
         // #############################
-        if (fulltext != null && fulltext.length() > 0) {
+        if (UtilValidate.isNotEmpty(fulltext)) {
             StringReader sr = new StringReader(fulltext);
             ins = new InputSource(sr);
         }
@@ -243,7 +243,7 @@
             filePause = Long.valueOf(0);
         }
 
-        if (path != null && path.length() > 0) {
+        if (UtilValidate.isNotEmpty(path)) {
             long pauseLong = filePause != null ? filePause.longValue() : 0;
             File baseDir = new File(path);
 
@@ -481,7 +481,7 @@
 
         List<String> results = FastList.newInstance();
 
-        if (outpath != null && outpath.length() > 0) {
+        if (UtilValidate.isNotEmpty(outpath)) {
             File outdir = new File(outpath);
             if (!outdir.exists()) {
                 outdir.mkdir();

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy Mon Nov 23 23:41:34 2009
@@ -28,6 +28,7 @@
 import org.ofbiz.entity.model.ModelKeyMap;
 import org.ofbiz.base.util.UtilFormatOut;
 import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
 import java.sql.Timestamp;
 import java.sql.Date;
 import java.sql.Time;
@@ -68,7 +69,7 @@
     ModelField field = entity.getPk(fnum);
     ModelFieldType type = delegator.getEntityFieldType(entity, field.getType());
     String fval = parameters.get(field.getName());
-    if (fval != null && fval.length() > 0) {
+    if (UtilValidate.isNotEmpty(fval)) {
         curFindString = curFindString + "&" + field.getName() + "=" + fval;
         findByPK.setString(field.getName(), fval);
     }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Mon Nov 23 23:41:34 2009
@@ -83,7 +83,7 @@
             localWriter.append(localRequestName);
         }
 
-        if (parameterList != null && parameterList.size() > 0) {
+        if (UtilValidate.isNotEmpty(parameterList)) {
             String localUrl = localWriter.toString();
             externalWriter.append(localUrl);
             boolean needsAmp = true;

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Mon Nov 23 23:41:34 2009
@@ -1147,7 +1147,7 @@
         String targetType = modelForm.getTargetType();
         String targ = modelForm.getTarget(context, targetType);
         StringBuilder linkUrl = new StringBuilder();
-        if (targ != null && targ.length() > 0) {
+        if (UtilValidate.isNotEmpty(targ)) {
             //this.appendOfbizUrl(writer, "/" + targ);
             WidgetWorker.buildHyperlinkUrl(linkUrl, targ, targetType, null, null, false, false, true, request, response, context);
         }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Mon Nov 23 23:41:34 2009
@@ -2682,7 +2682,7 @@
             String positionStr = element.getAttribute("default-position");
             int position = 1;
             try {
-                if (positionStr != null && positionStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(positionStr)) {
                     position = Integer.valueOf(positionStr);
                 }
             } catch (Exception e) {
@@ -2706,7 +2706,7 @@
             String positionStr = element.getAttribute("default-position");
             int position = 1;
             try {
-                if (positionStr != null && positionStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(positionStr)) {
                     position = Integer.valueOf(positionStr);
                 }
             } catch (Exception e) {

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Mon Nov 23 23:41:34 2009
@@ -160,7 +160,7 @@
 
         String positionStr = fieldElement.getAttribute("position");
         try {
-            if (positionStr != null && positionStr.length() > 0) {
+            if (UtilValidate.isNotEmpty(positionStr)) {
                 position = Integer.valueOf(positionStr);
             }
         } catch (Exception e) {
@@ -2665,7 +2665,7 @@
             try {
                 size = Integer.parseInt(sizeStr);
             } catch (Exception e) {
-                if (sizeStr != null && sizeStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(sizeStr)) {
                     Debug.logError("Could not parse the size value of the text element: [" + sizeStr + "], setting to the default of " + size, module);
                 }
             }
@@ -2675,7 +2675,7 @@
                 maxlength = Integer.valueOf(maxlengthStr);
             } catch (Exception e) {
                 maxlength = null;
-                if (maxlengthStr != null && maxlengthStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(maxlengthStr)) {
                     Debug.logError("Could not parse the max-length value of the text element: [" + maxlengthStr + "], setting to null; default of no maxlength will be used", module);
                 }
             }
@@ -2788,7 +2788,7 @@
             try {
                 cols = Integer.parseInt(colsStr);
             } catch (Exception e) {
-                if (colsStr != null && colsStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(colsStr)) {
                     Debug.logError("Could not parse the size value of the text element: [" + colsStr + "], setting to default of " + cols, module);
                 }
             }
@@ -2797,7 +2797,7 @@
             try {
                 rows = Integer.parseInt(rowsStr);
             } catch (Exception e) {
-                if (rowsStr != null && rowsStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(rowsStr)) {
                     Debug.logError("Could not parse the size value of the text element: [" + rowsStr + "], setting to default of " + rows, module);
                 }
             }
@@ -3013,7 +3013,7 @@
             try {
                 this.otherFieldSize = Integer.parseInt(sizeStr);
             } catch (Exception e) {
-                if (sizeStr != null && sizeStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(sizeStr)) {
                     Debug.logError("Could not parse the size value of the text element: [" + sizeStr + "], setting to the default of " + this.otherFieldSize, module);
                 }
             }
@@ -3577,7 +3577,7 @@
             try {
                 border = Integer.parseInt(borderStr);
             } catch (Exception e) {
-                if (borderStr != null && borderStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(borderStr)) {
                     Debug.logError("Could not parse the border value of the text element: [" + borderStr + "], setting to the default of " + border, module);
                 }
             }
@@ -3587,7 +3587,7 @@
                 width = Integer.valueOf(widthStr);
             } catch (Exception e) {
                 width = null;
-                if (widthStr != null && widthStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(widthStr)) {
                     Debug.logError(
                         "Could not parse the size value of the text element: [" + widthStr + "], setting to null; default of no width will be used",
                         module);
@@ -3599,7 +3599,7 @@
                 height = Integer.valueOf(heightStr);
             } catch (Exception e) {
                 height = null;
-                if (heightStr != null && heightStr.length() > 0) {
+                if (UtilValidate.isNotEmpty(heightStr)) {
                     Debug.logError(
                         "Could not parse the size value of the text element: [" + heightStr + "], setting to null; default of no height will be used",
                         module);

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Mon Nov 23 23:41:34 2009
@@ -1293,7 +1293,7 @@
         // The 'action' attribute is mandatory in a form definition,
         // even if it is empty.
         writer.append(" action=\"");
-        if (targ != null && targ.length() > 0) {
+        if (UtilValidate.isNotEmpty(targ)) {
             //this.appendOfbizUrl(writer, "/" + targ);
             WidgetWorker.buildHyperlinkUrl(writer, targ, targetType, null, null, false, false, true, request, response, context);
         }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java Mon Nov 23 23:41:34 2009
@@ -97,7 +97,7 @@
         }
 
         Map<String, String> uiLabelMap = UtilGenerics.cast(request.getAttribute("uiLabelMap"));
-        if (uiLabelMap != null && uiLabelMap.size() > 0 && context.get("uiLabelMap") == null) {
+        if (UtilValidate.isNotEmpty(uiLabelMap) && context.get("uiLabelMap") == null) {
             Debug.logInfo("Got uiLabelMap: " + uiLabelMap, module);
             context.put("uiLabelMap", uiLabelMap);
         }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java Mon Nov 23 23:41:34 2009
@@ -317,7 +317,7 @@
 
                 Authorization authz = (Authorization) context.get("authz");
                 Security security = (Security) context.get("security");
-                if (action != null && action.length() > 0) {
+                if (UtilValidate.isNotEmpty(action)) {
                     //Debug.logWarning("Deprecated method hasEntityPermission() was called; the action field should no longer be used", module);
                     // run hasEntityPermission
                     if (security.hasEntityPermission(permission, action, userLogin)) {

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java Mon Nov 23 23:41:34 2009
@@ -127,7 +127,7 @@
 
         String positionStr = fieldElement.getAttribute("position");
         try {
-            if (positionStr != null && positionStr.length() > 0) {
+            if (UtilValidate.isNotEmpty(positionStr)) {
                 position = Integer.valueOf(positionStr);
             }
         } catch (Exception e) {

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java Mon Nov 23 23:41:34 2009
@@ -313,7 +313,7 @@
 
                 Authorization authz = (Authorization) context.get("authz");
                 Security security = (Security) context.get("security");
-                if (action != null && action.length() > 0) {
+                if (UtilValidate.isNotEmpty(action)) {
                     //Debug.logWarning("Deprecated method hasEntityPermission() was called; the action field should no longer be used", module);
                     // run hasEntityPermission
                     if (security.hasEntityPermission(permission, action, userLogin)) {

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/MacroTreeRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/MacroTreeRenderer.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/MacroTreeRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/MacroTreeRenderer.java Mon Nov 23 23:41:34 2009
@@ -269,7 +269,7 @@
         HttpServletResponse response = (HttpServletResponse) context.get("response");
         HttpServletRequest request = (HttpServletRequest) context.get("request");
         
-        if (target != null && target.length() > 0) {
+        if (UtilValidate.isNotEmpty(target)) {
             WidgetWorker.buildHyperlinkUrl(linkUrl, target, link.getUrlMode(), link.getParameterList(), link.getPrefix(context),
                     link.getFullPath(), link.getSecure(), link.getEncode(), request, response, context);            
         }        

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java Mon Nov 23 23:41:34 2009
@@ -35,6 +35,7 @@
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.ObjectType;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.base.util.collections.FlexibleMapAccessor;
 import org.ofbiz.base.util.string.FlexibleStringExpander;
@@ -217,7 +218,7 @@
 
                 Authorization authz = (Authorization) context.get("authorization");
                 Security security = (Security) context.get("security");
-                if (action != null && action.length() > 0) {
+                if (UtilValidate.isNotEmpty(action)) {
                     //Debug.logWarning("Deprecated method hasEntityPermission() was called; the action field should no longer be used", module);
                     // run hasEntityPermission
                     if (security.hasEntityPermission(permission, action, userLogin)) {

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java Mon Nov 23 23:41:34 2009
@@ -431,7 +431,7 @@
             
             if (ack != null && "Success".equals(ack)) {
                 List<? extends Element> orderArrays = UtilXml.childElementList(elemResponse, "OrderArray");
-                if (orderArrays != null && orderArrays.size() > 0) {
+                if (UtilValidate.isNotEmpty(orderArrays)) {
                     totalOrders = orderArrays.size();
                 }
                 if (totalOrders > 0) {
@@ -680,7 +680,7 @@
                                     getSellerTransactionsContainingOrderList.add(orderId);
                                 }
                             }                            
-                            if (containingOrders != null && containingOrders.size() > 0) {
+                            if (UtilValidate.isNotEmpty(containingOrders)) {
                                 continue;
                             }
                             
@@ -1109,7 +1109,7 @@
                     List<GenericValue> shipInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, shippingAddressCtx.get("shippingAddressStreet1").toString(), 
                             (UtilValidate.isEmpty(shippingAddressCtx.get("shippingAddressStreet2")) ? null : shippingAddressCtx.get("shippingAddressStreet2").toString()), shippingAddressCtx.get("city").toString(), shippingAddressCtx.get("stateProvinceGeoId").toString(), 
                             shippingAddressCtx.get("shippingAddressPostalCode").toString(), null, shippingAddressCtx.get("countryGeoId").toString(), firstName, null, lastName);
-                    if (shipInfo != null && shipInfo.size() > 0) {
+                    if (UtilValidate.isNotEmpty(shipInfo)) {
                         GenericValue first = EntityUtil.getFirst(shipInfo);
                         partyId = first.getString("partyId");
                         Debug.logInfo("Existing shipping address found for : (party: " + partyId + ")", module);
@@ -1223,7 +1223,7 @@
         Debug.logInfo("Checking for existing externalId: " + externalId, module);
         GenericValue orderHeader = null;
         List<GenericValue> orderHeaderList = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId));
-        if (orderHeaderList != null && orderHeaderList.size() > 0) {
+        if (UtilValidate.isNotEmpty(orderHeaderList)) {
             orderHeader = EntityUtil.getFirst(orderHeaderList);
         }
         return orderHeader;

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java Mon Nov 23 23:41:34 2009
@@ -358,7 +358,7 @@
 
                             Element transactionElement = (Element) transactionElemIter.next();
                             List<? extends Element> containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder");                            
-                            if (containingOrders != null && containingOrders.size() > 0) {
+                            if (UtilValidate.isNotEmpty(containingOrders)) {
                                 continue;
                             }
                             order.put("amountPaid", UtilXml.childElementValue(transactionElement, "AmountPaid", "0"));

Modified: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (original)
+++ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java Mon Nov 23 23:41:34 2009
@@ -275,7 +275,7 @@
         if (responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_OK) {
             inputStream = connection.getInputStream();
             response = toString(inputStream);
-            if (response != null && response.length() > 0) {
+            if (UtilValidate.isNotEmpty(response)) {
                 result = readResponseFromGoogle(response, newProductsInGoogle, productsRemovedFromGoogle, dispatcher, delegator, locale);
                 //String msg = ServiceUtil.getErrorMessage(result);
                 if (ServiceUtil.isError(result)) {

Modified: ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java (original)
+++ ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java Mon Nov 23 23:41:34 2009
@@ -237,7 +237,7 @@
 
         // check and make sure this order doesn't already exist
         List<GenericValue> existingOrder = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId));
-        if (existingOrder != null && existingOrder.size() > 0) {
+        if (UtilValidate.isNotEmpty(existingOrder)) {
             //throw new GeneralException("Google order #" + externalId + " already exists.");
             Debug.logWarning("Google order #" + externalId + " already exists.", module);
             return;
@@ -439,7 +439,7 @@
                 shipAddr.getPostalCode(), null, getCountryGeoId(shipAddr.getCountryCode()), shipAddr.getStructuredName().getFirstName(), 
                 null, shipAddr.getStructuredName().getLastName());
         
-        if (shipInfo != null && shipInfo.size() > 0) {
+        if (UtilValidate.isNotEmpty(shipInfo)) {
             GenericValue first = EntityUtil.getFirst(shipInfo);
             shipCmId = first.getString("contactMechId");
             partyId = first.getString("partyId");
@@ -452,7 +452,7 @@
                 billAddr.getPostalCode(), null, getCountryGeoId(billAddr.getCountryCode()), billAddr.getStructuredName().getFirstName(), 
                 null, billAddr.getStructuredName().getLastName());
         
-        if (billInfo != null && billInfo.size() > 0) {
+        if (UtilValidate.isNotEmpty(billInfo)) {
             GenericValue first = EntityUtil.getFirst(billInfo);
             billCmId = first.getString("contactMechId");
             if (partyId == null) {
@@ -486,7 +486,7 @@
                     billAddr.getPostalCode(), null, getCountryGeoId(billAddr.getCountryCode()), billAddr.getStructuredName().getFirstName(), 
                     null, billAddr.getStructuredName().getLastName());
             
-            if (billInfo != null && billInfo.size() > 0) {
+            if (UtilValidate.isNotEmpty(billInfo)) {
                 GenericValue first = EntityUtil.getFirst(billInfo);
                 billCmId = first.getString("contactMechId");
            } else {
@@ -611,7 +611,7 @@
             throw e;
         }
 
-        if (cmLookup != null && cmLookup.size() > 0) {
+        if (UtilValidate.isNotEmpty(cmLookup)) {
             GenericValue v = EntityUtil.getFirst(cmLookup);
             if (v != null) {
                 cmId = v.getString("contactMechId");
@@ -661,7 +661,7 @@
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
-        if (geos != null && geos.size() > 0) {
+        if (UtilValidate.isNotEmpty(geos)) {
             return EntityUtil.getFirst(geos).getString("geoId");
         } else {
             return "_NA_";

Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/jpos/service/KeyboardService.java Mon Nov 23 23:41:34 2009
@@ -220,7 +220,7 @@
 
             // set the key modifiers
             String[] modifiers = null;
-            if (keyMod != null && keyMod.length() > 0) {
+            if (UtilValidate.isNotEmpty(keyMod)) {
                 if (keyMod.indexOf("+") != -1) {
                     modifiers = keyMod.split("\\+");
                 } else {

Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java Mon Nov 23 23:41:34 2009
@@ -138,8 +138,8 @@
         {
             Debug.logError("OUT :Java home variable is undefined", module);
         } else
-            if (iiopHost != null && iiopHost.value != null && iiopHost.value.length() > 0) {
-                if (iiopPort != null && iiopPort.value != null && iiopPort.value.length() > 0) {
+            if (iiopHost != null && UtilValidate.isNotEmpty(iiopHost.value)) {
+                if (iiopPort != null && UtilValidate.isNotEmpty(iiopPort.value)) {
                        try {
                             p = Runtime.getRuntime().exec(java_home + "\\" + "bin\\tnameserv"
                                      + " -ORBInitialPort "
@@ -162,8 +162,8 @@
         Debug.logInfo("Started Shark workflow service", module);
 
         // create the CORBA server and bind to iiop
-        if (iiopHost != null && iiopHost.value != null && iiopHost.value.length() > 0) {
-            if (iiopPort != null && iiopPort.value != null && iiopPort.value.length() > 0) {
+        if (iiopHost != null && UtilValidate.isNotEmpty(iiopHost.value)) {
+            if (iiopPort != null && UtilValidate.isNotEmpty(iiopPort.value)) {
                 try {
                     corbaServer = new SharkCORBAServer(engineName.value, iiopHost.value, iiopPort.value, shark);
                     orbThread = new Thread(this);

Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java Mon Nov 23 23:41:34 2009
@@ -177,8 +177,8 @@
 
     public boolean doesXPDLExist(RepositoryTransaction t, String xpdlId) throws RepositoryException {
         List xpdls = this.getXpdlValues(xpdlId, null, false);
-        Debug.log("Does XPDL [" + xpdlId + "] Exist - " + xpdls + "(" + (xpdls != null && xpdls.size() > 0 ? true : false) + ")", module);
-        return (xpdls != null && xpdls.size() > 0 ? true : false);
+        Debug.log(UtilValidate.isNotEmpty(xpdls) ? true : false) + ")", module);
+        return (UtilValidate.isNotEmpty(xpdls) ? true : false);
     }
 
     public boolean doesXPDLExist(RepositoryTransaction t, String xpdlId, String xpdlVersion) throws RepositoryException {

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/client/WorkflowClient.java Mon Nov 23 23:41:34 2009
@@ -251,7 +251,7 @@
      */
     public void complete(String workEffortId, String partyId, String roleTypeId, Timestamp fromDate, Map result) throws WfException {
         WfAssignment assign = WfFactory.getWfAssignment(delegator, workEffortId, partyId, roleTypeId, fromDate);
-        if (result != null && result.size() > 0)
+        if (UtilValidate.isNotEmpty(result))
             assign.setResult(result);
         assign.complete();
     }

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java Mon Nov 23 23:41:34 2009
@@ -885,7 +885,7 @@
         transitionValue.set("fromActivityId", transitionElement.getAttribute("From"));
         transitionValue.set("toActivityId", transitionElement.getAttribute("To"));
 
-        if (transitionElement.getAttribute("Loop") != null && transitionElement.getAttribute("Loop").length() > 0)
+        if (UtilValidate.isNotEmpty(transitionElement.getAttribute("Loop")))
             transitionValue.set("loopTypeEnumId", "WTL_" + transitionElement.getAttribute("Loop"));
         else
             transitionValue.set("loopTypeEnumId", "WTL_NOLOOP");
@@ -962,7 +962,7 @@
         if (joinElement != null) {
             String joinType = joinElement.getAttribute("Type");
 
-            if (joinType != null && joinType.length() > 0) {
+            if (UtilValidate.isNotEmpty(joinType)) {
                 activityValue.set("joinTypeEnumId", "WJT_" + joinType);
             }
         }
@@ -973,7 +973,7 @@
         if (splitElement != null) {
             String splitType = splitElement.getAttribute("Type");
 
-            if (splitType != null && splitType.length() > 0) {
+            if (UtilValidate.isNotEmpty(splitType)) {
                 activityValue.set("splitTypeEnumId", "WST_" + splitType);
             }
 
@@ -1183,7 +1183,7 @@
             // Length?
             String lengthStr = UtilXml.childElementValue(dataFieldElement, "Length");
 
-            if (lengthStr != null && lengthStr.length() > 0) {
+            if (UtilValidate.isNotEmpty(lengthStr)) {
                 try {
                     dataFieldValue.set("lengthBytes", Long.valueOf(lengthStr));
                 } catch (NumberFormatException e) {
@@ -1221,7 +1221,7 @@
 
             String indexStr = formalParameterElement.getAttribute("Index");
 
-            if (indexStr != null && indexStr.length() > 0) {
+            if (UtilValidate.isNotEmpty(indexStr)) {
                 try {
                     formalParameterValue.set("indexNumber", Long.valueOf(indexStr));
                 } catch (NumberFormatException e) {

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java?rev=883549&r1=883548&r2=883549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfProcessImpl.java Mon Nov 23 23:41:34 2009
@@ -79,7 +79,7 @@
      */
     public WfProcessImpl(Delegator delegator, String workEffortId) throws WfException {
         super(delegator, workEffortId);
-        if (activityId != null && activityId.length() > 0)
+        if (UtilValidate.isNotEmpty(activityId))
             throw new WfException("Execution object is not of type WfProcess.");
         this.manager = WfFactory.getWfProcessMgr(delegator, packageId, packageVersion, processId, processVersion);
         this.requester = null;