Skip to content

Commit c95856f

Browse files
committed
Use ConvertService to get String representation of input value
This is required to correctly persist values for File[] inputs etc.
1 parent 501e2c8 commit c95856f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/org/scijava/module/DefaultModuleService.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,7 @@ public <T> void save(final ModuleItem<T> item, final T value) {
297297
return;
298298
}
299299

300-
// FIXME: Convert to string, instead of just calling toString.
301-
// Otherwise many things (e.g. File[]) are persisted improperly.
302-
final String sValue = value == null ? "" : value.toString();
300+
final String sValue = value == null ? "" : convertService.convert(value, String.class);
303301

304302
// do not persist if object cannot be converted back from a string
305303
if (!convertService.supports(sValue, item.getType())) return;

0 commit comments

Comments
 (0)