Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8247868

com.sun.jdi.ObjectReference::setValue should throw InvalidTypeException for non-modifiable final fields

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 15
    • Fix Version/s: 16
    • Component/s: core-svc
    • Labels:
      None

      Description

      Static final fields are non-modifiable via Field::set. In JDI, ObjectReference::setValue throws InvalidTypeException if the given Field is static final field (see ReferenceTypeImpl::validateFieldAccess)

      Non-static final fields in a hidden class are non-modifiable via Field::set. ObjectReference::setValue should respect the spec of Field::set that ObjectReference::setValue can change the value of a given Field if it is modifiable.

      It's unclear if the spec of ObjectReference::setValue should clarifiy the behavior regardless of the value of the accessible flag of the given Field.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mchung Mandy Chung
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: