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

com.sun.tools.jdi.ObjectReferenceImpl#validateAssignment always requests referenceType

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 15
    • 16
    • core-svc
    • b16

    Description

      After JDK-8241080 changes com.sun.tools.jdi.ObjectReferenceImpl#validateAssignment now always
      requests referenceType (requiring one more jdwp packet if value is not yet cached), previously it happened only for arrays.

      Simple fix like this solves the issue:

      diff -r 6ab9279c0e99 src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java
      --- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java Wed Sep 02 18:37:31 2020 +0200
      +++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java Tue Sep 08 10:59:50 2020 -0700
      @@ -586,11 +586,10 @@
                */
       
               JNITypeParser destSig = new JNITypeParser(destination.signature());
      - JNITypeParser sourceSig = new JNITypeParser(type().signature());
               if (destSig.isPrimitive()) {
                   throw new InvalidTypeException("Can't assign object value to primitive");
               }
      - if (destSig.isArray() && !sourceSig.isArray()) {
      + if (destSig.isArray() && !new JNITypeParser(type().signature()).isArray()) {
                   throw new InvalidTypeException("Can't assign non-array value to an array");
               }
               if (destSig.isVoid()) {

      Attachments

        Issue Links

          Activity

            People

              dtitov Daniil Titov (Inactive)
              dtitov Daniil Titov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: