droidparts icon indicating copy to clipboard operation
droidparts copied to clipboard

ArrayCollectionConverter is used instead of ByteArrayConverter for byte[]

Open amayatsky opened this issue 6 years ago • 0 comments

ArrayCollectionConverter is used instead of ByteArrayConverter for byte[] leading to crash: SQLiteException: Unable to convert BLOB to string

After I've migrated from 2.7.7 to 3.2.5 I am getting this error. Looks like (converter.getDBColumnType() == BLOB) at L171 doesn't evaluate to true, since ByteConverter returns INTEGER, thus ArrayCollectionConverter tries to get a String at L175. At this moment I solve this by calling ConverterRegistry.registerConverter(new ByteArrayConverter()); which puts it at index 0 of the registry.

Maybe the ArrayCollectionConverter.canHandle(Class<?> cls) should return false for byte[]?

amayatsky avatar Feb 01 '19 08:02 amayatsky