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

Stephen Flores stephen.flores at oracle.com
Wed Dec 21 13:57:58 PST 2011



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.

Did you want to use HashSet for the just empty Set in setFlags(Set) or 
for every set, in order to remove the if block?

If for just the empty set then we should be consistent with what the 
what the constructor uses: Collections.emptySet.

>
>>
>> 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.
>

I was confused, I thought you wanted a file named AclEntry, but you want 
a subdirectory named AclEntry, OK. My last bug with regex.Pattern had 
the test in the "regex" subdirectory at the same level as the Pattern 
class, not in a Pattern subdirectory, so I put the 
AclEntryBuilderSetFlags test in the attributes which is at the same 
level as the AclEntry class. Are the test subdirectory levels different 
for nio than for other packages or is this a new standard for packages 
going forward?

Steve.

> -Alan.


More information about the nio-dev mailing list