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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P3
    • None
    • Affects Version/s: 15
    • Component/s: core-svc
    • None

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

      Non-static final fields in a hidden class are non-modifiable via java.lang.reflect.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.

            Assignee:
            Alex Menkov
            Reporter:
            Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: