X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2FEmblXmlSource.java;h=ca90d6085bb23c37339ba31a94bf3a2cf40a20ad;hb=d943fcd0dc04fd4974344eddd13902c89fb595b2;hp=f672e8bee6c6aa3fe3d41a5f420bce1ef9eb83d2;hpb=72da885aa401e932e73af4a554ea338cd5015efc;p=jalview.git diff --git a/src/jalview/ws/dbsources/EmblXmlSource.java b/src/jalview/ws/dbsources/EmblXmlSource.java index f672e8b..ca90d60 100644 --- a/src/jalview/ws/dbsources/EmblXmlSource.java +++ b/src/jalview/ws/dbsources/EmblXmlSource.java @@ -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 seqs = new ArrayList(); + List seqs = new ArrayList<>(); if (reply != null && reply.exists()) { @@ -102,7 +102,12 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy } } - List peptides = new ArrayList(); + /* + * invalid accession gets a reply with no elements, text content of + * EmbFile reads something like (e.g.) this ungrammatical phrase + * Entry: display type is either not supported or entry is not found. + */ + List peptides = new ArrayList<>(); if (efile != null && efile.getEntries() != null) { for (EmblEntry entry : efile.getEntries())