[Biojava-dev] [Bug 2401] New: NullPointerException in SimpleNote.setTerm()

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Nov 15 12:56:46 UTC 2007


http://bugzilla.open-bio.org/show_bug.cgi?id=2401

           Summary: NullPointerException in SimpleNote.setTerm()
           Product: BioJava
           Version: 1.5
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: seq
        AssignedTo: biojava-dev at biojava.org
        ReportedBy: thomas at fkserv.ugent.be


When loading a RichSequence from an EMBL file like this:

RichSequenceIterator stream =
IOTools.readEMBLDNA(br,RichObjectFactory.getDefaultNamespace());
...
RichSequence seq = stream.nextRichSequence();
...

and trying to save it:

Session session = sessionFactory.openSession();
RichObjectFactory.connectToBioSQL(session);
Transaction tx = session.beginTransaction();
...
session.save("Sequence", seq);
tx.commit();
session.close();


A NullPointerException occurs in SimpleNote.setTerm(ComparableTerm term),
because this.term appears to be null, so this.term.equals(term) obviously gives
an error. I hope I didn't use a wrong method that caused this error, but it was
easily fixed by replacing this code (in biojavax.SimpleNote)

if (this.term.equals(term)) return;

by

if (this.term!=null && this.term.equals(term))  return;


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the biojava-dev mailing list