On 26 February 2013 17:04, Jörg Schaible <[email protected]> wrote: > sebb wrote: > >> On 26 February 2013 10:27, Simone Tripodi <[email protected]> >> 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.
+1 > - Jörg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
