X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fws%2Fdbsources%2FEmblXmlSource.java;h=ca90d6085bb23c37339ba31a94bf3a2cf40a20ad;hb=8474476096a0bbce03c7748aa3c267fbf6258249;hp=0236d441e5ca38fd16ed17bd492cfbb84131a370;hpb=db93a1adcbe0a4eaaf06e0a70ade0d6c5c1961c3;p=jalview.git diff --git a/src/jalview/ws/dbsources/EmblXmlSource.java b/src/jalview/ws/dbsources/EmblXmlSource.java index 0236d44..ca90d60 100644 --- a/src/jalview/ws/dbsources/EmblXmlSource.java +++ b/src/jalview/ws/dbsources/EmblXmlSource.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -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,8 +102,13 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy } } - List peptides = new ArrayList(); - if (efile != null) + /* + * 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()) {