File tree Expand file tree Collapse file tree 3 files changed +12
-30
lines changed
biojava-structure/src/main/java/org/biojava/nbio/structure Expand file tree Collapse file tree 3 files changed +12
-30
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,10 @@ public Object clone() {
183183 n .addAltLoc (nAltLocGroup );
184184 }
185185 }
186+
187+ if (chemComp !=null )
188+ n .setChemComp (chemComp );
189+
186190
187191 return n ;
188192 }
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ public static enum PerformanceBehavior {
8888
8989 private Map <String ,Atom > atomNameLookup ;
9090
91- private ChemComp chemComp ;
91+ protected ChemComp chemComp ;
9292
9393 private List <Group > altLocs ;
9494
@@ -402,6 +402,9 @@ public Object clone() {
402402 n .addAltLoc (nAltLocGroup );
403403 }
404404 }
405+
406+ if (chemComp !=null )
407+ n .setChemComp (chemComp );
405408
406409 return n ;
407410 }
Original file line number Diff line number Diff line change 2727
2828
2929/**
30- *
31- * A nucleotide group is almost the same as a Hetatm group.
32- * @see HetatomImpl
33- * @see AminoAcidImpl
30+ * A nucleotide group is almost the same as a Hetatm group.
31+ * @see HetatomImpl
32+ * @see AminoAcidImpl
3433 * @author Andreas Prlic
3534 * @since 1.4
3635 * @version %I% %G%
@@ -94,29 +93,5 @@ public Atom getP() {
9493
9594 }
9695
97- @ Override
98- public Object clone (){
99- NucleotideImpl n = new NucleotideImpl ();
100-
101- n .setPDBFlag (has3D ());
102- n .setResidueNumber (getResidueNumber ());
103-
104- n .setPDBName (getPDBName ());
105-
106- // copy the atoms
107- for (Atom atom1 : atoms ) {
108- Atom atom = (Atom ) atom1 .clone ();
109- n .addAtom (atom );
110- atom .setGroup (n );
111- }
112-
113- // copying the alt loc groups if present, otherwise they stay null
114- if (getAltLocs ()!=null && !getAltLocs ().isEmpty ()) {
115- for (Group altLocGroup :this .getAltLocs ()) {
116- Group nAltLocGroup = (Group )altLocGroup .clone ();
117- n .addAltLoc (nAltLocGroup );
118- }
119- }
120- return n ;
121- }
96+ // no need to implement clone here, it's already in super class
12297}
You can’t perform that action at this time.
0 commit comments