scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

Collection type outputs not handled correctly

Open imagejan opened this issue 7 years ago • 1 comments

The following script:

[1,0.5]

returns an ArrayList that is (correctly) handled by DisplayPostprocessor:

https://github.com/scijava/scijava-common/blob/821f89fc53bd2f3ffe75c14cd35eb74d5b4e545e/src/main/java/org/scijava/display/DisplayPostprocessor.java#L149-L156

The recursively-called private handleOutput method however doesn't handle numerical outputs, resulting in the following warnings in the console:

[WARNING] Ignoring unsupported output: result [java.lang.Integer]
[WARNING] Ignoring unsupported output: result [java.math.BigDecimal]

It should instead be possible to rely on other PostprocessorPlugins to handle the collection elements, in this case org.scijava.table.ResultsPostprocessor.

@ctrueden I'm unsure how to fix this. Can we use ModuleService somehow to trigger post-processing for each element? Do we need a new service for this?

imagejan avatar Jan 17 '19 08:01 imagejan

Interestingly, the following works (showing a results table with two rows):

double[] a = [2, 2]

... while the following:

int[] a = [2, 2]

throws a console warning:

[WARNING] Ignoring unsupported output: result [[I]

imagejan avatar Jan 21 '19 08:01 imagejan