On 26 February 2013 17:04, Jörg Schaible <joerg.schai...@scalaris.com> wrote: > sebb wrote: > >> On 26 February 2013 10:27, Simone Tripodi <simonetrip...@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.
+1 > - Jörg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org