JSON refactoring of a few methods; fixing JavaScript issues
[jalview.git] / src / jalview / urls / IdentifiersUrlProvider.java
index 0dab719..07eb23e 100644 (file)
@@ -63,7 +63,7 @@ public class IdentifiersUrlProvider extends UrlProviderImpl
   public IdentifiersUrlProvider(String cachedUrlList)
   {
     urls = readIdentifiers(IdOrgSettings.getDownloadLocation());
-    selectedUrls = new ArrayList<String>();
+    selectedUrls = new ArrayList<>();
     checkSelectionMatchesUrls(cachedUrlList);
   }
 
@@ -78,7 +78,7 @@ public class IdentifiersUrlProvider extends UrlProviderImpl
 private HashMap<String, UrlLink> readIdentifiers(String idFileName)
   {
     // identifiers.org data
-    HashMap<String, UrlLink> idData = new HashMap<String, UrlLink>();
+    HashMap<String, UrlLink> idData = new HashMap<>();
 
     String errorMessage = null;
     try
@@ -123,12 +123,14 @@ private HashMap<String, UrlLink> readIdentifiers(String idFileName)
       // Typical report here is "NetworkError" because the file does not exist.
       // "https://." is coming from System.getProperty("user.home"), but this could
       // be set by the page developer to anything, of course.
-      errorMessage = (/** @j2sNative String.fromCharCode.apply(null, reader.$in.is.buf.slice(0,12)) || */e.toString());
+      errorMessage = e.toString();
       idData.clear();
     }
     // BH 2018 -- added more valuable report
     if (errorMessage != null)
+    {
       System.err.println("IdentifiersUrlProvider: cannot read " + idFileName + ": " + errorMessage);
+    }
     return idData;
   }
 
@@ -193,7 +195,7 @@ private HashMap<String, UrlLink> readIdentifiers(String idFileName)
   @Override
   public List<String> getLinksForMenu()
   {
-    List<String> links = new ArrayList<String>();
+    List<String> links = new ArrayList<>();
     for (String key : selectedUrls)
     {
       links.add(urls.get(key).toStringWithTarget());
@@ -210,7 +212,7 @@ private HashMap<String, UrlLink> readIdentifiers(String idFileName)
   @Override
   public void setUrlData(List<UrlLinkDisplay> links)
   {
-    selectedUrls = new ArrayList<String>();
+    selectedUrls = new ArrayList<>();
 
     Iterator<UrlLinkDisplay> it = links.iterator();
     while (it.hasNext())