merge from 2_4_Release branch
[jalview.git] / src / org / biojava / dasobert / das / FeatureThread.java
index e7c9df9..172078b 100755 (executable)
@@ -31,20 +31,20 @@ import java.util.logging.*;
 import org.biojava.dasobert.dasregistry.*;
 import org.biojava.dasobert.eventmodel.*;
 
-/** a thread that connects to a DAS - Feature service and gets the features
- *
+/**
+ * a thread that connects to a DAS - Feature service and gets the features
+ * 
  * @author Andreas Prlic
  */
 
-
-
-public class FeatureThread
-    implements Runnable
+public class FeatureThread implements Runnable
 {
 
-  /** number of times the client tries to reconnect to the server if a "come back later" is returned.
-   * the server should provide a reasonable estimation how long it will take him to create results.
-   * if this number of requests is still not successfull, give up.
+  /**
+   * number of times the client tries to reconnect to the server if a "come back
+   * later" is returned. the server should provide a reasonable estimation how
+   * long it will take him to create results. if this number of requests is
+   * still not successfull, give up.
    */
   public static int MAX_COME_BACK_ITERATIONS = 5;
 
@@ -53,8 +53,11 @@ public class FeatureThread
   static Logger logger = Logger.getLogger("org.biojava.spice");
 
   Das1Source dasSource;
+
   String ac;
+
   List featureListeners;
+
   Thread thread;
 
   public FeatureThread(String accessionCode, Das1Source dasSource)
@@ -91,8 +94,7 @@ public class FeatureThread
       try
       {
         cmd = new URL(queryString);
-      }
-      catch (MalformedURLException e)
+      } catch (MalformedURLException e)
       {
         logger.warning("got MalformedURL from das source " + dasSource);
         e.printStackTrace();
@@ -104,7 +106,7 @@ public class FeatureThread
 
       int comeBackLater = ftmp.getComeBackLater();
       int securityCounter = 0;
-      while ( (thread == me) && (comeBackLater > 0))
+      while ((thread == me) && (comeBackLater > 0))
       {
         securityCounter++;
         if (securityCounter >= MAX_COME_BACK_ITERATIONS)
@@ -118,8 +120,7 @@ public class FeatureThread
         try
         {
           wait(comeBackLater);
-        }
-        catch (InterruptedException e)
+        } catch (InterruptedException e)
         {
           comeBackLater = -1;
           break;
@@ -129,7 +130,7 @@ public class FeatureThread
         comeBackLater = ftmp.getComeBackLater();
       }
 
-      if (! (thread == me))
+      if (!(thread == me))
       {
         break;
       }
@@ -140,9 +141,10 @@ public class FeatureThread
       // a fallback mechanism to prevent DAS sources from bringing down spice
       if (features.size() > MAX_NR_FEATURES)
       {
-        logger.warning("DAS source returned more than " + MAX_NR_FEATURES +
-                       "features. " +
-                       " throwing away excess features at " + cmd);
+        logger
+                .warning("DAS source returned more than " + MAX_NR_FEATURES
+                        + "features. "
+                        + " throwing away excess features at " + cmd);
         features = features.subList(0, MAX_NR_FEATURES);
       }
 
@@ -175,8 +177,9 @@ public class FeatureThread
     }
   }
 
-  /** the Annotation server requested to be queried again in a while
-   *
+  /**
+   * the Annotation server requested to be queried again in a while
+   * 
    * @param comeBackLater
    */
   private void notifyComeBackLater(int comeBackLater)