@Override
public void append(AlignmentI toappend)
{
- if (toappend == this)
- {
- System.err.println("Self append may cause a deadlock.");
- }
// TODO JAL-1270 needs test coverage
// currently tested for use in jalview.gui.SequenceFetcher
boolean samegap = toappend.getGapCharacter() == getGapCharacter();
.getFullAlignment().getSequences() : toappend.getSequences();
if (sqs != null)
{
+ // avoid self append deadlock by
+ List<SequenceI> toappendsq = new ArrayList<SequenceI>();
synchronized (sqs)
{
for (SequenceI addedsq : sqs)
}
}
}
- addSequence(addedsq);
+ toappendsq.add(addedsq);
}
}
+ for (SequenceI addedsq : toappendsq)
+ {
+ addSequence(addedsq);
+ }
}
AlignmentAnnotation[] alan = toappend.getAlignmentAnnotation();
for (int a = 0; alan != null && a < alan.length; a++)