JDK-8152844 : JVM InstanceKlass Methods For Obtaining Package/Module Should Be Moved to Klass
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-03-28
  • Updated: 2016-05-26
  • Resolved: 2016-04-26
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 9
9 b120Fixed
Related Reports
Blocks :  
Description
Currently InstanceKlass contains two public methods for obtaining an InstanceKlass' PackageEntry or ModuleEntry.  To avoid constantly casting a Klass * to an InstanceKlass, both package() and module() methods should be a virtual method on Klass.  This will avoid the situation where a cast like the following must be made:

ModuleEntry* module_entry = InstanceKlass::cast(klass)->module();