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

Reviewed-by: cjplummer, amenkov
This commit is contained in:
Daniil Titov 2020-09-15 15:29:12 +00:00
parent 74851c507b
commit 65d6c10185

View File

@ -586,12 +586,14 @@ public class ObjectReferenceImpl extends ValueImpl
*/
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()) {
throw new InvalidTypeException("Can't assign non-array value to an array");
if (destSig.isArray()) {
JNITypeParser sourceSig = new JNITypeParser(type().signature());
if (!sourceSig.isArray()) {
throw new InvalidTypeException("Can't assign non-array value to an array");
}
}
if (destSig.isVoid()) {
throw new InvalidTypeException("Can't assign object value to a void");