(JAL-974) - remove sun-internal class and use message to determine if we should ignor...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 7 Nov 2011 13:36:19 +0000 (13:36 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 7 Nov 2011 13:36:19 +0000 (13:36 +0000)
src/jalview/ws/jws2/JabawsAlignCalcWorker.java

index 7ee6e08..f47767c 100644 (file)
@@ -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<String, SequenceI> seqNames;
 
-  Map<String,SequenceI> seqNames;
   public List<FastaSequence> getInputSequences(AlignmentI alignment)
   {
 
@@ -321,7 +315,7 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker
     int minlen = 10;
     if (bySequence)
     {
-      seqNames=new HashMap<String,SequenceI>();
+      seqNames = new HashMap<String, SequenceI>();
     }
     for (SequenceI sq : ((List<SequenceI>) 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