JDK-8154234 : Remove netdoc URL protocol Handler
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-04-14
  • Updated: 2017-05-17
  • Resolved: 2016-06-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
9 b125Fixed
Sub Tasks
JDK-8176351 :  
src/java.base/share/classes/sun/net/www/protocol/netdoc/Handler.java doesn't seem to be used anywhere, and is only referenced in a few property files in langtools.

It seems this can be removed.
The 'netdoc' protocol is used for URL points either into the local filesystem or externally through an HTTP URL, with network documents being preferred. It was, at one point, considered useful for FAQs & other documents which are likely to be changing over time at a central site, and where the user will want the most recent edition, but ultimately failed to achieve popularity. It is essentially defunct and is not supported by Safari, Firefox, and other major browsers. java.net.URL defines the platform supported protocols [1], netdoc is NOT one of the protocols specified by the Java platform, it is simply an implementation specific protocol supported by the JRE. The proposal is to simply remove the netdoc handler, whereby URL's constructed with the netdoc protocol, e.g. "netdoc:http://foo.com/index.html" will now throw MalformedURLException. This is the specified exception for an unknown protocol. The only change needed is to remove the sun/net/www/protocol/netdoc handler. Since these handlers are dynamically loaded no other changes are required. There is a small potential risk. After this change all URLs using the netdoc protocol will fail, but we don't think they are used anywhere [1] http://docs.oracle.com/javase/8/docs/api/java/net/URL.html#URL-java.lang.String-java.lang.String-int-java.lang.String-