Utils/SimpleStatement.convert raises error for collection instead of collection's enclosing types

Description

Discovered via: http://stackoverflow.com/questions/31415250/datastax-java-driver-convert-scala-collections-to-java-error

If you use a type in a collection that doesn't correspond with a CQL type found in TypeCodec.getDataTypeFor the error is raised for the collection's class instead of the enclosing types class.

For example:

yields an exception on HashMap instead of SettableFuture.

The same would happen for a set/list:

There is also some code duplication between SimpleStatement.convert and Utils.convert and the error occurs in both places (from a SimpleStatement or BuildStatement).

Environment

None

Pull Requests

None

Assignee

Olivier Michallat

Reporter

Andy Tolbert

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Minor
Configure