See Jira issue OFBIZ-4427 https://issues.apache.org/jira/browse/OFBIZ-4427.

Ratnesh is absolutely right. UtilValidate.isEmpty and ...isNotEmpty should
only be used in places where "emptiness" is relevant. They should not be
used when all that is needed is == null or != null .

The issue has a patch that is now quite old, and a couple of unresolved
questions.

On 24 June 2016 at 00:24, Ratnesh Upadhyay <[email protected]>
wrote:

> Thanks everyone for your valuable inputs on it. I'll create logical sub
> tickets to establish this practice in OFBiz.
>
> Regards,
> Ratnesh Upadhyay
> HotWax Systems | www.hotwaxsystems.com
>
> On Mon, Jun 20, 2016 at 3:04 PM, Scott Gray <[email protected]>
> wrote:
>
> > +1, good idea thanks Ratnesh
> >
> > Regards
> > Scott
> >
> > On 18 June 2016 at 02:30, Ratnesh Upadhyay <[email protected]>
> > wrote:
> >
> > > Hello community,
> > >
> > > There are lots of places in code where we have used
> > > UtilValidate.isNotEmpty() or UtilValidate.isEmpty() for GenericValue
> > object
> > > . GenericValue is never empty. Its always null or not null. So should
> we
> > > use directly null or not null check instead of
> UtilValidate.isNotEmpty()
> > > and UtilValidate.isEmpty() for GenericValue objects ?
> > >
> > > Basically these validation methods should preferably be used on Strings
> > or
> > > Lists and normal Maps.
> > >
> > > Thanks!!
> > >
> > > Regards,
> > > Ratnesh Upadhyay
> > > HotWax Systems | www.hotwaxsystems.com
> > >
> >
>



-- 
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192
Australia

Phone: +61 3 9585 6788
Web: http://www.coherentsoftware.com.au/
Email: [email protected]

Reply via email to