Hi Jacques and Adrian,

I understand the issue in general for custom classes: if we want to use them
with UtilValidate.isEmpty, we need to implement the IsEmpty interface.

But FlexibleStringExpander *does* implement IsEmpty as an abstract method.
Its descendant, ArrayOffsetString, implements it to always return false. See 

https://fisheye6.atlassian.com/browse/~br=trunk/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java?r=1170125#to479

Is that implementation wrong or naive?

Cheers

Paul Foxworthy


Jacques Le Roux wrote:
> 
> Thanks Adrian,
> 
> Indeed it seems to have fixed the issue.
> We should now care about cases where a custom object is passed to
> UtilValidate.is(No)tEmpty().
> I will have a look at possible existing issue (there were already some
> undetected so far in ModelFormField)
> 
> For the moment in ObjectType.isEmpty() we return false for all other
> objects than
> String
> Collection
> Map
> CharSequence
> IsEmpty
> There is a Debug.logVerbose. but I wonder if we should not use reflection
> to check if  IsEmpty() is implemented or not for custom 
> objets. This is not well thought at this stage, but I think you guess the
> idea (ie to prevent the issue we crossed).
> 
> Jacques
> 
> From: "Adrian Crum" <adrian.c...@sandglass-software.com>
>> Rev 1170125 should solve the UtilValidate problem.
>>
>> -Adrian
>>
>> On 9/13/2011 11:56 AM, Jacques Le Roux wrote:
>>> I'm also curious about it. It 's a bummer but I have no time atm to get
>>> it into details. I reverted my changes in ModelFormField
>>> class to r1169754. Trunk will be back correctly again soon...
>>>
>>> Jacques
>>>
>>> From: "Adrian Crum" <adrian.c...@sandglass-software.com>
>>>> Just curious - why can't UtilValidate check for an empty FSE?
>>>>
>>>> -Adrian
>>>>
>>>> On 9/13/2011 11:45 AM, Jacques Le Roux wrote:
>>>>> OK I see this is because there are more FlexibleStringExpanders than
>>>>> description (UtilValidate.is(No)tEmpty() can't be used ) ,
>>>>> reverting all those... I will restart trunk after...
>>>>>
>>>>> Jacques
>>>>>
>>>>> From: "Hans Bakker" <mailingl...@antwebsystems.com>
>>>>>> Jacques , because of your refactoring we are now the second day in
>>>>>> the
>>>>>> problems,
>>>>>>
>>>>>> the trunk is back, but have a look at the header of the invoices
>>>>>> list....
>>>>>>
>>>>>> this is only an example...most are wrong
>>>>>>
>>>>>> Regards,
>>>>>> Hans
>>>>>>
>>>>>>
>>>>>> On Tue, 2011-09-13 at 12:17 +0200, Jacques Le Roux wrote:
>>>>>>> It's now fixed, the trunk demo is back again
>>>>>>>
>>>>>>> Jacques
>>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> Ofbiz on twitter: http://twitter.com/apache_ofbiz
>>>>>> Alternative ofbiz website: http://www.ofbiz.info
>>>>>> http://www.antwebsystems.com : Quality services for competitive
>>>>>> rates.
>>>>>>
>>>>>
>>>>>
>>>
>>>
> 

--
View this message in context: 
http://ofbiz.135035.n4.nabble.com/Wrong-demo-data-in-trunk-demo-tp3809659p3811641.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to