svn commit: r892037 - /ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy

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

svn commit: r892037 - /ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy

lektran
Author: lektran
Date: Fri Dec 18 00:45:21 2009
New Revision: 892037

URL: http://svn.apache.org/viewvc?rev=892037&view=rev
Log:
Removed unnecessary use of UtilValidate.isNotEmpty, Groovy Truth handles this natively and returns true only for lists that are both not null AND not empty

Modified:
    ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy

Modified: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy?rev=892037&r1=892036&r2=892037&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy (original)
+++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy Fri Dec 18 00:45:21 2009
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-import org.ofbiz.base.util.UtilValidate;
-
 // figure out the MARKETING_EMAIL of the ContactList owner, for setting in the send email link
 if (!contactList && contactListId) {
     contactList = delegator.findOne("ContactList", [contactListId : "contactListId"], true);
@@ -27,11 +25,11 @@
     ownerParty = contactList.getRelatedOne("OwnerParty");
     if (ownerParty) {
         contactMechs = ownerParty.getRelatedByAnd("PartyContactMechPurpose", [contactMechPurposeTypeId : "MARKETING_EMAIL"]);
-        if (!contactMechs || contactMechs.size() == 0) {
+        if (!contactMechs) {
             contactMechs = ownerParty.getRelatedByAnd("PartyContactMechPurpose", [contactMechPurposeTypeId : "PRIMARY_EMAIL"]);
         }
         
-        if (UtilValidate.isNotEmpty(contactMechs)) {
+        if (contactMechs) {
             context.marketingEmail = contactMechs.get(0);
             //context.contactMechIdFrom = context.marketingEmail.contactMechId;
         }