Derby
  1. Derby
  2. DERBY-5706

Clean up statements in CreateTableFromQueryTest

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.9.1.0
    • Component/s: Test
    • Labels:
      None

      Description

      CreateTableFromQueryTest has a Statement field that it closes, but doesn't null out, in tearDown(). Since the field isn't nulled out, it cannot be garbage collected, and one Statement per test case will be left on the heap after completion.

      1. d5706-1a.diff
        6 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Thanks, Kristian.
        Committed revision 1329633.

        Show
        Knut Anders Hatlen added a comment - Thanks, Kristian. Committed revision 1329633.
        Hide
        Kristian Waagan added a comment -

        Looks good, +1. I ran the test with and without the patch.

        Show
        Kristian Waagan added a comment - Looks good, +1. I ran the test with and without the patch.
        Hide
        Knut Anders Hatlen added a comment -

        Attaching a patch that removes the statement field and instead calls createStatement() as needed in the test methods. This also allowed removal of tearDown() and simplification of setUp().

        The patch additionally removes unused imports and closes a ResultSet that's left open.

        Show
        Knut Anders Hatlen added a comment - Attaching a patch that removes the statement field and instead calls createStatement() as needed in the test methods. This also allowed removal of tearDown() and simplification of setUp(). The patch additionally removes unused imports and closes a ResultSet that's left open.

          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