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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 12
    • 12
    • hotspot
    • 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

              hseigel Harold Seigel (Inactive)
              gziemski Gerard Ziemski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: