commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Speirs <>
Subject Re: svn commit: r1205609 - in /commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils: handlers/ handlers/ handlers/ handlers/ScalarHandle
Date Fri, 25 Nov 2011 16:55:29 GMT
On Wed, Nov 23, 2011 at 4:47 PM, sebb <> 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?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message