[Biojava-dev] [patch] fix NPE when retrieving feature annotations
from BioSQL
Len Trigg
len at reeltwo.com
Wed Jul 16 11:46:17 EDT 2003
Hi guys,
I was trying to dump a sequence that was stored in biosql where some
of the features have annotations, and got the following exception:
Exception in thread "main" java.lang.NullPointerException
at org.biojava.bio.seq.db.biosql.BioSQLFeatureAnnotation.keys(BioSQLFeatureAnnotation.java:209)
at org.biojava.bio.seq.io.SeqIOEventEmitter.getSeqIOEvents(SeqIOEventEmitter.java:112)
at org.biojava.bio.seq.io.GenbankFormat.writeSequence(GenbankFormat.java:194)
at org.biojava.bio.seq.io.GenbankFormat.writeSequence(GenbankFormat.java:156)
...
It seemed that somewhere is asking for the annotation keys for some of
the other Features that did not have annotations, and the annotations
object was not being set in this case. I'm not sure whether the
correct fix is to ensure that the annotations object is always
initialized (as in my attached patch), or whether the upstream code
should not even be asking for this information.
Cheers,
Len.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQLFeatureAnnotation.patch
Type: application/octet-stream
Size: 879 bytes
Desc: not available
Url : http://pw600a.bioperl.org/pipermail/biojava-dev/attachments/20030716/f1d38055/SQLFeatureAnnotation.lha
More information about the biojava-dev
mailing list