{\r
// Still queries to make for current seqIndex\r
StringBuffer queryString = new StringBuffer("");\r
- int nqSize = (maxqlen > queries.size()) ? queries.size()\r
+ int numq=0,nqSize = (maxqlen > queries.size()) ? queries.size()\r
: maxqlen;\r
- for (int nq = 0, numq = 0; nq < nqSize; nq++)\r
+ \r
+ while (queries.size()>0 && numq < nqSize)\r
{\r
- String query = (String) queries.elementAt(nq);\r
+ String query = (String) queries.elementAt(0);\r
if (dbsource.isValidReference(query))\r
{\r
- queryString.append((nq == 0) ? "" : dbsource\r
+ queryString.append((numq == 0) ? "" : dbsource\r
.getAccessionSeparator());\r
queryString.append(query);\r
numq++;\r
}\r
- }\r
- for (int nq = 0; nq < nqSize; nq++)\r
- {\r
+ // remove the extracted query string\r
queries.removeElementAt(0);\r
}\r
// make the queries and process the response\r
AlignmentI retrieved = null;\r
try\r
{\r
+ if (jalview.bin.Cache.log.isDebugEnabled())\r
+ {\r
+ jalview.bin.Cache.log.debug("Querying "+dbsource.getDbName()+" with : '"+queryString.toString()+"'");\r
+ }\r
retrieved = dbsource.getSequenceRecords(queryString.toString());\r
} catch (Exception ex)\r
{\r
{ dbSources[db] }); // jalview.datamodel.DBRefSource.UNIPROT\r
// });\r
// check for existing dbrefs to use\r
- if (uprefs != null)\r
+ if (uprefs != null && uprefs.length>0)\r
{\r
for (int j = 0; j < uprefs.length; j++)\r
{\r