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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P3
    • None
    • 15
    • core-svc
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              amenkov Alex Menkov
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: