Uploaded image for project: 'Clojure'
  1. CLJ-757

Empty transient maps/sets return wrong value for .contains

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: None
    • Fix versions: Release 1.5
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      Description

      As explained in http://groups.google.com/group/clojure/browse_thread/thread/496ffc7fb9058699/6e9d8152b6fd6365?show_docid=6e9d8152b6fd6365, (.contains (transient #{}) :some-key) returns true instead of false. (contains? #{} :some-key) works properly, but the plain .contains method does not.

      The issue is in TransientHashMap.doValAt(key, notFound), and the attached patch is a simple fix with test.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              amalloy Alan Malloy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: