Ticket #856 (closed defect: fixed)
Opened 2011-11-01T09:32:07-05:00
Last modified 2011-11-08T11:31:57-06:00
Exception when running an IJ2 plugin that has parameters with no image
Reported by: | bdezonia | Owned by: | curtis |
---|---|---|---|
Priority: | major | Milestone: |
|
Component: | Plugin Framework | Version: | |
Severity: | serious | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
Start IJ2. Have NO image open. Run Process > Math > Subtract. An exception is thrown (if the plugin has ever run before and saved preferences):
[WARN ] Cannot convert 'imagej.ui.swing.sdi.display.SwingSdiImageDisplay@7036bb0a' to imagej.data.display.ImageDisplay
java.lang.NoSuchMethodException: imagej.data.display.ImageDisplay.<init>(java.lang.String)
at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getConstructor(Class.java:1657)
at imagej.util.ClassUtils.convert(ClassUtils.java:102)
at imagej.ext.module.AbstractModuleItem.loadValue(AbstractModuleItem.java:145)
at imagej.ext.module.ui.AbstractInputHarvester.addInput(AbstractInputHarvester.java:130)
at imagej.ext.module.ui.AbstractInputHarvester.buildPanel(AbstractInputHarvester.java:84)
at imagej.ext.module.ui.AbstractInputHarvester.harvest(AbstractInputHarvester.java:66)
at imagej.ext.plugin.AbstractInputHarvesterPlugin.process(AbstractInputHarvesterPlugin.java:75)
at imagej.ext.module.ModuleRunner.preProcess(ModuleRunner.java:88)
at imagej.ext.module.ModuleRunner.run(ModuleRunner.java:140)
at imagej.ext.module.ModuleRunner.call(ModuleRunner.java:118)
at imagej.ext.module.ModuleRunner.call(ModuleRunner.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
(In [4322]) Fix up parameter attributes.
Set visibility to private when possible. For ImageDisplay parameters,
set to required=true and persist=false, to avoid runtime exceptions.
For related tickets, see #838 and #856.