/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
+ * Copyright (C) 2015 The Jalview Authors
*
* This file is part of Jalview.
*
@Override
public boolean matches(DBRefEntry refa, DBRefEntry refb)
{
- if (refa.getSource() != null && refb.getSource() != null
+ if (refa.getSource() != null
+ && refb.getSource() != null
&& DBRefUtils.getCanonicalName(refb.getSource()).equals(
DBRefUtils.getCanonicalName(refa.getSource())))
{
@Override
public boolean matches(DBRefEntry refa, DBRefEntry refb)
{
- if (refa.getSource() != null && refb.getSource() != null
+ if (refa.getSource() != null
+ && refb.getSource() != null
&& DBRefUtils.getCanonicalName(refb.getSource()).equals(
DBRefUtils.getCanonicalName(refa.getSource())))
{
@Override
public boolean matches(DBRefEntry refa, DBRefEntry refb)
{
- if (refa.getSource() != null && refb.getSource() != null
+ if (refa.getSource() != null
+ && refb.getSource() != null
&& DBRefUtils.getCanonicalName(refb.getSource()).equals(
DBRefUtils.getCanonicalName(refa.getSource())))
{
@Override
public boolean matches(DBRefEntry refa, DBRefEntry refb)
{
- if (refa.getSource() != null && refb.getSource() != null
+ if (refa.getSource() != null
+ && refb.getSource() != null
&& DBRefUtils.getCanonicalName(refb.getSource()).equals(
DBRefUtils.getCanonicalName(refa.getSource())))
{
* sequences if they have an appropriate primary ref
* <table>
* <tr>
- * <td>Seq Type</td>
- * <td>Primary DB</td>
- * <td>Direct which will be promoted</td>
+ * <th>Seq Type</th>
+ * <th>Primary DB</th>
+ * <th>Direct which will be promoted</th>
* </tr>
- * <tr>
+ * <tr align=center>
* <td>peptides</td>
* <td>Ensembl</td>
* <td>Uniprot</td>
* </tr>
- * <tr>
+ * <tr align=center>
* <td>peptides</td>
* <td>Ensembl</td>
* <td>Uniprot</td>
* </tr>
- * <tr>
+ * <tr align=center>
* <td>dna</td>
* <td>Ensembl</td>
* <td>ENA</td>
return;
}
List<DBRefEntry> selfs = new ArrayList<DBRefEntry>();
- selfs.addAll(Arrays.asList(selectDbRefs(!sequence.isProtein(),
- sequence.getDBRefs())));
+ {
+ DBRefEntry[] selfArray = selectDbRefs(!sequence.isProtein(),
+ sequence.getDBRefs());
+ if (selfArray == null || selfArray.length == 0)
+ {
+ // nothing to do
+ return;
+ }
+ selfs.addAll(Arrays.asList(selfArray));
+ }
// filter non-primary refs
for (DBRefEntry p : pr)