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

Clean up statements in CreateTableFromQueryTest

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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
        knutanders 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
        knutanders 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.
        Hide
        kristwaa Kristian Waagan added a comment -

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

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

        Thanks, Kristian.
        Committed revision 1329633.

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development