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

(cl) Clarify or remove "for delegation" in ClassLoader spec

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None

      Description

      The spec for ClassLoader.getParent
      https://docs.oracle.com/javase/9/docs/api/java/lang/ClassLoader.html#getParent--
      says """Returns the parent class loader for delegation.""" and this makes perfect sense since "for delegation" explains in what sense the returned value is a parent. But that phrase also appears in the spec for

      https://docs.oracle.com/javase/9/docs/api/java/lang/ClassLoader.html#getSystemClassLoader--

      """Returns the system class loader for delegation."""

      Here this is much less clear. Why not """Returns the system class loader.""" and later also explain that the returned class loader is the default parent for delegation.

      It also appears in the spec for

      https://docs.oracle.com/javase/9/docs/api/java/lang/ClassLoader.html#getPlatformClassLoader--

      """Returns the platform class loader for delegation."""

      and here I have no idea what "for delegation" might mean, except that perhaps this classloader is expected to appear in every delegation chain?

      But it's mostly obvious that if you don't delegate to the platform class loader, you will have a hard time starting a real world app. So just """Returns the platform class loader."""

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bchristi Brent Christian
                Reporter:
                martin Martin Buchholz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: