Skip to content

Commit 101936b

Browse files
committed
fix(batch): create empty EnumSet via noneOf
1 parent 9f28126 commit 101936b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,9 @@ enum Action {
531531
*/
532532
protected BaseState(String name, Action... permitted) {
533533
this.name = name;
534-
this.permitted = EnumSet.copyOf(Arrays.asList(requireNonNull(permitted, "actions is null")));
534+
this.permitted = requireNonNull(permitted, "actions is null").length == 0
535+
? EnumSet.noneOf(Action.class)
536+
: EnumSet.copyOf(Arrays.asList(permitted));
535537
}
536538

537539
@Override

0 commit comments

Comments
 (0)