8191948: db error: InvalidTypeException: Can't assign double[][][] to double[][][]
authordtitov
Thu, 12 Jul 2018 22:53:35 -0700
changeset 51087 73c769e0486a
parent 51086 57c152eb3198
child 51088 c36ca9d88f54
8191948: db error: InvalidTypeException: Can't assign double[][][] to double[][][] Reviewed-by: sspitsyn, amenkov
src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java
test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java
test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java
--- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java	Fri Jul 13 10:42:30 2018 -0400
+++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java	Thu Jul 12 22:53:35 2018 -0700
@@ -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 @@
         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 @@
          *  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 @@
             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);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java	Fri Jul 13 10:42:30 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java	Thu Jul 12 22:53:35 2018 -0700
@@ -98,7 +98,8 @@
         { 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() {
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java	Fri Jul 13 10:42:30 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java	Thu Jul 12 22:53:35 2018 -0700
@@ -48,6 +48,7 @@
         int i = 111;
         int j = 222;
         int k = 444;
+        double[][][] test = new double[2][2][2];
 
         synchronized (this) {
             lastBreak();
@@ -81,4 +82,8 @@
              return line;
         }
     }
+
+    public double testPrimitiveArray(double[][][] d){
+        return 1.0;
+    }
 }