arangodb/java-velocypack

serialize and deserialize not support generic types

zqq90 opened this issue · 3 comments

zqq90 commented

Version: 1.0.11

Test source code: https://gist.github.com/zqq90/2aa2e7aa6fdd7453e50d26cb0bc22b30

Exceptions like:

Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl cannot be cast to java.lang.Class
	at com.arangodb.velocypack.VPack.addValue(VPack.java:854)
	at com.arangodb.velocypack.VPack.serializeField(VPack.java:824)
	...
Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
	at com.arangodb.velocypack.VPack.addValue(VPack.java:854)
	at com.arangodb.velocypack.VPack.serializeField(VPack.java:824)
	...
Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
	at com.arangodb.velocypack.VPack.getValue(VPack.java:560)
	at com.arangodb.velocypack.VPack.deserializeCollection(VPack.java:597)
	...

same topic as #1

zqq90 commented

please throw Unsupport Exceptions instead of ClassCastException

Added support for generic types in release 1.4.0. (Java driver includes this in release 5.0.0)