Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8252933: com.sun.tools.jdi.ObjectReferenceImpl#validateAssignment alw…
…ays requests referenceType

Reviewed-by: cjplummer, amenkov
  • Loading branch information
Daniil Titov committed Sep 15, 2020
1 parent 74851c5 commit 65d6c10
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -586,12 +586,14 @@ void validateAssignment(ValueContainer destination)
*/

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");
Expand Down

2 comments on commit 65d6c10

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 65d6c10 Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 65d6c10 Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.