JAL-3070 decouple WsMenuEntryProviderI code from JABAWS
authorJim Procter <jprocter@issues.jalview.org>
Wed, 2 Oct 2019 16:52:06 +0000 (17:52 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 2 Oct 2019 17:01:47 +0000 (18:01 +0100)
src/jalview/ws/jws2/Jws2Discoverer.java

index 77f2440..49f3195 100644 (file)
@@ -364,11 +364,11 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
      * for moment we keep them separate.
      */
     JMenu atpoint;
-    List<Jws2Instance> enumerableServices = new ArrayList<>();
+    List<ServiceWithParameters> enumerableServices = new ArrayList<>();
     // jws2al.removeAll();
     Map<String, ServiceWithParameters> preferredHosts = new HashMap<>();
     Map<String, List<ServiceWithParameters>> alternates = new HashMap<>();
-    for (Jws2Instance service : services.toArray(new Jws2Instance[0]))
+    for (ServiceWithParameters service : getServices())
     {
       // TODO: check this behaves with refactored serviceType to getName
       if (!isRecalculable(service.getName()))
@@ -476,7 +476,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
    */
   private void addEnumeratedServices(final JMenu jws2al,
           final AlignFrame alignFrame,
-          List<Jws2Instance> enumerableServices)
+          List<ServiceWithParameters> enumerableServices)
   {
     boolean byhost = Cache.getDefault("WSMENU_BYHOST", false),
             bytype = Cache.getDefault("WSMENU_BYTYPE", false);
@@ -488,11 +488,11 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
     List<String> hostLabels = new ArrayList<>();
     Hashtable<String, String> lasthostFor = new Hashtable<>();
-    Hashtable<String, ArrayList<Jws2Instance>> hosts = new Hashtable<>();
+    Hashtable<String, ArrayList<ServiceWithParameters>> hosts = new Hashtable<>();
     ArrayList<String> hostlist = new ArrayList<>();
-    for (Jws2Instance service : enumerableServices)
+    for (ServiceWithParameters service : enumerableServices)
     {
-      ArrayList<Jws2Instance> hostservices = hosts
+      ArrayList<ServiceWithParameters> hostservices = hosts
               .get(service.getHostURL());
       if (hostservices == null)
       {