Skip to content

Commit b4bd62a

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 6d82234 commit b4bd62a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
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)