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

java.net.URL.setURLStreamHandlerFactory() doesn't clear handlers cache

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.1.4
    • Fix Version/s: 1.1.5
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.1.5
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        This could be bad for HotJava under JavaOS, if we ever decide to use
        setURLStreamHandlerFactory (and we might). JavaOS uses the http protocol
        before HotJava gets to run, so the http handler would already have been
        recorded in java.net.URL.handlers.

        The fix is trivial. Add this line to java.net.URL:

            public static synchronized void setURLStreamHandlerFactory(URLStreamHandlerF
        actory fac) {
                if (factory != null) {
                    throw new Error("factory already defined");
                }
                SecurityManager security = System.getSecurityManager();
                if (security != null) {
                    security.checkSetFactory();
                }
        --> handlers = new Hashtable()
                factory = fac;
            }

        A Pumpkin fix would be desirable

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                brenaudsunw Benjamin Renaud (Inactive)
                Reporter:
                bfootesunw Bill Foote (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: