Bug 494946 - ChangeAttributeOperation does not differentiate between attribute with null value and not contained attribute.
Summary: ChangeAttributeOperation does not differentiate between attribute with null v...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF Zest (show other bugs)
Version: 0.2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard: low-hanging fruit
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-30 13:46 EDT by Alexander Nyßen CLA
Modified: 2018-10-15 14:25 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nyßen CLA 2016-05-30 13:46:58 EDT
When retrieving the old value of an attribute, ChangeAttributeOperation does not differentiate between an attribute that is not contained in the IAttributeStore (containsKey() == false) and one whose value is mapped to null. Therefore, it does not properly restore the initial situation upon undo. 

Further, ChangeAttributeValue always sets a property with null value, in case the given new value is null. Either we need a separate operation for the case that an attribute is to be removed, or this should be specifiable.
Comment 1 Alexander Nyßen CLA 2016-05-31 02:46:09 EDT
We should rename ChangeAttributeOperation into SetAttributeOperation and augment it with an UnsetAttributeOperation.