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

Range constructors call overridable method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.4, 1.5.0
    • 1.7.4, 1.9.0
    • None

    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

            coffeethulhu Matthew Dinep
            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