Skip to content

Commit c811481

Browse files
committed
Fix tiny bug
Example: input type is "MyMultiOutputListener" (my subclass of MultiOutputListener), then the check would suceed, since I can assign this type to MultiOutputListener. When I try to assign NodeModuleOutputChangedListener, it would throw an IllegalArgumentException. If we would just simply switch to testing whether the item type is assignable from MultiOutputListener, it could also be Object, which would also resolve Object inputs with our logic here, which is not intended. A simple check for the class being exactly MultiOutputListener.class is therefore suficient. Signed-off-by: Squareys <[email protected]>
1 parent fbd8bef commit c811481

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

org.knime.scijava.commands/src/org/knime/scijava/commands/module/DefaultNodeModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private void preProcess(final Map<String, Object> params) {
9696
}
9797

9898
for (final ModuleItem<?> item : this.module.getInfo().inputs()) {
99-
if (MultiOutputListener.class.isAssignableFrom(item.getType())) {
99+
if (MultiOutputListener.class.equals(item.getType())) {
100100
final String name = item.getName();
101101

102102
module.setInput(name, outputListener);

0 commit comments

Comments
 (0)