Skip to content

Commit

Permalink
fix(groups): replace invalid Hibernate CollectionHelper usage with JD…
Browse files Browse the repository at this point in the history
…K set generator #8531
  • Loading branch information
poikilotherm committed Mar 25, 2022
1 parent 9589d3f commit 43126e1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import edu.harvard.iq.dataverse.engine.command.DataverseRequest;
import java.util.Collections;
import java.util.Set;
import org.hibernate.validator.internal.util.CollectionHelper;

/**
* Provider for the built-in, hard coded groups. This class is a singleton (no
Expand Down Expand Up @@ -56,7 +55,7 @@ public Set<Group> groupsFor(DataverseRequest req) {
@Override
public Set<Group> groupsFor(RoleAssignee ra) {
if (ra instanceof AuthenticatedUser){
return CollectionHelper.asSet(AllUsers.get(), AuthenticatedUsers.get());
return Set.of(AllUsers.get(), AuthenticatedUsers.get());
} else if ( ra instanceof User) {
return Collections.singleton(AllUsers.get());
} else {
Expand All @@ -72,6 +71,6 @@ public Group get(String groupAlias) {

@Override
public Set<Group> findGlobalGroups() {
return CollectionHelper.asSet(AllUsers.get(), AuthenticatedUsers.get());
return Set.of(AllUsers.get(), AuthenticatedUsers.get());
}
}

0 comments on commit 43126e1

Please sign in to comment.