From: Jim Procter Date: Tue, 10 Feb 2015 14:56:36 +0000 (+0000) Subject: JAL-1382 @mungo TODO done: use StringUtils for delete chars X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f299d6b2fc71975697ea7704bd3a90f835ca9a60;p=jalview.git JAL-1382 @mungo TODO done: use StringUtils for delete chars --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 963a7cf..fb559eb 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -21,6 +21,7 @@ package jalview.datamodel; import jalview.analysis.AlignSeq; +import jalview.util.StringUtils; import java.util.ArrayList; import java.util.Enumeration; @@ -725,22 +726,8 @@ public class Sequence implements SequenceI { return; } - // TODO use StringUtils.deleteChars - char[] tmp; - - if (j >= sequence.length) - { - tmp = new char[i]; - System.arraycopy(sequence, 0, tmp, 0, i); - j = sequence.length; - } - else - { - tmp = new char[sequence.length - j + i]; - System.arraycopy(sequence, 0, tmp, 0, i); - System.arraycopy(sequence, j, tmp, i, sequence.length - j); - } + char[] tmp = StringUtils.deleteChars(sequence, i, j); boolean createNewDs = false; // TODO: take a look at the new dataset creation validation method below - // this could become time comsuming for large sequences - consider making it