Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-90222

IDL structs without underlying anchor generate "isOwner()" instead of "isOwned"

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: IDL
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • Networking & Obs 2024-05-27

      IDL-generated structs have an isOwned method which indicates whether an instance of the struct owns all of its underlying data. For structs that have fields which may be views, isOwned is implemented by checking whether the underlying BSONObj anchor is owned. For structs which do not have any fields that can be views, the generated class has no such anchor member, and so the IDL generator instead generates a method that just always returns true. However, it looks like there's a typo, since the name of the generated method in this case is isOwner (ending in with an "r") rather than isOwned.

      https://github.com/mongodb/mongo/blob/ccea3a1eb26586593b6174850cbfd5d0ce4e92a7/buildscripts/idl/idl/generator.py#L617

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: