Merge branch 'releases/Release_2_10_2b1_Branch'
[jalview.git] / src / jalview / ws / dbsources / EmblXmlSource.java
index f672e8b..ca90d60 100644 (file)
@@ -64,13 +64,13 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
     {
       reply = dbFetch.fetchDataAsFile(
               emprefx.toLowerCase() + ":" + query.trim(), "display=xml",
-              ".xml");
+              "xml");
     } catch (Exception e)
     {
       stopQuery();
       throw new Exception(MessageManager.formatMessage(
-              "exception.ebiembl_retrieval_failed_on", new String[] {
-                  emprefx.toLowerCase(), query.trim() }), e);
+              "exception.ebiembl_retrieval_failed_on", new String[]
+              { emprefx.toLowerCase(), query.trim() }), e);
     }
     return getEmblSequenceRecords(emprefx, query, reply);
   }
@@ -91,7 +91,7 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
           File reply) throws Exception
   {
     EmblFile efile = null;
-    List<SequenceI> seqs = new ArrayList<SequenceI>();
+    List<SequenceI> seqs = new ArrayList<>();
 
     if (reply != null && reply.exists())
     {
@@ -102,7 +102,12 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
       }
     }
 
-    List<SequenceI> peptides = new ArrayList<SequenceI>();
+    /*
+     * invalid accession gets a reply with no <entry> elements, text content of
+     * EmbFile reads something like (e.g.) this ungrammatical phrase
+     * Entry: <acc> display type is either not supported or entry is not found.
+     */
+    List<SequenceI> peptides = new ArrayList<>();
     if (efile != null && efile.getEntries() != null)
     {
       for (EmblEntry entry : efile.getEntries())