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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • None
    • core-libs
    • None

      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."""

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

              Created:
              Updated:
              Resolved: