[Biojava-dev] [patch] fix NPE when retrieving feature annotations from BioSQL

Simon Foote simon.foote at nrc-cnrc.gc.ca
Wed Jul 16 09:53:30 EDT 2003


Hi Len,

Your method sounds correct to me.
 I will apply the patch to the cvs later today, along with your taxon 
patch which also looks fine.

Simon

-- 
Bioinformatics Specialist
Institute for Biological Sciences
National Research Council of Canada
[T] 613-990-0561  [F] 613-952-9092
simon.foote at nrc-cnrc.gc.ca


Len Trigg wrote:

>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(BioSQLFeatureAnno
>tation.java:209)
>        at
>org.biojava.bio.seq.io.SeqIOEventEmitter.getSeqIOEvents(SeqIOEventEmitter.ja
>va: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.
>
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>biojava-dev mailing list
>biojava-dev at biojava.org
>http://biojava.org/mailman/listinfo/biojava-dev
>  
>




More information about the biojava-dev mailing list