Uploaded image for project: 'cTAKES'
  1. cTAKES
  2. CTAKES-241

NullPointerException in ctakes-assertion

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 3.1.0
    • 3.2.1
    • ctakes-assertion
    • None

    Description

      Assertion module throws an NullPointerException if sentence is null:

      I do not full understand ~171, there is a null check, but it doesn't do much other than the log. Subsequently, once it hits, int lineNumber = sentence.getSentenceNumber() + 1, it will throw an NPE.

      Should the else{} cover the rest of the method?

      org.apache.ctakes.assertion.medfacts.i2b2.api.CharacterOffsetToLineTokenConverterCtakesImpl.convertCharacterOffsetToLineToken(CharacterOffsetToLineTokenConverterCtakesImpl.java:171)

      Sentence sentence = findPreviousOrCurrentSentence(characterOffset);
      if (sentence == null)

      { logger.info("current or previous sentence IS NULL!"); }

      else

      { logger.debug("current or previous sentence -- id: " + sentence.getAddress() + "; begin: " + sentence.getBegin() + "; end: " + sentence.getEnd()); }

      int lineNumber = sentence.getSentenceNumber() + 1;

      Attachments

        Activity

          People

            chenpei Pei Chen
            chenpei Pei Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: