RFR 8170900: Issue with FilePermission::implies for wildcard flag(-)

Wang Weijun weijun.wang at oracle.com
Tue Jan 3 03:40:10 UTC 2017


Ping again.

> On Dec 22, 2016, at 8:23 AM, Wang Weijun <weijun.wang at oracle.com> wrote:
> 
> Hi Roger
> 
>> On Dec 20, 2016, at 11:49 PM, Roger Riggs <Roger.Riggs at oracle.com> wrote:
>> 
>> Hi Max,
>> 
>> Comments:
>> 
>> - Is there a better term/phrase to use other than "foo"; it does not appear elsewhere in the @implNote.
> 
> It appears in the spec of this method:
> 
> * <li> <i>p</i>'s pathname is implied by this object's
> *      pathname. For example, "/tmp/*" implies "/tmp/foo", since
> *      "/tmp/*" encompasses all files in the "/tmp" directory,
> *      including the one named "foo".
> 
>>  The use of "cpath" and "npath" implies that someone is reading the source code.
> 
> Not really. They also appears in the @implNote of the spec of FilePermission::<init>(String,String):
> 
> * If the value of the system property is set to {@code true}, {@code path}
> * is canonicalized and stored as a String object named {@code cpath}.
> * This means a relative path is converted to an absolute path, a Windows
> * DOS-style 8.3 path is expanded to a long path, and a symbolic link is
> * resolved to its target, etc.
> * <P>
> * If the value of the system property is set to {@code false}, {@code path}
> * is converted to a {@link java.nio.file.Path} object named {@code npath}
> * after {@link Path#normalize() normalization}. No canonicalization is
> * performed which means the underlying file system is not accessed.
> * If an {@link InvalidPathException} is thrown during the conversion,
> * this {@code FilePermission} will be labeled as invalid.
> 
> I think using the same name in all @implNote is more precise.
> 
>>  The description of the behavior of the implementation should use the same terminology as the spec.
>> 
>> - The use of "Note" weakens the text as specification language.  It can be omitted.
> 
> OK.
> 
> I'll use take Xuelei's advice to expand this line to
> 
>  This means "/-" implies "/foo" but not "foo".
> 
>> 
>> - To make the source version more readable, I would keep each statement on its own line.
> 
> OK.
> 
> Thanks
> Max
> 
>> 
>>   Note that this means "/-" does not imply "foo".
>>   An invalid {@code FilePermission} does not imply any object except for itself.
>> 
>> Thanks, Roger
>> 
>> On 12/20/2016 2:25 AM, Wang Weijun wrote:
>>> Ping again.
>>> 
>>>> On Dec 14, 2016, at 1:53 PM, Wang Weijun <weijun.wang at oracle.com> wrote:
>>>> 
>>>> An clarification is added to FilePermission::implies:
>>>> 
>>>>     * @implNote
>>>>       ....
>>>>     * a simple {@code npath} is recursively inside a wildcard {@code npath}
>>>>     * if and only if {@code simple_npath.relativize(wildcard_npath)}
>>>> -     * is a series of one or more "..". An invalid {@code FilePermission} does
>>>> +     * is a series of one or more "..". Note that this means "/-" does not
>>>> +     * imply "foo". An invalid {@code FilePermission} does
>>>>     * not imply any object except for itself.
>>>> 
>>>> The newly added sentence is
>>>> 
>>>> Note that this means "/-" does not imply "foo".
>>>> 
>>>> JCK has agreed to update their test.
>>>> 
>>>> Since this is just a clarification inside an @implNote and no spec is updated, I suppose no CCC is needed. Please confirm.
>>>> 
>>>> Thanks
>>>> Max
>>>> 
>> 
> 



More information about the core-libs-dev mailing list