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

Incorrect use of Class.getCanonicalName()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.4, 1.7.1, 1.8.0
    • mapreduce, test
    • None

    Description

      It looks like there's some places where we're incorrectly using getCanonicalName instead of getName for serialization (when we expect to be able to later call Class.forName() to load the class dynamically).

      Most of these occur in tests, and don't matter, because there's no difference between the name and canonical name. However, there is a big issue in RangeInputSplit, which serializes the AuthenticationToken name... this could be a serious bug if any other AuthenticationToken types are created and used by people implementing their own security modules.

      General rule:

      • use getName() if you expect to later call forName()
      • use getCanonicalName() if you're generating code or printing log messages

      Attachments

        Activity

          People

            ctubbsii Christopher Tubbs
            ctubbsii Christopher Tubbs
            Votes:
            0 Vote for this issue
            Watchers:
            1 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