From: jprocter Date: Mon, 7 Nov 2011 13:36:19 +0000 (+0000) Subject: (JAL-974) - remove sun-internal class and use message to determine if we should ignor... X-Git-Tag: Jalview_2_9~558 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e3e2a13d4cf421bfece25e0a199a5244519b19b2;p=jalview.git (JAL-974) - remove sun-internal class and use message to determine if we should ignore exception because we're working with a JABAWS annotation client that produces no statistics --- diff --git a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java index 7ee6e08..f47767c 100644 --- a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java +++ b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java @@ -20,7 +20,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import com.sun.xml.internal.ws.developer.ServerSideException; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.FastaSequence; import compbio.data.sequence.ScoreManager; @@ -191,20 +190,14 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker } catch (Exception x) { - if (x.getCause() instanceof ServerSideException) + if (x.getMessage().contains( + "Position in a file could not be negative!")) { - if (x.getMessage().contains("Position in a file could not be negative!")) - { - // squash index out of bounds exception- seems to happen for - // disorder predictors which don't (apparently) produce any - // progress information and JABA server throws an exception - // because progress length is -1. - stats = null; - } - else - { - throw x; - } + // squash index out of bounds exception- seems to happen for + // disorder predictors which don't (apparently) produce any + // progress information and JABA server throws an exception + // because progress length is -1. + stats = null; } else { @@ -298,13 +291,14 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker boolean nucleotidesAllowed = false; boolean proteinAllowed = false; - + /** * record sequences for mapping result back to afterwards */ - protected boolean bySequence=false; + protected boolean bySequence = false; + + Map seqNames; - Map seqNames; public List getInputSequences(AlignmentI alignment) { @@ -321,7 +315,7 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker int minlen = 10; if (bySequence) { - seqNames=new HashMap(); + seqNames = new HashMap(); } for (SequenceI sq : ((List) alignment.getSequences())) { @@ -330,8 +324,9 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker { String newname = SeqsetUtils.unique_name(seqs.size() + 1); // make new input sequence with or without gaps - if (seqNames!=null) { - seqNames.put(newname,sq); + if (seqNames != null) + { + seqNames.put(newname, sq); } seqs.add(new compbio.data.sequence.FastaSequence(newname, (submitGaps) ? sq.getSequenceAsString() : AlignSeq