Skip to content

Commit db432d8

Browse files
committed
ClassUtils#setValue: use more exact field type
Rather than calling field.getGenericType(), let's use the superior GenericUtils.getFieldType method to get the more exact generic type.
1 parent ed89c85 commit db432d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/scijava/util/ClassUtils.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ public static void setValue(final Field field, final Object instance,
363363
{
364364
try {
365365
field.setAccessible(true);
366-
final Type fieldType = field.getGenericType();
366+
final Type fieldType =
367+
GenericUtils.getFieldType(field, instance.getClass());
367368
field.set(instance, ConversionUtils.convert(value, fieldType));
368369
}
369370
catch (final IllegalAccessException e) {

0 commit comments

Comments
 (0)