Event queue cleanup, categorization & tests
[JAMESII-148] Inconsistent event queue behavior if events can be equal without being identical Created: 31/May/12 Updated: 31/Jul/14
|Security Level:||public (Visible to EVERYONE.)|
|Remaining Estimate:||0 minutes|
|Time Spent:||Not Specified|
|Original Estimate:||0 minutes|
Some event queues use object identity, some use the .equals(...) method for comparing events, which is relevant when two equal but not identical events are enqueued. Toy example:
queue.enqueue(new Integer(1), 1.0);
As of this writing, it produces [1,2]/ for SimpleReBucketEQ, / for SimpleEQ and TLWBSTEQ and [1,2]/[1,1] for all others (or [2,1]/[1,1]). Changing the above line to "if (!this.event.equals(obj.getEvent()))" makes TreeMapEQ also produce /, changing the HashMap in the SimpleEQ to an IdentityHashMap makes it join the [1,2]/[1,1] side.
Maybe the relevant factories should know which behavior their produced event queues exhibit, such that one can define filter criteria based on it?
|Comment by jh194 [ 31/May/12 ]|
This is a known issue. Thanks for adding this to JIRA. So far it has not been resolved as there is no easy fix for all event queue implementations and as any non easy fix will harm the efficiency of the implementations. However, there are already ongoing discussions on how to resolve the problem in the future.
|Comment by Arne Bittig [ 13/Nov/13 ]|
unassigned, added hiwi label, changed description to reflect that this is a known issue