commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@scalaris.com>
Subject Re: svn commit: r1449929 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/bag/AbstractMapBag.java
Date Tue, 26 Feb 2013 17:04:57 GMT
sebb wrote:

> On 26 February 2013 10:27, Simone Tripodi <simonetripodi@apache.org>
> wrote:
>>> it is not safe, and it will throw an ArrayStoreException in this case,
>>> which is documented in the throws clause.
>>>
>>
>> OK I just read the commit, unless it is documented it is fine for me
> 
> Should still be documented on the @SuppressWarnings line please, but
> can refer to Javadoc.

In that case I typically prefer the suppression as close as possible, i.e.:

=========== %< =========
 if (array.length < size)
 {
   @SuppressWarnings("unchecked")
   T[] unchecked = Array.newInstance(array.getClass().getComponentType(), 
size);
   array = unchecked;
 }
=========== %< =========

Otherwise you might suppress more than wanted.

- Jörg


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


Mime
View raw message