JDK-8258075 : Use auto variable declarations for enum iteration
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-11
  • Updated: 2022-06-27
  • Resolved: 2020-12-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 17
17 b03Fixed
Related Reports
Relates :  
Description
The pattern used in JDK-8257912

  for (vmIntrinsicID index : EnumRange<vmIntrinsicID>{}) {
    nt[as_int(index)] = string;
  }

can be further simplified to the following without loss of readability, since the type of index would be obviously the type enclosed by EnumRange<>

  for (auto index : EnumRange<vmIntrinsicID>{}) {
    nt[as_int(index)] = string;
  }

(as suggested by John Rose)
Comments
Changeset: 59f4c4aa Author: Ioi Lam <iklam@openjdk.org> Date: 2020-12-16 19:39:24 +0000 URL: https://git.openjdk.java.net/jdk/commit/59f4c4aa
16-12-2020