Merge remote-tracking branch 'origin/tasks/JAL-3035_remove_dasobert_dependency' into...
[jalview.git] / src / jalview / util / DBRefUtils.java
index 50a34fc..5afbca5 100755 (executable)
@@ -43,9 +43,8 @@ public class DBRefUtils
   /*
    * lookup from lower-case form of a name to its canonical (standardised) form
    */
-  private static Map<String, String> canonicalSourceNameLookup = new HashMap<String, String>();
+  private static Map<String, String> canonicalSourceNameLookup = new HashMap<>();
 
-  private static Map<String, String> dasCoordinateSystemsLookup = new HashMap<String, String>();
 
   static
   {
@@ -73,10 +72,6 @@ public class DBRefUtils
               canonicalSourceNameLookup.get(k));
     }
 
-    dasCoordinateSystemsLookup.put("pdbresnum", DBRefSource.PDB);
-    dasCoordinateSystemsLookup.put("uniprot", DBRefSource.UNIPROT);
-    dasCoordinateSystemsLookup.put("embl", DBRefSource.EMBL);
-    // dasCoordinateSystemsLookup.put("embl", DBRefSource.EMBLCDS);
   }
 
   /**
@@ -97,13 +92,13 @@ public class DBRefUtils
     {
       return dbrefs;
     }
-    HashSet<String> srcs = new HashSet<String>();
+    HashSet<String> srcs = new HashSet<>();
     for (String src : sources)
     {
       srcs.add(src.toUpperCase());
     }
 
-    List<DBRefEntry> res = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> res = new ArrayList<>();
     for (DBRefEntry dbr : dbrefs)
     {
       String source = getCanonicalName(dbr.getSource());
@@ -122,29 +117,6 @@ public class DBRefUtils
   }
 
   /**
-   * isDasCoordinateSystem
-   * 
-   * @param string
-   *          String
-   * @param dBRefEntry
-   *          DBRefEntry
-   * @return boolean true if Source DBRefEntry is compatible with DAS
-   *         CoordinateSystem name
-   */
-
-  public static boolean isDasCoordinateSystem(String string,
-          DBRefEntry dBRefEntry)
-  {
-    if (string == null || dBRefEntry == null)
-    {
-      return false;
-    }
-    String coordsys = dasCoordinateSystemsLookup.get(string.toLowerCase());
-    return coordsys == null ? false
-            : coordsys.equals(dBRefEntry.getSource());
-  }
-
-  /**
    * look up source in an internal list of database reference sources and return
    * the canonical jalview name for the source, or the original string if it has
    * no canonical form.
@@ -218,7 +190,7 @@ public class DBRefUtils
   static List<DBRefEntry> searchRefs(DBRefEntry[] refs, DBRefEntry entry,
           DbRefComp comparator)
   {
-    List<DBRefEntry> rfs = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> rfs = new ArrayList<>();
     if (refs == null || entry == null)
     {
       return rfs;
@@ -594,7 +566,7 @@ public class DBRefUtils
   public static List<DBRefEntry> searchRefsForSource(DBRefEntry[] dbRefs,
           String source)
   {
-    List<DBRefEntry> matches = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> matches = new ArrayList<>();
     if (dbRefs != null && source != null)
     {
       for (DBRefEntry dbref : dbRefs)
@@ -644,7 +616,7 @@ public class DBRefUtils
       // nothing to do
       return;
     }
-    List<DBRefEntry> selfs = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> selfs = new ArrayList<>();
     {
       DBRefEntry[] selfArray = selectDbRefs(!sequence.isProtein(),
               sequence.getDBRefs());
@@ -664,11 +636,11 @@ public class DBRefUtils
         selfs.remove(p);
       }
     }
-    List<DBRefEntry> toPromote = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> toPromote = new ArrayList<>();
 
     for (DBRefEntry p : pr)
     {
-      List<String> promType = new ArrayList<String>();
+      List<String> promType = new ArrayList<>();
       if (sequence.isProtein())
       {
         switch (getCanonicalName(p.getSource()))