On Wed, Nov 23, 2011 at 4:47 PM, sebb <seb...@gmail.com> wrote: >> - @SuppressWarnings("unchecked") >> + @SuppressWarnings("unchecked") // cast exception will immediately be >> thrown and warn the developer > > Sorry to keep going on about this, but that does not fully explain why > it is safe to ignore the unchecked cast. > And it does nothing to tell the user of the API that they may get a > CCE or what they need to do to avoid it. > > In this case, what ensures that the cast will succeed? > Does that condition always hold? > If not, the Javadoc needs to say under what conditions the CCE will occur. >
As we discussed before, this exception will be thrown if the column type doesn't match the generic type. Because of type erasure I don't know of any way to validate the types. Sebb, are you advocating putting an @throws ClassCastException in the Javadocs stating that if the column type doesn't match the generic type, then this exception will be thrown? What would others like to see for documentation here? Thanks! Bill- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org