JAL-1152 bug fix for 'no sort' case + tests for autocalc placement
[jalview.git] / src / jalview / analysis / AnnotationSorter.java
index fa9c1a8..b9e9ed5 100644 (file)
@@ -21,7 +21,7 @@ public class AnnotationSorter
   {
     SEQUENCE_AND_LABEL, LABEL_AND_SEQUENCE, NONE
   }
-  
+
   private final AlignmentI alignment;
 
   private boolean showAutocalcAbove;
@@ -158,7 +158,7 @@ public class AnnotationSorter
       return 0;
     }
   };
-  
+
   /**
    * Sort by the specified ordering of sequence-specific annotations.
    * 
@@ -168,16 +168,13 @@ public class AnnotationSorter
   public void sort(AlignmentAnnotation[] alignmentAnnotations,
           SequenceAnnotationOrder order)
   {
-    if (order != SequenceAnnotationOrder.NONE)
-    {
-      Comparator<? super AlignmentAnnotation> comparator = getComparator(order);
+    Comparator<? super AlignmentAnnotation> comparator = getComparator(order);
 
-      if (alignmentAnnotations != null)
+    if (alignmentAnnotations != null)
+    {
+      synchronized (alignmentAnnotations)
       {
-        synchronized (alignmentAnnotations)
-        {
-          Arrays.sort(alignmentAnnotations, comparator);
-        }
+        Arrays.sort(alignmentAnnotations, comparator);
       }
     }
   }