commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Speirs <bill.spe...@gmail.com>
Subject Re: svn commit: r1205609 - in /commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils: AsyncQueryRunner.java QueryRunner.java handlers/BeanMapHandler.java handlers/ColumnListHandler.java handlers/KeyedHandler.java handlers/ScalarHandle
Date Fri, 25 Nov 2011 16:55:29 GMT
On Wed, Nov 23, 2011 at 4:47 PM, sebb <sebbaz@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-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message