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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 16
    • Component/s: core-svc
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

                Dates

                Created:
                Updated:
                Resolved: