JDK-8252464 : Convert SystemDictionary::WKID to enum class
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2020-08-27
  • Updated: 2021-09-14
  • Resolved: 2021-09-14
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 17
17Resolved
Related Reports
Duplicate :  
Relates :  
Description
Convert SystemDictionary::WKID to enum class to provide better type safety. Also implement proper enumerators for this type of enums to avoid code like this (which might get out of bounds if you're not careful):

void SystemDictionary::well_known_klasses_do(MetaspaceClosure* it) {
  for (int id = FIRST_WKID; id < WKID_LIMIT; id++) {
    it->push(well_known_klass_addr((WKID)id));
  }
}




Comments
This was fixed in JDK-8260467 in JDK 17.
14-09-2021