scijava-common
scijava-common copied to clipboard
Boolean parameters "required but unset" if set to false
When using a (script) parameter that was not persisted (yet), like:
#@ Boolean somethingNeverPersisted
println somethingNeverPersisted
or
#@ Boolean (persist=false) somethingNeverPersisted
println somethingNeverPersisted
... and leaving the checkbox unchecked, you get the error message:
'somethingNeverPersisted' is required but unset
... making it impossible to input false.
The workaround is to always provide a default value:
#@ Boolean (value=false) somethingNeverPersisted
println somethingNeverPersisted