You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2010/02/03 02:44:24 UTC

svn commit: r905863 - in /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form: ModelForm.java ModelFormField.java

Author: adrianc
Date: Wed Feb  3 01:44:24 2010
New Revision: 905863

URL: http://svn.apache.org/viewvc?rev=905863&view=rev
Log:
As discussed on the dev mailing list, eliminated checks for FlexibleStringExpander.getOriginal() returning null. Use FlexibleStringExpander.isEmpty() instead.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

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=905863&r1=905862&r2=905863&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 Wed Feb  3 01:44:24 2010
@@ -2935,22 +2935,22 @@
         }
         if (this.actions != null) {
             for (ModelFormAction modelFormAction: this.actions) {
-                if (modelFormAction instanceof ModelFormAction.Service) {
-                    String serviceName = ((ModelFormAction.Service) modelFormAction).serviceNameExdr.getOriginal();
-                    if (serviceName != null) {
-                        allServiceNamesUsed.add(serviceName);
+                try {
+                    ModelFormAction.Service service = (ModelFormAction.Service) modelFormAction;
+                    if (!service.serviceNameExdr.isEmpty()) {
+                        allServiceNamesUsed.add(service.serviceNameExdr.toString());
                     }
-                }
+                } catch (ClassCastException e) {}
             }
         }
         if (this.rowActions != null) {
             for (ModelFormAction modelFormAction: this.rowActions) {
-                if (modelFormAction instanceof ModelFormAction.Service) {
-                    String serviceName = ((ModelFormAction.Service) modelFormAction).serviceNameExdr.getOriginal();
-                    if (serviceName != null) {
-                        allServiceNamesUsed.add(serviceName);
+                try {
+                    ModelFormAction.Service service = (ModelFormAction.Service) modelFormAction;
+                    if (!service.serviceNameExdr.isEmpty()) {
+                        allServiceNamesUsed.add(service.serviceNameExdr.toString());
                     }
-                }
+                } catch (ClassCastException e) {}
             }
         }
         for (ModelFormField modelFormField: this.fieldList) {

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=905863&r1=905862&r2=905863&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 Wed Feb  3 01:44:24 2010
@@ -277,7 +277,7 @@
             this.fieldName = overrideFormField.fieldName;
         if (UtilValidate.isNotEmpty(overrideFormField.attributeName))
             this.attributeName = overrideFormField.attributeName;
-        if (overrideFormField.title != null && overrideFormField.title.getOriginal() != null) // title="" can be used to override the original value
+        if (overrideFormField.title != null && !overrideFormField.title.isEmpty()) // title="" can be used to override the original value
             this.title = overrideFormField.title;
         if (overrideFormField.tooltip != null && !overrideFormField.tooltip.isEmpty())
             this.tooltip = overrideFormField.tooltip;
@@ -860,7 +860,7 @@
     }
 
     public String getAction(Map<String, ? extends Object> context) {
-        if (this.action != null && this.action.getOriginal() != null) {
+        if (this.action != null && !this.action.isEmpty()) {
             return action.expandString(context);
         } else {
             return null;
@@ -991,7 +991,7 @@
     }
 
     public String getTitle(Map<String, Object> context) {
-        if (this.title != null && this.title.getOriginal() != null) {
+        if (this.title != null && !this.title.isEmpty()) {
             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