scijava-common
scijava-common copied to clipboard
ClassUtils.setValue tries to set null on primitive fields
When calling ClassUtils#setValue(field, object, value) with a null value, on a primitive type field, the method ultimately tries to assign the null value to the field, which bombs out with:
java.lang.IllegalArgumentException: Can not set long field foo.bar.myField to null value
This may actually be a problem with the ConversionUtils#convert(Object, Type) method. If the Type is a primitive and the Object is null, it should not return null.
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/change-scijava-parameter-label-at-runtime/60574/6