Skip to content

Structure.clone() doesn't copy AtomImpl.bonds lists. #712

@larsonmattr

Description

@larsonmattr

This is a problem in the 4.2.x branch and the master branch.

Structure.clone() is described as "Return an identical copy of this Structure object".

  1. If the original Structure was parsed with the FileParsingParameters.setCreateAtomBonds(true), a Structure will be created there each Atom in the Structure has a list of Bonds to describing connections to other Atom instances.

  2. If you then make a deep copy by Structure.clone(), the new Structure will be missing any Bond information inside the cloned Atom instances.

I would expect that connectivity would also be preserved in a deep copy.

TestClone.java.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs and bugfixeshelp wantedQuestions and support for users

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions