On Jul 18, 2011, at 5:35 PM, Florent Guillaume wrote:
> Please don't do this.
> The code as you wrote it uses implicit unboxing, which Eclipse warns
> about (rightfully as it can cause lots of NPE (although not in this
> particular case)).
The NPE can't happen because of the nullity test. If Eclipse complains, it is
pretty stupid about it ;)
> The original code was fine, although I'd rather it be written as:
> if (Boolean.FALSE.equals(test))
Indeed, the intention is clearer this way.
Or, even clearer:
if (FALSE.equals(test))
with a static import of Boolean.FALSE.
S.
>
> Florent
>
> On Sun, Jul 17, 2011 at 11:00 PM, <[email protected]> wrote:
>> Author: sfermigier
>> Date: Sun Jul 17 21:00:50 2011
>> New Revision: 1147715
>>
>> URL: http://svn.apache.org/viewvc?rev=1147715&view=rev
>> Log:
>> Simplify.
>>
>> protected CmisTestResult assertIsFalse(Boolean test, CmisTestResult
>> success, CmisTestResult failure) {
>> - if ((test != null) && (!test.booleanValue())) {
>> + if (test != null && !test) {
>> return success;
>> }
>>
>
>
> --
> Florent Guillaume, Director of R&D, Nuxeo
> Open Source, Java EE based, Enterprise Content Management (ECM)
> http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87
--
Stefane Fermigier, Founder and Chairman, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com/ - +33 1 40 33 79 87 - http://twitter.com/sfermigier
Join the Nuxeo Group on LinkedIn: http://linkedin.com/groups?gid=43314
New Nuxeo release: http://nuxeo.com/dm54
"There's no such thing as can't. You always have a choice."