-
Sub-task
-
Resolution: Fixed
-
P3
-
9
-
b53
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8081871 | emb-9 | Chris Hegarty | P3 | Resolved | Fixed | b53 |
Being able to effectively specify URL protocol handler factories as fully qualified class names, through the 'java.protocol.handler.pkgs' system property is problematic. It requires the protocol handler factory implementation class to be public and accessible, as the current implementation tries to instantiate it through core reflection. Since the protocol handler factory must be an implementation of a URLStreamHandlerFactory, it lends itself to being retrofitted with a ServiceLoader lookup. Note, the 'java.protocol.handler.pkgs' system property mechanism predates ServiceLoader. URL protocol handlers would most likely have used service loader if it were available at the time.
Some URL protocol handlers are fundamental to the platform itself, like 'file' and 'jar', it is not appropriate to attempt a service loader lookup for these, as they may lead to recursive initialization issues. However, Java Plugin, Webstart, and possibly other containers, do override the 'jar' handler. A new API should be provided for this purpose. Providing an API solution should not interfere with system initialization as it will only be called after the system comes up and user code is executing.
The 'file' protocol handler factory will no longer be overridable, and the system property will no longer be consulted.
- backported by
-
JDK-8081871 Update java.net.URL to work with modules
-
- Resolved
-
- duplicates
-
JDK-8065755 Drop the system property "java.protocol.handler.pkgs"
-
- Closed
-
-
JDK-8174803 Documentation of URLStreamHandlerFactory.createURLStreamHandler() doesn't mention null return value
-
- Closed
-
- relates to
-
JDK-8073667 URL should not use service loader to lookup the jar protocol handler
-
- Closed
-
-
JDK-8178799 Under Java 9 Java Web Start consumes the only URLStreamHandlerFactory slot
-
- Resolved
-
-
JDK-8075139 Restore java.protocol.handler.pkgs to work as a fallback for migration
-
- Closed
-
-
JDK-8213942 URLStreamHandler initialization race
-
- Closed
-
-
JDK-8139179 URLStreamHandler* should link to URL ctor that specifies how factories/providers are located
-
- Closed
-