Issue with code in a java snippet?

Hi Claire,

don’t compare Object types (e.g. Integer) with ==, but always go for the equals method instead (this is a Java fundamental, nothing KNIME specific):

if (value1.equals(value2)) { … }

The nasty thing is, sometimes == might still work, e.g. when you have values which are cached internally. So, this might explain that your workflow performed as expected under certain circumstances.


1 Like