JAL-2885 uniprot now https, uniprot/ensembl/pfam/xfam configurable
[jalview.git] / src / jalview / ext / ensembl / EnsemblLookup.java
index 31da9c0..f31a3f0 100644 (file)
@@ -50,6 +50,8 @@ public class EnsemblLookup extends EnsemblRestClient
   private static final String OBJECT_TYPE_GENE = "Gene";
   private static final String OBJECT_TYPE = "object_type";
 
+  private String lastId;
+
   /**
    * Default constructor (to use rest.ensembl.org)
    */
@@ -137,6 +139,13 @@ public class EnsemblLookup extends EnsemblRestClient
     try
     {
       URL url = getUrl(identifier);
+      if (identifier.equals(lastId))
+      {
+        System.err.println("** Ensembl lookup " + url.toString()
+                + " looping on Parent!");
+        return null;
+      }
+      lastId = identifier;
       if (url != null)
       {
         br = getHttpResponse(url, ids);