8191948: db error: InvalidTypeException: Can't assign double[][][] to double[][][]

Reviewed-by: sspitsyn, amenkov
This commit is contained in:
Daniil Titov 2018-07-12 22:53:35 -07:00
parent b2f4d61fb9
commit 8afac1c9da
3 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1153,7 +1153,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
this.genericSignatureGotten = true;
}
private static boolean isPrimitiveArray(String signature) {
private static boolean isOneDimensionalPrimitiveArray(String signature) {
int i = signature.lastIndexOf('[');
/*
* TO DO: Centralize JNI signature knowledge.
@ -1162,7 +1162,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
* jdk1.4/doc/guide/jpda/jdi/com/sun/jdi/doc-files/signature.html
*/
boolean isPA;
if (i < 0) {
if (i < 0 || signature.startsWith("[[")) {
isPA = false;
} else {
char c = signature.charAt(i + 1);
@ -1186,7 +1186,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
ClassLoaderReferenceImpl loader =
(ClassLoaderReferenceImpl)classLoader();
if ((loader == null) ||
(isPrimitiveArray(signature)) //Work around 4450091
(isOneDimensionalPrimitiveArray(signature)) //Work around 4450091
) {
// Caller wants type of boot class field
type = vm.findBootType(signature);

View File

@ -98,7 +98,8 @@ public class eval001 extends JdbTest {
{ DEBUGGEE_CLASS + "._eval001a.myMethod()", "2147483647" },
{ "myClass.toString().equals(\"abcde\")", "true"},
{ "i + j + k", "777"},
{ "new java.lang.String(\"Hello, World\").length()", "12"}
{ "new java.lang.String(\"Hello, World\").length()", "12"},
{ DEBUGGEE_CLASS + "._eval001a.testPrimitiveArray(test)", "1.0" }
};
protected void runCases() {

View File

@ -48,6 +48,7 @@ public class eval001a {
int i = 111;
int j = 222;
int k = 444;
double[][][] test = new double[2][2][2];
synchronized (this) {
lastBreak();
@ -81,4 +82,8 @@ public class eval001a {
return line;
}
}
public double testPrimitiveArray(double[][][] d){
return 1.0;
}
}