svn commit: r883507 [2/2] - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/payment/ applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/ applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ a...

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

svn commit: r883507 [2/2] - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/payment/ applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/ applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ a...

jleroux@apache.org
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ViewFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ViewFactory.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ViewFactory.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ViewFactory.java Mon Nov 23 21:42:18 2009
@@ -28,6 +28,7 @@
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralRuntimeException;
 import org.ofbiz.base.util.ObjectType;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.webapp.control.RequestHandler;
 
 /**
@@ -76,7 +77,7 @@
     }
 
     public ViewHandler getViewHandler(String type) throws ViewHandlerException {
-        if (type == null || type.length() == 0) {
+        if (UtilValidate.isEmpty(type)) {
             type = "default";
         }
 

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java Mon Nov 23 21:42:18 2009
@@ -38,6 +38,7 @@
 import org.ofbiz.base.location.FlexibleLocation;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.GenericValue;
 
 import freemarker.ext.beans.BeansWrapper;
@@ -66,7 +67,7 @@
 
         if (request == null)
             throw new ViewHandlerException("Null HttpServletRequest object");
-        if (page == null || page.length() == 0)
+        if (UtilValidate.isEmpty(page))
             throw new ViewHandlerException("Null or empty source");
 
         if (Debug.infoOn()) Debug.logInfo("Retreiving HTTP resource at: " + page, module);

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java Mon Nov 23 21:42:18 2009
@@ -246,7 +246,7 @@
             } else {
                 value = UtilProperties.getMessage(resource, property, locale);
             }
-            if (value == null || value.length() == 0) {
+            if (UtilValidate.isEmpty(value)) {
                 value = this.defaultExdr.expandString(context);
             }
 

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=883507&r1=883506&r2=883507&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 21:42:18 2009
@@ -995,7 +995,7 @@
             return title.expandString(context);
         } else {
             // create a title from the name of this field; expecting a Java method/field style name, ie productName or productCategoryId
-            if (this.name == null || this.name.length() == 0) {
+            if (UtilValidate.isEmpty(this.name)) {
                 // this should never happen, ie name is required
                 return "";
             }
@@ -2081,7 +2081,7 @@
             } else {
                 retVal = this.modelFormField.getEntry(context);
             }
-            if (retVal == null || retVal.length() == 0) {
+            if (UtilValidate.isEmpty(retVal)) {
                 retVal = "";
             } else if ("currency".equals(type)) {
                 retVal = retVal.replaceAll(" ", " "); // FIXME : encoding currency is a problem for some locale, we should not have any   in retVal other case may arise in future...
@@ -2211,10 +2211,10 @@
                 retVal = this.description.expandString(localContext, locale);
             }
             // try to get the entry for the field if description doesn't expand to anything
-            if (retVal == null || retVal.length() == 0) {
+            if (UtilValidate.isEmpty(retVal)) {
                 retVal = fieldValue;
             }
-            if (retVal == null || retVal.length() == 0) {
+            if (UtilValidate.isEmpty(retVal)) {
                 retVal = "";
             }
             return retVal;

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java Mon Nov 23 21:42:18 2009
@@ -303,7 +303,7 @@
             } else {
                 value = UtilProperties.getMessage(resource, property, locale);
             }
-            if (value == null || value.length() == 0) {
+            if (UtilValidate.isEmpty(value)) {
                 value = this.defaultExdr.expandString(context);
             }
 

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java Mon Nov 23 21:42:18 2009
@@ -371,7 +371,7 @@
             } else {
                 value = UtilProperties.getMessage(resource, property, locale);
             }
-            if (value == null || value.length() == 0) {
+            if (UtilValidate.isEmpty(value)) {
                 value = this.defaultExdr.expandString(context);
             }
 

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=883507&r1=883506&r2=883507&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 21:42:18 2009
@@ -84,25 +84,25 @@
         ContainerConfig.Container.Property iiopPort = cfg.getProperty("iiop-port");
 
         // check the required delegator-name property
-        if (delegatorProp == null || delegatorProp.value == null || delegatorProp.value.length() == 0) {
+        if (delegatorProp == null || UtilValidate.isEmpty(delegatorProp.value)) {
             throw new ContainerException("Invalid delegator-name defined in container configuration");
         }
 
         // check the required dispatcher-name property
-        if (dispatcherProp == null || dispatcherProp.value == null || dispatcherProp.value.length() == 0) {
+        if (dispatcherProp == null || UtilValidate.isEmpty(dispatcherProp.value)) {
             throw new ContainerException("Invalid dispatcher-name defined in container configuration");
         }
 
         // check the required admin-user property
-        if (adminProp == null || adminProp.value == null || adminProp.value.length() == 0) {
+        if (adminProp == null || UtilValidate.isEmpty(adminProp.value)) {
             throw new ContainerException("Invalid admin-user defined in container configuration");
         }
 
-        if (adminPassProp == null || adminPassProp.value == null || adminPassProp.value.length() == 0) {
+        if (adminPassProp == null || UtilValidate.isEmpty(adminPassProp.value)) {
             throw new ContainerException("Invalid admin-pass defined in container configuration");
         }
 
-        if (engineName == null || engineName.value == null || engineName.value.length() == 0) {
+        if (engineName == null || UtilValidate.isEmpty(engineName.value)) {
             throw new ContainerException("Invalid engine-name defined in container configuration");
         }
 

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/ServiceCondition.java Mon Nov 23 21:42:18 2009
@@ -43,7 +43,7 @@
     public Boolean evaluateCondition(Map context, Map attrs, String expression, DispatchContext dctx) throws EvaluationException {
         // get the service to call
         String serviceName = (String) attrs.get("serviceName");
-        if (serviceName == null || serviceName.length() == 0)
+        if (UtilValidate.isEmpty(serviceName))
             throw new EvaluationException("Invalid serviceName; be sure to set the serviceName ExtendedAttribute");
 
         // get the dispatcher

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfActivityImpl.java Mon Nov 23 21:42:18 2009
@@ -81,7 +81,7 @@
 
     public WfActivityImpl(Delegator delegator, String workEffortId) throws WfException {
         super(delegator, workEffortId);
-        if (activityId == null || activityId.length() == 0)
+        if (UtilValidate.isEmpty(activityId))
             throw new WfException("Execution object is not of type WfActivity");
         this.processId = getRuntimeObject().getString("workEffortParentId");
     }

Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java?rev=883507&r1=883506&r2=883507&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java (original)
+++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/impl/WfExecutionObjectImpl.java Mon Nov 23 21:42:18 2009
@@ -692,7 +692,7 @@
      * @throws WfException
      */
     protected boolean evalBshCondition(String expression, Map context) throws WfException {
-        if (expression == null || expression.length() == 0) {
+        if (UtilValidate.isEmpty(expression)) {
             Debug.logVerbose("Null or empty expression, returning true.", module);
             return true;
         }