JAL-2505 use constructors to set (what will be) final fields in
[jalview.git] / src / jalview / analysis / AlignmentUtils.java
index 232cb5d..955de28 100644 (file)
@@ -2133,9 +2133,10 @@ public class AlignmentUtils
         }
         if (mappedTo != null)
         {
-          SequenceFeature copy = new SequenceFeature(sf);
-          copy.setBegin(Math.min(mappedTo[0], mappedTo[1]));
-          copy.setEnd(Math.max(mappedTo[0], mappedTo[1]));
+          int newBegin = Math.min(mappedTo[0], mappedTo[1]);
+          int newEnd = Math.max(mappedTo[0], mappedTo[1]);
+          SequenceFeature copy = new SequenceFeature(sf, newBegin, newEnd,
+                  sf.getFeatureGroup());
           copyTo.addSequenceFeature(copy);
           count++;
         }