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

Symbol constructor uses u1 as the element type of its name argument

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b14

      Description

      Follow up to JDK-8195100 from Kim Barrett:

      src/hotspot/share/classfile/symbolTable.cpp
      478 _created = SymbolTable::the_table()->allocate_symbol((const u1*)_name, _len, _heap, _thread);

      [pre-existing] Why does the Symbol take a const u1* name argument?
      Especially since that's not how it's used? It should probably be
      const char*.

      Agree, I prefer symbolTable APIs to consistently use “const char *” throughout and only cast to (const u1*) when using Symbol APIs.

      To me it seems like a bug that the Symbol constructor uses u1 as the
      element type of its name argument. I also wonder why it uses jbyte
      rather than char as the element type of the body, but maybe there is
      some underlying string that would be pulled by changing that. Doing
      anything about this could be a followup cleanup RFE.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hseigel Harold Seigel
              Reporter:
              gziemski Gerard Ziemski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: