Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added deep cloning of stereo element to atom containers and polymers …

…(atom container subclass)

Change-Id: I344ba0fb0409f2e35858501e33b7d3ddcc8553a9
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
commit a46545d8de64766415b47c7d486e3681658758b5 1 parent 7a1f243
@johnmay johnmay authored committed
View
8 src/main/org/openscience/cdk/AtomContainer.java
@@ -1663,7 +1663,13 @@ public Object clone() throws CloneNotSupportedException {
}
- return clone;
+
+ // map each stereo element to a new instance in the clone
+ for(IStereoElement element : stereoElements){
+ clone.addStereoElement(element.map(atomMap, bondMap));
+ }
+
+ return clone;
}
View
5 src/main/org/openscience/cdk/Polymer.java
@@ -218,6 +218,11 @@ public Object clone() throws CloneNotSupportedException {
clone.addSingleElectron(newSingleElectron);
}
+ // map each stereo element to a new instance in the clone
+ for(IStereoElement element : stereoElements){
+ clone.addStereoElement(element.map(atomMap, bondMap));
+ }
+
return clone;
}
View
7 src/main/org/openscience/cdk/silent/AtomContainer.java
@@ -1606,6 +1606,13 @@ public Object clone() throws CloneNotSupportedException {
}
+
+ // map each stereo element to a new instance in the clone
+ for(IStereoElement element : stereoElements){
+ clone.addStereoElement(element.map(atomMap, bondMap));
+ }
+
+
return clone;
View
5 src/main/org/openscience/cdk/silent/Polymer.java
@@ -212,6 +212,11 @@ public Object clone() throws CloneNotSupportedException {
clone.addSingleElectron(newSingleElectron);
}
+ // map each stereo element to a new instance in the clone
+ for(IStereoElement element : stereoElements){
+ clone.addStereoElement(element.map(atomMap, bondMap));
+ }
+
return clone;
}
Please sign in to comment.
Something went wrong with that request. Please try again.