Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8167178 Exported elements referring to inaccessible types in java.naming
  3. JDK-8176352

Release Note: Exported elements referring to inaccessible types in java.naming

    XMLWordPrintable

Details

    • generic
    • generic
    • Verified

    Backports

      Description

        The `javax.naming.CompoundName`, an extensible type, has a protected member, `impl` whose type, `javax.naming.NameImpl`, is package-private. This is a long standing issue where an inaccessible implementation type has mistakenly made its way into the public Java SE API.
         
        The new `javac` lint option `javac -Xlint` helped identify this issue. In Java SE 9, this protected member has been removed from the public API.

        Compatibility:
        -----------------
        Since the type of the member is package-private it cannot be directly referenced by non-JDK code. The member type does not implement or extend any super type directly, therefore any non-JDK subtype of `javax.naming.CompoundName` could only refer to this member as Object. It is possible that such a subtype might invoke the `toString`, or any of `Object`'s methods on this member, or even synchronize on it. In such a case such subtypes of `javax.naming.CompoundName` will require updating.
         
        Source incompatible:
        ---------------------------
        Code making a static reference to the member will fail to compile, e.g. `error: impl has private access in CompoundName`

        Binary incompatible:
        ---------------------------
        Previously compiled code executed with JDK 9, accessing the member directly will fail, e.g. `java.lang.IllegalAccessError: tried to access field javax.naming.CompoundName.impl from class CompoundName$MyCompoundName`

        Attachments

          Issue Links

            Activity

              People

                vtewari Vyom Tewari
                vtewari Vyom Tewari
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: