JAL-2591 Refactor HiddenColumns to use ArrayList instead of Vector
[jalview.git] / src / jalview / util / MappingUtils.java
index 33c43d3..b2ec120 100644 (file)
@@ -108,7 +108,7 @@ public final class MappingUtils
      * Cache a copy of the target sequences so we can mimic successive edits on
      * them. This lets us compute mappings for all edits in the set.
      */
-    Map<SequenceI, SequenceI> targetCopies = new HashMap<SequenceI, SequenceI>();
+    Map<SequenceI, SequenceI> targetCopies = new HashMap<>();
     for (SequenceI seq : mapTo.getSequences())
     {
       SequenceI ds = seq.getDatasetSequence();
@@ -433,7 +433,7 @@ public final class MappingUtils
           boolean undo, AlignmentI mapTo, List<AlignedCodonFrame> mappings)
   {
     SequenceI[] sortOrder = command.getSequenceOrder(undo);
-    List<SequenceI> mappedOrder = new ArrayList<SequenceI>();
+    List<SequenceI> mappedOrder = new ArrayList<>();
     int j = 0;
 
     /*
@@ -518,7 +518,6 @@ public final class MappingUtils
     AlignViewportI protein = targetIsNucleotide ? mapFrom : mapTo;
     List<AlignedCodonFrame> codonFrames = protein.getAlignment()
             .getCodonFrames();
-    // ColumnSelection mappedColumns = new ColumnSelection();
 
     if (colsel == null)
     {
@@ -540,7 +539,7 @@ public final class MappingUtils
               toSequences, fromGapChar);
     }
 
-    for (int[] hidden : hiddencols.getListOfCols())
+    for (int[] hidden : hiddencols.getHiddenColumnsCopy())
     {
       mapHiddenColumns(hidden, codonFrames, newHidden, fromSequences,
               toSequences, fromGapChar);
@@ -696,7 +695,7 @@ public final class MappingUtils
   public static List<char[]> findCodonsFor(SequenceI seq, int col,
           List<AlignedCodonFrame> mappings)
   {
-    List<char[]> result = new ArrayList<char[]>();
+    List<char[]> result = new ArrayList<>();
     int dsPos = seq.findPosition(col);
     for (AlignedCodonFrame mapping : mappings)
     {
@@ -775,7 +774,7 @@ public final class MappingUtils
           SequenceI sequence, List<AlignedCodonFrame> mappings,
           List<SequenceI> filterList)
   {
-    List<AlignedCodonFrame> result = new ArrayList<AlignedCodonFrame>();
+    List<AlignedCodonFrame> result = new ArrayList<>();
     if (sequence == null || mappings == null)
     {
       return result;