Derby
  1. Derby
  2. DERBY-4899

Refactor access to primary structures in AlterTableConstantAction

    Details

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

      Description

      Many of the private methods in impl.sql.execute.AlterTableConstantAction take the activation (and sometimes a number of references obtained through it) as an argument. This seems unnecessary, and it clutters the code with argument passing, boilerplate code and variable hiding.

      1. derby-4899-1b-cleanup.diff
        17 kB
        Kristian Waagan
      2. derby-4899-1a-cleanup.diff
        17 kB
        Kristian Waagan

        Activity

        Hide
        Kristian Waagan added a comment -

        Closing issue.

        Show
        Kristian Waagan added a comment - Closing issue.
        Hide
        Kristian Waagan added a comment -

        Committed patch 1b to trunk with revision 1034347.

        Show
        Kristian Waagan added a comment - Committed patch 1b to trunk with revision 1034347.
        Hide
        Kristian Waagan added a comment -

        Attaching patch 1b, which removes another unused variable.
        Note that I have consequently used space for indentation.

        Thanks for looking at the patch, Bryan and Dag.

        Show
        Kristian Waagan added a comment - Attaching patch 1b, which removes another unused variable. Note that I have consequently used space for indentation. Thanks for looking at the patch, Bryan and Dag.
        Hide
        Dag H. Wanvik added a comment -

        Looks good to me, geez that was really messy.

        Show
        Dag H. Wanvik added a comment - Looks good to me, geez that was really messy.
        Hide
        Bryan Pendleton added a comment -

        +1 to simplifying and removing unnecessary code!

        Show
        Bryan Pendleton added a comment - +1 to simplifying and removing unnecessary code!
        Hide
        Kristian Waagan added a comment -

        BTW; I made this patch because I'll be changing the update statistics code when adding automatic index statistics updates.

        Show
        Kristian Waagan added a comment - BTW; I made this patch because I'll be changing the update statistics code when adding automatic index statistics updates.
        Hide
        Kristian Waagan added a comment -

        Attaching patch 1a with suggested cleanup.

        AlterTableConstantAction.java | 197 ++++++++++--------------------------------
        1 file changed, 49 insertions, 148 deletions

        Regression tests passed.
        Patch ready for review.

        Show
        Kristian Waagan added a comment - Attaching patch 1a with suggested cleanup. AlterTableConstantAction.java | 197 ++++++++++-------------------------------- 1 file changed, 49 insertions , 148 deletions Regression tests passed. Patch ready for review.

          People

          • Assignee:
            Kristian Waagan
            Reporter:
            Kristian Waagan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development