prevented URLs appearing in both the 'bad ' and the 'no services from' URL list.
authorjprocter <Jim Procter>
Thu, 4 Nov 2010 15:04:37 +0000 (15:04 +0000)
committerjprocter <Jim Procter>
Thu, 4 Nov 2010 15:04:37 +0000 (15:04 +0000)
src/jalview/ws/jws2/Jws2Discoverer.java

index 8089e1a..198f01d 100644 (file)
@@ -506,18 +506,18 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   {
     Thread runner = getDiscoverer().startDiscoverer(
             new PropertyChangeListener()
-    {
+            {
 
-      public void propertyChange(PropertyChangeEvent evt)
-      {
-        if (getDiscoverer().services!=null)
+              public void propertyChange(PropertyChangeEvent evt)
+              {
+                if (getDiscoverer().services != null)
                 {
                   System.out.println("Changesupport: There are now "
-                + getDiscoverer().services.size() + " services");
-          
-          }
-      }
-    });
+                          + getDiscoverer().services.size() + " services");
+
+                }
+              }
+            });
     while (runner.isAlive())
     {
       try
@@ -657,6 +657,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       e.printStackTrace();
       return false;
     }
+
     return true;
   }
 
@@ -699,7 +700,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   }
 
   /**
-   * add an 'empty' JABA server to the list
+   * add an 'empty' JABA server to the list. Only servers not already in the 'bad URL' list will be added to this list.
    * 
    * @param jwsservers
    */
@@ -709,7 +710,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     {
       urlsWithoutServices = new Vector<String>();
     }
-    if (!urlsWithoutServices.contains(jwsservers))
+
+    if ((invalidServiceUrls == null || !invalidServiceUrls
+            .contains(jwsservers))
+            && !urlsWithoutServices.contains(jwsservers))
     {
       urlsWithoutServices.add(jwsservers);
     }
@@ -746,7 +750,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       if (getInvalidServiceUrls() != null
               && getInvalidServiceUrls().size() > 0)
       {
-        ermsg.append("Invalid Service URLS: \n");
+        ermsg.append("URLs that could not be contacted: \n");
         for (String svcurl : getInvalidServiceUrls())
         {
           if (list)