[ 
https://issues.apache.org/jira/browse/OFBIZ-770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477745
 ] 

Jacopo Cappellato commented on OFBIZ-770:
-----------------------------------------

Stefan,

two issues in your patch:

1) the format of it doesn't look right; there should be the following sections:
Index: applications/content/src/org/ofbiz/content/content/ContentServices.java
===================================================================

before each file modified

2) in TruitionCoReg.java the following modifications change the behavior of the 
logic:

-                if (emCol == null || emCol.size() == 0) {
+                if (UtilValidate.isEmpty(emCol)) {
                     emCol = ContactHelper.getContactMech(party, null, 
"EMAIL_ADDRESS", false);
-                }
-                if (emCol != null && emCol.size() > 0) {
-                    GenericValue emVl = (GenericValue) emCol.iterator().next();
+                } else {
+                     GenericValue emVl = (GenericValue) 
emCol.iterator().next();
                     if (emVl != null) {
                         emailAddress = emVl.getString("infoString");
                     }

I've committed (rev. 514366) a modified version of your patch, thanks.

Jacopo


> Use UtilValidate.is(Not)Empty methods instead of repeated (obj == null) || 
> (obj.size == 0)
> ------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-770
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-770
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>    Affects Versions: SVN trunk
>            Reporter: Stefan Huehner
>            Priority: Trivial
>         Attachments: ofbiz_isEmpty1.diff
>
>
> Hi,
> this task is to keep track of the conversion of hardcoded isEmpty checks to 
> the existing UtilValidate methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to