JDK-8221470 : Print methods in exception messages in java-like Syntax.
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-03-26
  • Updated: 2024-06-24
  • Resolved: 2019-04-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.25-oracleFixed 13 b16Fixed
Related Reports
Blocks :  
Blocks :  
Description
A row of exceptions are thrown from the hotspot runtime. 
They print methods with their JNI signatures. To increase
readability and resemblance to source code, print them
in a Java-like syntax.

Some examples:

current method printouts:

test.TeMe3_B.ma()V
test.TeMe3_B.ma(IZ[[BF)[[D
test.TeMe3_B.ma([[[Ljava/lang/Object;)[[Ltest/TeMe3_B;

improved format:

void test.TeMe3_B.ma()
double[][] test.TeMe3_B.ma(int, boolean, byte[][], float)
test.TeMe3_B[][] test.TeMe3_B.ma(java.lang.Object[][][])

So far, Method::name_and_sig_as_C_string() is used to print
these messages.

Implement function Method::external_name() that prints the better 
format. 
external_name() is chosen according to Klass::external_name().

Printing the better format requires parsing the signature 
Symbol. This is implemented in 
void Symbol::print_as_signature_external_return_type(outputStream *os);
void Symbol::print_as_signature_external_parameters(outputStream *os);
These method names are chosen according to Symbol::as_class_external_name().

Adapt printing messages and according tests.
Comments
Fix Request I would like to downport this change to further improve the exception message. Also, it is used in other changes I will want to downport, as JDK-8218628. I need a review because the context changed so that a single hunk did not apply: http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-May/001139.html I can not think of risks for this change.
14-05-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/532e88de77eb User: dholmes Date: 2019-04-05 00:22:21 +0000
05-04-2019