Details
Description
if (type.isAssignableFrom(Enum.class)) {
should really be:
if (type.isEnum()) {
because otherwise the only time that branch will be taken is when 'type' is exactly Enum.class or a superclass, as per the spec of isAssignableFrom. It won't be taken when the field is a concrete enum class with actual values.
If you want to stick with "isAssignableFrom" then the Enum check should be:
if (Enum.class.isAssignableFrom(type)) {