Skip to content

ModelObject#clone does not copy properties #107

@nicoweidner

Description

@nicoweidner

Currently, ModelObject#clone creates a clone of the instance it is called on inside the passed model store. It does not copy any properties of the original object. The properties of the new object will be:

  • Empty in case the object did not exist already in the new store
  • The corresponding properties from the new store if the object already existed in there

In the discussion in #106, it turned out that this may be unintended and properties should actually be copied over.
In that case, we should probably fail in case the object already exists in the new store, to avoid accidentally overwriting data (or pass a overwrite flag).

Note: The only usage of clone in the library seems to be inside a test, so changing it won't cause problems in the library. It could be considered a breaking change to public API, however...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions