JDK-8170900 : Issue with FilePermission::implies for wildcard flag(-)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-12-08
  • Updated: 2017-01-17
  • Resolved: 2017-01-05
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 9
9 b152Fixed
Related Reports
Relates :  
Description
Recently JCK test :

FilePermission fp1 = new FilePermission("/-", *���*read");
FilePermission fp2 = new FilePermission("filename", *���*read");
assertTrue(fp1.implies(fp2));

started failing.

After the changed made by JDK-8164705.

There is no clear direction and reason in spec that why this test will fail. In the comment section I am adding the discussion of Elena.
Comments
As said by Max (the bug owner) :- The behaviour mentioned above is as expected but we need to provide more clarification in the specification. This bug will be open to provide clarification in the spec.
14-12-2016

-- Mail by Elena to Max -- Hi Max, FilePermission::implies spec operates with different wordings: 1) ���this method returns true if ��� p's pathname is implied by this object's pathname��� - here ���pathname" is used 2) ���A wildcard pathname implies a simple pathname if and only if ��� if the wildcard flag is "-", the simple pathname's path must be recursively inside the wildcard pathname's path��� - here ���pathname���s path��� is used What does it really mean? If pathname is meant, then we can expect that new FilePermission(���/-���, ���read���).implies(new FilePermission(���somefile���, ���read���)) will return false, because ���somefile��� is not starts with ���/���. However, if pathname���s path is meant then the related path ���somefile��� of course will be implied by the root path wildcard ���/-���. Could you please clarify it? Thank you, Elena
08-12-2016