JSBML is a community-driven project to create a free, open-source, pure Java™ library for reading, writing, and manipulating SBML files (the Systems Biology Markup Language) and data streams. It is an alternative to the mixed Java/native code-based interface provided in libSBML.
When listening to changes in a model, the TreeNodeChangeListener is activated when a previously undefined double value is explicitly set to NaN but then nothing happens because we are comparing the old value with the new value using a call to the equals method here. Appearantly, undefined values are NaN behind the scenes. The setValue method still notices the difference and calls the change listeners because there the difference is identified using an != operator (see here).
My suggestion for a fix would be to change the check in AbstractTreeNode so that in addition to !equals also a check via != is performed, i.e.,
When listening to changes in a model, the
TreeNodeChangeListener
is activated when a previously undefined double value is explicitly set to NaN but then nothing happens because we are comparing the old value with the new value using a call to theequals
method here. Appearantly, undefined values are NaN behind the scenes. ThesetValue
method still notices the difference and calls the change listeners because there the difference is identified using an!=
operator (see here).My suggestion for a fix would be to change the check in
AbstractTreeNode
so that in addition to!equals
also a check via!=
is performed, i.e.,Could such a change have any unwanted effects, too?