From f0c94e4fa7bbf2e9743035add718ba94f4fd07f3 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Wed, 1 Nov 2017 15:54:14 +0000 Subject: [PATCH] JAL-2795 removed sequences[] class variable, more comments --- src/jalview/ext/forester/ForesterMatrix.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jalview/ext/forester/ForesterMatrix.java b/src/jalview/ext/forester/ForesterMatrix.java index 92e88c8..e48ee27 100644 --- a/src/jalview/ext/forester/ForesterMatrix.java +++ b/src/jalview/ext/forester/ForesterMatrix.java @@ -22,7 +22,6 @@ public class ForesterMatrix implements DistanceMatrix private final MatrixI jalviewMatrix; - private Sequence[] sequences; private final String[] identifiers; @@ -30,12 +29,11 @@ public class ForesterMatrix implements DistanceMatrix final Sequence[] matrixSequences) { this.jalviewMatrix = jalviewInputMatrix; - this.sequences = matrixSequences; - this.identifiers = new String[sequences.length]; + this.identifiers = new String[matrixSequences.length]; int i = 0; - for (Sequence sequence : sequences) + for (Sequence sequence : matrixSequences) { identifiers[i] = sequence.getName(); i++; @@ -64,7 +62,9 @@ public class ForesterMatrix implements DistanceMatrix try { return IntStream.range(0, identifiers.length) .filter(x -> identifier.equals(identifiers[x])).findAny() - .getAsInt(); + .getAsInt(); // stream to bypass otherwise having to duplicate the + // list + // with Arrays.aslist } catch (NoSuchElementException ex) { throw new Error(MessageManager.formatMessage( -- 1.7.10.2