JDK-8205611 : Improve the wording of LinkageErrors to include module and class loader information
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-06-25
  • Updated: 2024-06-20
  • Resolved: 2018-07-16
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 12
11.0.25-oracleFixed 12 b03Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Description
Review uses of java_lang_ClassLoader::describe_external in favor of replacing with the new method Klass::class_in_module_of_loader for more consistency across error messages with regards to how module and class loaders are worded within the message.

Also consider further improvements to Klass::joint_in_module_of loader() to combine the two class names reported and report instead of:

(C and D are in unnamed module of loader 'app')
to
(both classes are in unnamed module of loader 'app')
Comments
Fix Request I would like to downport "8205611: Improve the wording of LinkageErrors to include module and class loader information". This brings better information about classloaders and modules in various exception messages. I think it is important to improve these exceptions so that people learn more easily how to deal with modules. Also, 11 still will be around a while, so I think it's helpful to improve the usability of the VM with changes like these. The change also fixes some (harmless) code Coverity complains about. I need a review because deleting of obsolete java_lang_ClassLoader::describe_external() does not apply properly: http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-April/000925.html When downporting "8212937: Parent class loader may not have a referred ClassLoaderData ..." this had to be extended to this method now removed. Also, the test included in 8212937 was adapted when downported, and needs to be brought to the state as in 12/13 with this change. The risk of downporting this change is low, as it only changes printing messages of exceptions.
11-04-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/bef02342d179 User: lfoltan Date: 2018-07-16 15:35:13 +0000
16-07-2018