Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-237

non-empty final arrays should be private as they are mutable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: None
    • Labels:
      None

      Description

      Final array elements are not themselves final.

      So any final arrays should always be private, otherwise external code can corrupt the entries accidentally or deliberately.

      Either the array can be accessed through a getter that clones the contents, or the entries can be accessed through a getter that returns a single entry.

      This issue affects:
      Constants.class:
      CONSTANT_NAMES
      ACCESS_NAMES
      INTERFACES_IMPLEMENTED_BY_ARRAYS
      TYPE_NAMES
      CLASS_TYPE_NAMES
      SHORT_TYPE_NAMES
      NO_OF_OPERANDS
      TYPE_OF_OPERANDS
      OPCODE_NAMES
      CONSUME_STACK
      PRODUCE_STACK
      ATTRIBUTE_NAMES
      ITEM_NAMES
      METHODHANDLE_NAMES

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb@apache.org Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: