Skip to content

Commit

Permalink
Added missing cloning of single electrons
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Apr 24, 2010
1 parent 9672df0 commit 2d4c122
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/org/openscience/cdk/Polymer.java
Expand Up @@ -185,6 +185,18 @@ public Object clone() throws CloneNotSupportedException {
clone.addLonePair(newLp);
}

// put back single electrons
ISingleElectron singleElectron;
ISingleElectron newSingleElectron;
for (int i = 0; i < getSingleElectronCount(); ++i) {
singleElectron = getSingleElectron(i);
newSingleElectron = (ISingleElectron) singleElectron.clone();
if (singleElectron.getAtom() != null) {
newSingleElectron.setAtom(clone.getAtom(getAtomNumber(singleElectron.getAtom())));
}
clone.addSingleElectron(newSingleElectron);
}

return clone;
}

Expand Down

0 comments on commit 2d4c122

Please sign in to comment.