You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Ratnesh Upadhyay <up...@gmail.com> on 2016/06/17 14:30:51 UTC

Use of utility method for checking null GenericValue

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

Re: Use of utility method for checking null GenericValue

Posted by Deepak Dixit <de...@hotwaxsystems.com>.
I agree, we have to start using null check for generic value.


Thanks & Regards
--
Deepak Dixit
www.hotwaxsystems.com

On Sat, Jun 18, 2016 at 11:16 AM, Devanshu Vyas <
devanshu.vyas@hotwaxsystems.com> wrote:

> Completely makes sense.
>
> +1
>
>
> --
> Thanks and Regards,
> Devanshu Vyas
>
> HotWax Systems
> *https://www.hotwaxsystems.com <https://www.hotwaxsystems.com>*
>
> On Fri, Jun 17, 2016 at 8:00 PM, Ratnesh Upadhyay <
> upadhyay.ratnesh@gmail.com> 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
> >
>

Re: Use of utility method for checking null GenericValue

Posted by Devanshu Vyas <de...@hotwaxsystems.com>.
Completely makes sense.

+1


--
Thanks and Regards,
Devanshu Vyas

HotWax Systems
*https://www.hotwaxsystems.com <https://www.hotwaxsystems.com>*

On Fri, Jun 17, 2016 at 8:00 PM, Ratnesh Upadhyay <
upadhyay.ratnesh@gmail.com> 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
>

Re: Use of utility method for checking null GenericValue

Posted by Amardeep Singh Jhajj <am...@hotwaxsystems.com>.
+1

Thanks & Regards,
--
Amardeep Singh Jhajj

On Fri, Jun 17, 2016 at 8:00 PM, Ratnesh Upadhyay <
upadhyay.ratnesh@gmail.com> 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
>

Re: Use of utility method for checking null GenericValue

Posted by Nicolas Malin <ni...@nereide.fr>.
I agree, it's easy et native to compare a null value instead of call a 
UtilValidate.isEmpty() method

Nicolas

Le 17/06/2016 16:30, Ratnesh Upadhyay a �crit :
> 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
>


Re: Use of utility method for checking null GenericValue

Posted by Ashish Vijaywargiya <as...@hotwaxsystems.com>.
+1

--
Kind Regards
Ashish Vijaywargiya
HotWax Systems - est. 1997

On Sat, Jun 18, 2016 at 3:51 PM, Pranay Pandey <
pranay.pandey@hotwaxsystems.com> wrote:

> Yes Deepak, IMO we should change it for existing code as well, because this
> type of checks some times cause functional issues on null checks on
> GenericValue.
>
> My vote will be to go for it.
>
> Best regards,
>
> Pranay Pandey
> HotWax Systems
> http://www.hotwaxsystems.com/
>
> On Sat, Jun 18, 2016 at 3:09 PM, Deepak Dixit <
> deepak.dixit@hotwaxsystems.com> wrote:
>
> > I think we can make it part of best practice and use for new code.
> > For old code, Do we need to change existing code?
> >
> > Thanks & Regards
> > --
> > Deepak Dixit
> > www.hotwaxsystems.com
> >
> > On Sat, Jun 18, 2016 at 1:36 PM, Michael Brohl <michael.brohl@ecomify.de
> >
> > wrote:
> >
> > > +1
> > >
> > > Michael Brohl
> > > ecomify GmbH
> > > www.ecomify.de
> > >
> > >
> > > Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
> > >
> > > 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
> > >>
> > >>
> > >
> > >
> >
>

Re: Use of utility method for checking null GenericValue

Posted by Pranay Pandey <pr...@hotwaxsystems.com>.
+1 Jacques.

Best regards,

Pranay Pandey
HotWax Systems
http://www.hotwaxsystems.com/

On Mon, Jun 20, 2016 at 11:35 AM, Pranay Pandey <
pranay.pandey@hotwaxsystems.com> wrote:

> + Jacques.
>
> Best regards,
>
> Pranay Pandey
> HotWax Systems
> http://www.hotwaxsystems.com/
>
> On Sat, Jun 18, 2016 at 5:19 PM, Jacques Le Roux <
> jacques.le.roux@les7arts.com> wrote:
>
>> And also because else people tends to reproduce by C/P blocks of code
>>
>> Jacques
>>
>>
>>
>> Le 18/06/2016 à 12:21, Pranay Pandey a écrit :
>>
>>> Yes Deepak, IMO we should change it for existing code as well, because
>>> this
>>> type of checks some times cause functional issues on null checks on
>>> GenericValue.
>>>
>>> My vote will be to go for it.
>>>
>>> Best regards,
>>>
>>> Pranay Pandey
>>> HotWax Systems
>>> http://www.hotwaxsystems.com/
>>>
>>> On Sat, Jun 18, 2016 at 3:09 PM, Deepak Dixit <
>>> deepak.dixit@hotwaxsystems.com> wrote:
>>>
>>> I think we can make it part of best practice and use for new code.
>>>> For old code, Do we need to change existing code?
>>>>
>>>> Thanks & Regards
>>>> --
>>>> Deepak Dixit
>>>> www.hotwaxsystems.com
>>>>
>>>> On Sat, Jun 18, 2016 at 1:36 PM, Michael Brohl <
>>>> michael.brohl@ecomify.de>
>>>> wrote:
>>>>
>>>> +1
>>>>>
>>>>> Michael Brohl
>>>>> ecomify GmbH
>>>>> www.ecomify.de
>>>>>
>>>>>
>>>>> Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
>>>>>
>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>
>

Re: Use of utility method for checking null GenericValue

Posted by Pranay Pandey <pr...@hotwaxsystems.com>.
+ Jacques.

Best regards,

Pranay Pandey
HotWax Systems
http://www.hotwaxsystems.com/

On Sat, Jun 18, 2016 at 5:19 PM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

> And also because else people tends to reproduce by C/P blocks of code
>
> Jacques
>
>
>
> Le 18/06/2016 à 12:21, Pranay Pandey a écrit :
>
>> Yes Deepak, IMO we should change it for existing code as well, because
>> this
>> type of checks some times cause functional issues on null checks on
>> GenericValue.
>>
>> My vote will be to go for it.
>>
>> Best regards,
>>
>> Pranay Pandey
>> HotWax Systems
>> http://www.hotwaxsystems.com/
>>
>> On Sat, Jun 18, 2016 at 3:09 PM, Deepak Dixit <
>> deepak.dixit@hotwaxsystems.com> wrote:
>>
>> I think we can make it part of best practice and use for new code.
>>> For old code, Do we need to change existing code?
>>>
>>> Thanks & Regards
>>> --
>>> Deepak Dixit
>>> www.hotwaxsystems.com
>>>
>>> On Sat, Jun 18, 2016 at 1:36 PM, Michael Brohl <michael.brohl@ecomify.de
>>> >
>>> wrote:
>>>
>>> +1
>>>>
>>>> Michael Brohl
>>>> ecomify GmbH
>>>> www.ecomify.de
>>>>
>>>>
>>>> Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
>>>>
>>>> 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
>>>>>
>>>>>
>>>>>
>>>>
>

Re: Use of utility method for checking null GenericValue

Posted by Ashish Vijaywargiya <as...@hotwaxsystems.com>.
Big +1 :-)

--
Kind Regards
Ashish Vijaywargiya
HotWax Systems - est. 1997

On Sat, Jun 18, 2016 at 5:19 PM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

> And also because else people tends to reproduce by C/P blocks of code
>
> Jacques
>
>
>
> Le 18/06/2016 à 12:21, Pranay Pandey a écrit :
>
>> Yes Deepak, IMO we should change it for existing code as well, because
>> this
>> type of checks some times cause functional issues on null checks on
>> GenericValue.
>>
>> My vote will be to go for it.
>>
>> Best regards,
>>
>> Pranay Pandey
>> HotWax Systems
>> http://www.hotwaxsystems.com/
>>
>> On Sat, Jun 18, 2016 at 3:09 PM, Deepak Dixit <
>> deepak.dixit@hotwaxsystems.com> wrote:
>>
>> I think we can make it part of best practice and use for new code.
>>> For old code, Do we need to change existing code?
>>>
>>> Thanks & Regards
>>> --
>>> Deepak Dixit
>>> www.hotwaxsystems.com
>>>
>>> On Sat, Jun 18, 2016 at 1:36 PM, Michael Brohl <michael.brohl@ecomify.de
>>> >
>>> wrote:
>>>
>>> +1
>>>>
>>>> Michael Brohl
>>>> ecomify GmbH
>>>> www.ecomify.de
>>>>
>>>>
>>>> Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
>>>>
>>>> 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
>>>>>
>>>>>
>>>>>
>>>>
>

Re: Use of utility method for checking null GenericValue

Posted by Jacques Le Roux <ja...@les7arts.com>.
And also because else people tends to reproduce by C/P blocks of code

Jacques


Le 18/06/2016 � 12:21, Pranay Pandey a �crit :
> Yes Deepak, IMO we should change it for existing code as well, because this
> type of checks some times cause functional issues on null checks on
> GenericValue.
>
> My vote will be to go for it.
>
> Best regards,
>
> Pranay Pandey
> HotWax Systems
> http://www.hotwaxsystems.com/
>
> On Sat, Jun 18, 2016 at 3:09 PM, Deepak Dixit <
> deepak.dixit@hotwaxsystems.com> wrote:
>
>> I think we can make it part of best practice and use for new code.
>> For old code, Do we need to change existing code?
>>
>> Thanks & Regards
>> --
>> Deepak Dixit
>> www.hotwaxsystems.com
>>
>> On Sat, Jun 18, 2016 at 1:36 PM, Michael Brohl <mi...@ecomify.de>
>> wrote:
>>
>>> +1
>>>
>>> Michael Brohl
>>> ecomify GmbH
>>> www.ecomify.de
>>>
>>>
>>> Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
>>>
>>> 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
>>>>
>>>>
>>>


Re: Use of utility method for checking null GenericValue

Posted by Pranay Pandey <pr...@hotwaxsystems.com>.
Yes Deepak, IMO we should change it for existing code as well, because this
type of checks some times cause functional issues on null checks on
GenericValue.

My vote will be to go for it.

Best regards,

Pranay Pandey
HotWax Systems
http://www.hotwaxsystems.com/

On Sat, Jun 18, 2016 at 3:09 PM, Deepak Dixit <
deepak.dixit@hotwaxsystems.com> wrote:

> I think we can make it part of best practice and use for new code.
> For old code, Do we need to change existing code?
>
> Thanks & Regards
> --
> Deepak Dixit
> www.hotwaxsystems.com
>
> On Sat, Jun 18, 2016 at 1:36 PM, Michael Brohl <mi...@ecomify.de>
> wrote:
>
> > +1
> >
> > Michael Brohl
> > ecomify GmbH
> > www.ecomify.de
> >
> >
> > Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
> >
> > 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
> >>
> >>
> >
> >
>

Re: Use of utility method for checking null GenericValue

Posted by Deepak Dixit <de...@hotwaxsystems.com>.
I think we can make it part of best practice and use for new code.
For old code, Do we need to change existing code?

Thanks & Regards
--
Deepak Dixit
www.hotwaxsystems.com

On Sat, Jun 18, 2016 at 1:36 PM, Michael Brohl <mi...@ecomify.de>
wrote:

> +1
>
> Michael Brohl
> ecomify GmbH
> www.ecomify.de
>
>
> Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
>
> 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
>>
>>
>
>

Re: Use of utility method for checking null GenericValue

Posted by Michael Brohl <mi...@ecomify.de>.
+1

Michael Brohl
ecomify GmbH
www.ecomify.de


Am 17.06.16 um 16:30 schrieb Ratnesh Upadhyay:
> 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
>



Re: Use of utility method for checking null GenericValue

Posted by Mohammad Kathawala <mo...@hotwaxsystems.com>.
 Makes sense to me. If we can simply do the null check, then we should not
use UtilValidate.isNotEmpty() and increase the overhead.

+1

On Sat, Jun 18, 2016 at 10:13 AM, Pranay Pandey <
pranay.pandey@hotwaxsystems.com> wrote:

> +1
>
> Best regards,
>
> Pranay Pandey
> HotWax Systems
> http://www.hotwaxsystems.com/
>
> On Fri, Jun 17, 2016 at 8:00 PM, Ratnesh Upadhyay <
> upadhyay.ratnesh@gmail.com> 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
> >
>



-- 
Regards,
Mohammad Kathawala
Technical Consultant / Team Lead,
Hotwax Systems,
mohammad.kathawala@hotwaxsystems.com <mo...@hotwaxmedia.com>

Re: Use of utility method for checking null GenericValue

Posted by Pranay Pandey <pr...@hotwaxsystems.com>.
+1

Best regards,

Pranay Pandey
HotWax Systems
http://www.hotwaxsystems.com/

On Fri, Jun 17, 2016 at 8:00 PM, Ratnesh Upadhyay <
upadhyay.ratnesh@gmail.com> 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
>

Re: Use of utility method for checking null GenericValue

Posted by Paul Foxworthy <pa...@cohsoft.com.au>.
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 <up...@gmail.com>
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 <sc...@hotwaxsystems.com>
> wrote:
>
> > +1, good idea thanks Ratnesh
> >
> > Regards
> > Scott
> >
> > On 18 June 2016 at 02:30, Ratnesh Upadhyay <up...@gmail.com>
> > 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: info@coherentsoftware.com.au

Re: Use of utility method for checking null GenericValue

Posted by Ratnesh Upadhyay <up...@gmail.com>.
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 <sc...@hotwaxsystems.com>
wrote:

> +1, good idea thanks Ratnesh
>
> Regards
> Scott
>
> On 18 June 2016 at 02:30, Ratnesh Upadhyay <up...@gmail.com>
> 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
> >
>

Re: Use of utility method for checking null GenericValue

Posted by Scott Gray <sc...@hotwaxsystems.com>.
+1, good idea thanks Ratnesh

Regards
Scott

On 18 June 2016 at 02:30, Ratnesh Upadhyay <up...@gmail.com>
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
>

Re: Use of utility method for checking null GenericValue

Posted by Ashish Vijaywargiya <as...@hotwaxsystems.com>.
+1

--
Kind Regards
Ashish Vijaywargiya
HotWax Systems - est. 1997

On Fri, Jun 17, 2016 at 8:00 PM, Ratnesh Upadhyay <
upadhyay.ratnesh@gmail.com> 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
>