Given JavaDoc:
public AclEntry.Builder setFlags(Set<AclEntryFlag> flags)
Sets the flags component of this builder. On return, the flags
component of this builder is a copy of the given set.
Returns:
this builder
Throws:
ClassCastException - if the set contains elements that are not of type
AclEntryFlag
I would expect an empty set argument in "flags" to work (and so does the JDK "sample"
app AclEdit.java, by the way), but no:
> java -cp . AclEdit A2=Alle:write_data/append_data:deny derby.log
Exception in thread "main" java.lang.IllegalArgumentException: Collection is empty
at java.util.EnumSet.copyOf(EnumSet.java:166)
at java.nio.file.attribute.AclEntry$Builder.setFlags(AclEntry.java:216)
at AclEdit.parseAceString(AclEdit.java:162)
at AclEdit.main(AclEdit.java:294)
Alan Bateman confirmed this is a code bug.
public AclEntry.Builder setFlags(Set<AclEntryFlag> flags)
Sets the flags component of this builder. On return, the flags
component of this builder is a copy of the given set.
Returns:
this builder
Throws:
ClassCastException - if the set contains elements that are not of type
AclEntryFlag
I would expect an empty set argument in "flags" to work (and so does the JDK "sample"
app AclEdit.java, by the way), but no:
> java -cp . AclEdit A2=Alle:write_data/append_data:deny derby.log
Exception in thread "main" java.lang.IllegalArgumentException: Collection is empty
at java.util.EnumSet.copyOf(EnumSet.java:166)
at java.nio.file.attribute.AclEntry$Builder.setFlags(AclEntry.java:216)
at AclEdit.parseAceString(AclEdit.java:162)
at AclEdit.main(AclEdit.java:294)
Alan Bateman confirmed this is a code bug.