JDK-8213616 : URLPermission with query or fragment behaves incorrectly
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-09
  • Updated: 2018-12-07
  • Resolved: 2018-11-15
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.
JDK 12
12 b21Fixed
Related Reports
CSR :  
Sub Tasks
JDK-8213945 :  
Description
It's possible to create a java.net.URLPermission (contrary to the spec) with a query and/or fragment after the path, and this affects the behavior of the implies() method such that it behaves incorrectly.

URLPermission is specified that query and fragments are not part of the URL string passed to the constructor, but it is not specified to throw IAE.

The simplest solution might be to strip these components when the object is constructed.