JDK-8247938 : Change various JVM enums like LinkInfo::AccessCheck and Klass::DefaultsLookupMode to enum class
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-06-19
  • Updated: 2024-11-18
  • Resolved: 2020-08-06
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 16
16 b11Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The following enums:

linkResolver.hpp - class LinkInfo

  enum AccessCheck {
    needs_access_check,
    skip_access_check
  };

klass.hpp - class Klass

  enum DefaultsLookupMode { find_defaults, skip_defaults };
  enum OverpassLookupMode { find_overpass, skip_overpass };
  enum StaticLookupMode   { find_static,   skip_static };
  enum PrivateLookupMode  { find_private,  skip_private };

Should be changed to C++11 enum class to provide better type safety.  Current implementation allows for the enums to be incorrectly compared to boolean true or false.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/db6952bf8c39 User: lfoltan Date: 2020-08-06 18:14:50 +0000
06-08-2020