ObjectId does not follow the BSON ObjectId specification

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • None
    • Affects Version/s: 1.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The BSON ObjectId specification declares that the ObjectID is a 12-byte value consisting of a 4-byte timestamp, a 3-byte machine id, a 2-byte process id, and a 3-byte counter (http://www.mongodb.org/display/DOCS/Object+IDs)
      The Java ObjectId constructors treat the 12-byte buffer as 3 4-bite integers - time, machine, inc. The 2-byte process id is not taken into consideration.
      While time is initialized correctly, the other two values are wrong. This is especially critical for the compareTo method which fails in cases where the two ObjectId timestamps are equal and the inc part is used for comparison.

            Assignee:
            Eliot Horowitz (Inactive)
            Reporter:
            Dror Bereznitsky
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: