Derby
  1. Derby
  2. DERBY-5604

[patch] access static constants with static references

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 10.8.2.2
    • Fix Version/s: 10.9.1.0
    • Component/s: Store
    • Labels:
      None
    • Urgency:
      Low

      Description

      code access static fields by fetching instances and getting the static variable from the object. Just use the class reference.

        Activity

        Hide
        Dag H. Wanvik added a comment -

        Thanks, Dave. I noticed the following comment in the code for the declaration of BTree#maxRowsPerPage:

        RESOLVE (mikem) - this should not be static. Need to design a way in
        debugging mode to get btree created with a persistent "maxRowsPerPage".
        This hack makes all btrees get created with the "last" maxRowsPerPage
        value set.

        so that may be why the access pattern is the way it is. Mike, do you think the access code in LeafControlRow should be changed to reflect reality, or would you want to keep it the way it is until this gets resolved? It wouldn't do any hard to change it, were it changed to be a state variable, the compiler would flag the access via class.

        Show
        Dag H. Wanvik added a comment - Thanks, Dave. I noticed the following comment in the code for the declaration of BTree#maxRowsPerPage: RESOLVE (mikem) - this should not be static. Need to design a way in debugging mode to get btree created with a persistent "maxRowsPerPage". This hack makes all btrees get created with the "last" maxRowsPerPage value set. so that may be why the access pattern is the way it is. Mike, do you think the access code in LeafControlRow should be changed to reflect reality, or would you want to keep it the way it is until this gets resolved? It wouldn't do any hard to change it, were it changed to be a state variable, the compiler would flag the access via class.
        Hide
        Mike Matrigali added a comment -

        i am fine with making it reflect reality. use of the static is ugly either way, but i have not gotten around to it in many years so not likely in near future. I think it gets used only in some internal function tests to make it easy to create really deep trees without having to generate so much data. At this point it might make more sense to change the tests not to use it and make it , and just generate the data - back then machines
        were slow enough that i didn't want to pay the insert cost.

        note it is only possible to use this in a DEBUG server.

        Show
        Mike Matrigali added a comment - i am fine with making it reflect reality. use of the static is ugly either way, but i have not gotten around to it in many years so not likely in near future. I think it gets used only in some internal function tests to make it easy to create really deep trees without having to generate so much data. At this point it might make more sense to change the tests not to use it and make it , and just generate the data - back then machines were slow enough that i didn't want to pay the insert cost. note it is only possible to use this in a DEBUG server.
        Hide
        Dag H. Wanvik added a comment -

        Thanks, Mike! I'll commit it when I have run the regressions, then.

        Show
        Dag H. Wanvik added a comment - Thanks, Mike! I'll commit it when I have run the regressions, then.
        Hide
        Dag H. Wanvik added a comment -

        Regressions passed with the patch.

        Show
        Dag H. Wanvik added a comment - Regressions passed with the patch.
        Hide
        Dag H. Wanvik added a comment -

        Thanks, Dave. The patch is now committed as svn 1242656, resolving.Feel free to close.

        Show
        Dag H. Wanvik added a comment - Thanks, Dave. The patch is now committed as svn 1242656, resolving.Feel free to close.
        Hide
        Knut Anders Hatlen added a comment -

        [bulk update] Close all resolved issues that haven't been updated for more than one year.

        Show
        Knut Anders Hatlen added a comment - [bulk update] Close all resolved issues that haven't been updated for more than one year.

          People

          • Assignee:
            Dag H. Wanvik
            Reporter:
            Dave Brosius
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development