From 89f681165beb4b03bc82d9f7fea4d85e94024f5c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 6 Sep 2018 20:37:06 +0100 Subject: [PATCH] =?utf8?q?JAL-3105=20reallocate=20quality=20and=20consensus=20?= =?utf8?q?annotation=20rows=20so=20old=20values=20aren=E2=80=99t=20rendered=20?= =?utf8?q?when=20alignments=20become=20shorter?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/analysis/Conservation.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index 131b39c..0af5d20 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -273,7 +273,7 @@ public class Conservation * or not conserved (-1) * Using TreeMap means properties are displayed in alphabetical order */ - SortedMap resultHash = new TreeMap(); + SortedMap resultHash = new TreeMap<>(); SymbolCounts symbolCounts = values.getSymbolCounts(); char[] symbols = symbolCounts.symbols; int[] counts = symbolCounts.values; @@ -567,7 +567,7 @@ public class Conservation */ private void percentIdentity(ScoreMatrix sm) { - seqNums = new Vector(); + seqNums = new Vector<>(); int i = 0, iSize = sequences.length; // Do we need to calculate this again? for (i = 0; i < iSize; i++) @@ -622,7 +622,7 @@ public class Conservation protected void findQuality(int startCol, int endCol, ScoreMatrix scoreMatrix) { - quality = new Vector(); + quality = new Vector<>(); double max = -Double.MAX_VALUE; float[][] scores = scoreMatrix.getMatrix(); @@ -721,8 +721,8 @@ public class Conservation /** * Complete the given consensus and quuality annotation rows. Note: currently - * this method will enlarge the given annotation row if it is too small, - * otherwise will leave its length unchanged. + * this method will reallocate the given annotation row if it is different to + * the calculated width, otherwise will leave its length unchanged. * * @param conservation * conservation annotation row @@ -754,7 +754,7 @@ public class Conservation float qmax = 0f; if (conservation != null && conservation.annotations != null - && conservation.annotations.length < alWidth) + && conservation.annotations.length != alWidth) { conservation.annotations = new Annotation[alWidth]; } @@ -763,7 +763,7 @@ public class Conservation { quality2.graphMax = (float) qualityMaximum; if (quality2.annotations != null - && quality2.annotations.length < alWidth) + && quality2.annotations.length != alWidth) { quality2.annotations = new Annotation[alWidth]; } -- 1.7.10.2