JAL-2505 use constructors to set (what will be) final fields in
[jalview.git] / src / MCview / PDBChain.java
index ba93046..1f47014 100755 (executable)
@@ -207,11 +207,13 @@ public class PDBChain
       if (features[i].getFeatureGroup() != null
               && features[i].getFeatureGroup().equals(pdbid))
       {
-        SequenceFeature tx = new SequenceFeature(features[i]);
-        tx.setBegin(1 + residues.elementAt(tx.getBegin() - offset).atoms
-                .elementAt(0).alignmentMapping);
-        tx.setEnd(1 + residues.elementAt(tx.getEnd() - offset).atoms
-                .elementAt(0).alignmentMapping);
+        int newBegin = 1 + residues.elementAt(features[i].getBegin()
+                - offset).atoms
+                .elementAt(0).alignmentMapping;
+        int newEnd = 1 + residues.elementAt(features[i].getEnd() - offset).atoms
+                .elementAt(0).alignmentMapping;
+        SequenceFeature tx = new SequenceFeature(features[i], newBegin,
+                newEnd, features[i].getFeatureGroup());
         tx.setStatus(status
                 + ((tx.getStatus() == null || tx.getStatus().length() == 0) ? ""
                         : ":" + tx.getStatus()));