JAL-3438 spotless for 2.11.2.0
[jalview.git] / src / jalview / analysis / Conservation.java
index 0af5d20..cbc4dca 100755 (executable)
@@ -20,6 +20,8 @@
  */
 package jalview.analysis;
 
+import java.util.Locale;
+
 import jalview.analysis.scoremodels.ScoreMatrix;
 import jalview.analysis.scoremodels.ScoreModels;
 import jalview.datamodel.AlignmentAnnotation;
@@ -30,6 +32,7 @@ import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
 import jalview.schemes.ResidueProperties;
 import jalview.util.Comparison;
+import jalview.util.Format;
 
 import java.awt.Color;
 import java.util.List;
@@ -54,6 +57,8 @@ public class Conservation
 
   private static final int GAP_INDEX = -1;
 
+  private static final Format FORMAT_3DP = new Format("%2.5f");
+
   SequenceI[] sequences;
 
   int start;
@@ -309,7 +314,7 @@ public class Conservation
   protected static void recordConservation(Map<String, Integer> resultMap,
           String res)
   {
-    res = res.toUpperCase();
+    res = res.toUpperCase(Locale.ROOT);
     for (Entry<String, Map<String, Integer>> property : ResidueProperties.propHash
             .entrySet())
     {
@@ -695,7 +700,7 @@ public class Conservation
 
       max = Math.max(max, bigtot);
 
-      quality.addElement(new Double(bigtot));
+      quality.addElement(Double.valueOf(bigtot));
     }
 
     double newmax = -Double.MAX_VALUE;
@@ -707,7 +712,7 @@ public class Conservation
       tmp = ((max - tmp) * (size - cons2GapCounts[j])) / size;
 
       // System.out.println(tmp+ " " + j);
-      quality.setElementAt(new Double(tmp), j);
+      quality.setElementAt(Double.valueOf(tmp), j);
 
       if (tmp > newmax)
       {
@@ -808,8 +813,9 @@ public class Conservation
         value = quality.elementAt(i).floatValue();
         float vprop = value - qmin;
         vprop /= qmax;
-        quality2.annotations[i] = new Annotation(" ", String.valueOf(value),
-                ' ', value, new Color(minR + (maxR * vprop),
+        String description = FORMAT_3DP.form(value);
+        quality2.annotations[i] = new Annotation(" ", description, ' ',
+                value, new Color(minR + (maxR * vprop),
                         minG + (maxG * vprop), minB + (maxB * vprop)));
       }
     }