Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5452

Possible NPE in NsTest.printException()

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.8.1.2, 10.9.1.0
    • 10.8.2.2, 10.9.1.0
    • Test
    • None

    Description

      NsTest.printException() contains the following piece of code:

      if (e.getMessage().equals(null))

      { System.out.println("NULL error message detected"); System.out.println("Here is the NULL exection - " + e.toString()); System.out.println("Stack trace of the NULL exception - "); e.printStackTrace(System.out); }

      It's supposed to detect if e.getMessage() returns null. However, if it does return null, calling equals() on the return value will result in a NullPointerException.

      The condition should be changed to (e.getMessage() == null).

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            knutanders Knut Anders Hatlen
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment