Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-1972

Range constructors call overridable method

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.4, 1.5.0
    • Fix Version/s: 1.7.4, 1.9.0, 2.0.0
    • Component/s: None
    • Labels:

      Description

      Several Range constructors call Range.beforeStartKey(), which is not final. This is dangerous:

      The superclass constructor runs before the subclass constructor, so the overriding method in the subclass will get invoked before the subclass constructor has run. If the overriding method depends on any initialization performed by the subclass constructor, the method will not behave as expected. Item 17, Effective Java Vol. 2, Bloch

      If beforeStartKey() cannot be made final, the code should be refactored to make the constructors safe.

        Attachments

        1. 0001-ACCUMULO-1972-updated-beforeStartKey-to-private-impl.patch
          5 kB
          Matthew Dinep
        2. accumulo-1972_2.patch
          2 kB
          Matthew Dinep
        3. accumulo-1972.patch
          0.9 kB
          Matthew Dinep

          Activity

            People

            • Assignee:
              coffeethulhu Matthew Dinep
              Reporter:
              bhavanki Bill Havanki
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h