Menu

#6 add() in OpenHashSet<T> is broken - may produce multisets

v1.2
open-fixed
Classes (14)
9
2004-07-26
2004-02-27
No

When adding a value v1 to an OpenHashSet<T> that already
contains v1, it might happen that this value is added
again.
The problem occurs, when between the first and second
add(v1) another value v2 is removed, which was stored
in the
hash chain leading to v1. The add() operation does not
search the complete hash chain until its end, but insert v1
into the first unoccupied entry. But in the situation
described above, the v1 could be found later on in the hash
chain, and must not be inserted at all.

Discussion

  • Bernhard Haumacher

    • summary: add() in OpenHashSet<t> is broken - may produce multisets --> add() in OpenHashSet<T> is broken - may produce multisets</t>
     
  • Bernhard Haumacher

    Logged In: YES
    user_id=29238

    Seems to be a very similar problem as [770203] "Duplicate
    keys allowed in
    IntKeyOpenHashMap".

    But [905803] it is not fixed in 1.2, I used that version.

     
  • Søren Bak

    Søren Bak - 2004-07-26

    Logged In: YES
    user_id=43402

    Patch #905808 has now been included in TOpenHashSet to
    correct Bug #905803. It has also been applied to
    TKeyOpenHashMap and TKeySOpenHashMap.

    The correction will be released in version 1.3. Thank you very
    much for the patch.

     
  • Søren Bak

    Søren Bak - 2004-07-26
    • milestone: --> v1.2
    • assigned_to: nobody --> bak
    • status: open --> open-fixed
     
  • Søren Bak

    Søren Bak - 2004-07-26

    Logged In: YES
    user_id=43402

    Patch #905808 has now been included in TOpenHashSet to
    correct Bug #905803. It has also been applied to
    TKeyOpenHashMap and TKeySOpenHashMap.

    The correction will be released in version 1.3. Thank you very
    much for the patch.

     
  • Søren Bak

    Søren Bak - 2004-07-26
    • priority: 5 --> 9
     

Log in to post a comment.