[kepler-dev] [Bug 3984] - RequireVersion parameter cannot be deleted from a saved workflow

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Sat Apr 25 10:07:35 PDT 2009


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3984


cxh at eecs.berkeley.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from cxh at eecs.berkeley.edu  2009-04-25 10:07 -------
Fixed!
The problem was that it was not possible to delete a RequireVersion Attribute
from a saved model.  One could argue that this is good, since the
RequireVersion
attribute is a precondition for the operation of the model.  However, software
that tries to be too smart is annoying, and the reason that RequireVersion
could not be deleted is because of a bug, not because of intentional design.

The reason is because VersionAttribute.equals() matches on the version
expression.  Thus, if we had a VersionAttribute that had the value 8.0.beta
and a RequireVersion that had the value 8.0.beta, then they were seen as being
equal.

What happens is that when we read the model in, we have
VersionAttribute - which is in every model
RequireVersion - which is added by the user

When we delete RequireVersion, the equals() finds first VersionAttribute
at the top and probably deletes it. 
The reason this only fails in a saved .xml file is that upon writing the
model is when the VersionAttribute is added.

The fix/workaround is to add equals(Object) and hashCode() to RequireVersion.


More information about the Kepler-dev mailing list