Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.8.2.2
    • Fix Version/s: 10.8.3.0, 10.9.1.0
    • Component/s: Test
    • Labels:
      None

      Description

      NsTest contains more occurrences of the broken null checking pattern found in DERBY-5452.

      Initializer.java:

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

      { e.printStackTrace(System.out); }

      DbSetup.java:

      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); }

      DbUtil.java:

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

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

      If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

      1. null.diff
        2 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Hide
          Knut Anders Hatlen added a comment -

          Committed to trunk, revision 1183671.
          Committed to 10.8, revision 1183672.

          Show
          Knut Anders Hatlen added a comment - Committed to trunk, revision 1183671. Committed to 10.8, revision 1183672.
          Hide
          Knut Anders Hatlen added a comment -

          Attaching a patch which replaces the broken equals() calls with ==.

          Show
          Knut Anders Hatlen added a comment - Attaching a patch which replaces the broken equals() calls with ==.

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development