From 1a7a229e4e1a3f6960a34543333748477022c234 Mon Sep 17 00:00:00 2001 From: hansonr Date: Wed, 30 Jan 2019 08:56:52 -0600 Subject: [PATCH] fixes unidentified Java problem when pasted text has white space trailing or preceding, error was indicated that "" could not be loaded. --- src/jalview/gui/SequenceFetcher.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index 1e6d678..f06bd97 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -417,13 +417,15 @@ public class SequenceFetcher extends JPanel implements Runnable /* * tidy inputs and check there is something to search for */ - String text = textArea.getText(); + String t0 = textArea.getText(); + String text = text.trim(); // BH 2019.01.30 if (replacePunctuation.isEnabled() && replacePunctuation.isSelected()) { text = text.replace(",", ";"); } text = text.replaceAll("(\\s|[,; ])+", ";"); - textArea.setText(text); + if (!t0.equals(text)) // BH 2019.01.30 no need to do setting if it is the same + textArea.setText(text); if (text.isEmpty()) { // todo i18n -- 1.7.10.2