Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8262277 URLClassLoader.getResource throws undocumented IllegalArgumentException
  3. JDK-8272044

Release Note: URLClassLoader No Longer Throws Undocumented IllegalArgumentException From getResource[s]() and findResource[s]()

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P5
    • Resolution: Delivered
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: core-libs

      Description

      In the event that there is a problem getting a resource, `URLClassLoader.getResource()` and `findResource()` now return `null` instead of throwing an undocumented `IllegalArgumentException`. The same is true of `Enumeration`s obtained from `URLClassLoader.getResources()` and `URLClassLoader.findResources()`.

      This behavior conforms with the long-standing specification. The situation would typically occur on Windows, due to the use of a Windows-style path (`"c:/windows"`).

        Attachments

          Activity

            People

            Assignee:
            bchristi Brent Christian
            Reporter:
            bchristi Brent Christian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: