Implemented a Ray-proposed solution where we keep track of events that were
(pre-applied and) posted before we received our object but processed (and hence dispatched to us) after we received our object. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4715 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -72,13 +72,17 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
|
||||
return _oldEntry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies this event to the object.
|
||||
*/
|
||||
@Override // from DEvent
|
||||
public boolean alreadyApplied ()
|
||||
{
|
||||
return (_oldEntry != UNSET_OLD_ENTRY);
|
||||
}
|
||||
|
||||
@Override // from DEvent
|
||||
public boolean applyToObject (DObject target)
|
||||
throws ObjectAccessException
|
||||
{
|
||||
if (_oldEntry == UNSET_OLD_ENTRY) {
|
||||
if (!alreadyApplied()) {
|
||||
DSet<T> set = target.getSet(_name);
|
||||
// remove, fetch the previous value for interested callers
|
||||
_oldEntry = set.removeKey(_key);
|
||||
|
||||
Reference in New Issue
Block a user