chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefane Fermigier ...@nuxeo.com>
Subject Re: svn commit: r1147715 - in /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck: ./ impl/ runner/ tests/basics/
Date Mon, 18 Jul 2011 16:02:41 GMT

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,  <sfermigier@apache.org> 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."


Mime
View raw message