Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-961

org.apache.commons.lang3.reflect.FieldUtils.removeFinalModifier(Field) does not clean up after itself

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2, 3.2.1
    • 3.3
    • lang.reflect.*
    • None

    Description

      FieldUtils.removeFinalModifier(Field) calls setAccessible(true) on the Field it is working on but does not reset it to false when done, after the final modifier has been removed. Also the method does not need to call setAccessible(true) if the field is already accessible.

      • Only call setAccessible when needed
      • Refactor and add a new method removeFinalModifier(Field field, boolean forceAccess)

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: