7076310: (file) AclEntry.Builder setFlags throws IllegalArgumentException if set argument is empty

Stephen Flores stephen.flores at oracle.com
Wed Dec 21 18:29:36 PST 2011


Alan,

Please review the updated the webrev:

   http://cr.openjdk.java.net/~sflores/7076310/webrev.00/

In setFlags(Set) "new HashSet" was changed to "Collections.emptySet"  to 
match the AclEntry constructor.

setPermissions(Set) was changed in the same way setFlags(Set) was changed.

The unit test was moved to .../AclEntry/EmptySet.java.

An assert for setPermissions was added to EmptySet.

Steve.

On 12/21/2011 04:19 PM, Alan Bateman wrote:
> On 21/12/2011 20:56, Stephen Flores wrote:
>>
>> If change setFlags(Set) and setPermissions(Set) to use a HashSet
>> instead of a EnumSet, for consistency, should I also change
>> setFlags(AclEntryFlags...) to use HashSet?
> I'd leave it as EnumSet is nice here given that the elements are enum
> types.
>
>>
>> It seems to me that jtreg expects one "main" class per unit test and I
>> see this done for some packages, are you saying you want one "main"
>> per class to be tested.
> With jtreg test then each test has a main class it may test dozens or
> hundreds of asserts (we have many of these multi to combo tests). My
> point was mostly about the location as I think it should be in
> test/java/nio/file/attribute/AclEntry. I don't have a strong opinion on
> the name but EmptySets.java would be okay. This is really a hole in our
> testing as AclEntry was forgotten. Is it tested to some degree by the
> test that reads and writes ACLs but we need more.
>
> -Alan.


More information about the nio-dev mailing list