Hi Adam,

Did you have any plans to clean these up?  I don't want to start if
you're already on it.

Thanks
Scott

2008/8/13 Adam Heath <[EMAIL PROTECTED]>:
> As I've been going thru more ofbiz code, adding generics, I've discovered a
> bunch of the following pattern:
>
> ....
> List items = delegator.findByAnd(...)
> Iterator itemIt = UtilMisc.toIterator(items)
> if (itemIt != null && itemIt.hasNext()) {
> ....
>
> First off, delegator.findByAnd(and findList as well) never return null.
>  Ever.  They will return an empty list if nothing is found.  It's only
> findOne(and friends) that return null.
>
> Because items is never null, toIterator always returns an iterator.  So
> itemIt is never null.
>

Reply via email to