On 23 November 2013 15:33, Gary Gregory <garydgreg...@gmail.com> wrote:
> On Sat, Nov 23, 2013 at 10:30 AM, Matt Benson <gudnabr...@gmail.com> wrote:
>
>> Maurizio:
>> ISTR that, at the example of Sebb, we tend to avoid implicit boxing and
>> unboxing in the various Commons codebases including that of [lang].
>>
>
> That's the style I've been using in Commons and at work.
>
> The advantage of explicit boxing is that you can turn on auto-boxing
> warnings in your IDE and catch cases where you really do not want
> auto-boxing.

Indeed; auto-unboxing can generate an NPE under some circumstances.
And I found at least one case where the auto-boxing was hiding a bug
(sorry, no longer have the details).

Note also that removing explicit [un]boxing does not change the
generated code, so I would not class it as an optimisation.

> Gary
>
>
>> Matt
>> On Nov 23, 2013 5:12 AM, <mcucchi...@apache.org> wrote:
>>
>> > Author: mcucchiara
>> > Date: Sat Nov 23 11:11:28 2013
>> > New Revision: 1544770
>> >
>> > URL: http://svn.apache.org/r1544770
>> > Log:
>> > Minor code optimizations:
>> > * removed boxing
>> > * removed unused variables
>> > * removed useless casts* removed boxing
>> > * removed unused variables
>> > * removed useless casts
>> > * replaced asArrayList method with Arrays.asList

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to