Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252464

Convert SystemDictionary::WKID to enum class

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 16
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:

      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));
        }
      }



        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iklam Ioi Lam
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: