From: kjvdheide Date: Wed, 1 Nov 2017 15:54:14 +0000 (+0000) Subject: JAL-2795 removed sequences[] class variable, more comments X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f0c94e4fa7bbf2e9743035add718ba94f4fd07f3;p=jalview.git JAL-2795 removed sequences[] class variable, more comments --- 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(