-
Bug
-
Resolution: Fixed
-
P3
-
15
-
b16
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()) {
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()) {
- relates to
-
JDK-8241080 Consolidate signature parsing code in serviceability tools
-
- Resolved
-