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

[lworld] Array and primitive classes modifier mask should include identity bits

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3
    • repo-valhalla
    • None
    • core-libs
    • None

    Description

      The spec and implementation for the modifier mask for array classes do not include the ACC_IDENTITY bits.
      The draft JEP, and specs specify that arrays are identity objects but this is not reflected in the APIs.

      The spec for Class.getModifiers() identifies only a few specific bits that are defined for arrays and primitive classes. The others are left undefined.

      The APIs that depend on the Class.getModifier() bits include:
       - Class.isIdentity() - 0x20, except for arrays that needs to be special cased
       - Class.accessFlags() - maps the bits to a set of AccessFlags, except arrays are special cased

      A consistent view across these APIs without special casing will prevent applications from having to know the special cases and work around them.

      The spec for array class modifiers should be updated to specify ACC_IDENTITY.
      Perhaps the spec should require unused bits to be zero.
      The effect on implementations should be investigated.

      Attachments

        Activity

          People

            rriggs Roger Riggs
            rriggs Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: