Clean up a bunch of warnings. #8320

This commit is contained in:
Mark H. Wood
2022-07-13 14:03:42 -04:00
parent 023fc6a29c
commit e9313acd24
22 changed files with 156 additions and 183 deletions

View File

@@ -22,6 +22,8 @@ import java.util.UUID;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dspace.authorize.AuthorizeConfiguration;
import org.dspace.authorize.AuthorizeException;
import org.dspace.authorize.ResourcePolicy;
@@ -52,8 +54,6 @@ import org.dspace.xmlworkflow.storedcomponents.PoolTask;
import org.dspace.xmlworkflow.storedcomponents.service.ClaimedTaskService;
import org.dspace.xmlworkflow.storedcomponents.service.CollectionRoleService;
import org.dspace.xmlworkflow.storedcomponents.service.PoolTaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
@@ -64,7 +64,7 @@ import org.springframework.beans.factory.annotation.Autowired;
* @author kevinvandevelde at atmire.com
*/
public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements GroupService {
private static final Logger log = LoggerFactory.getLogger(GroupServiceImpl.class);
private static final Logger log = LogManager.getLogger();
@Autowired(required = true)
protected GroupDAO groupDAO;
@@ -473,7 +473,7 @@ public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements
@Override
public void delete(Context context, Group group) throws SQLException {
if (group.isPermanent()) {
log.error("Attempt to delete permanent Group $", group.getName());
log.error("Attempt to delete permanent Group {}", group::getName);
throw new SQLException("Attempt to delete a permanent Group");
}
@@ -715,7 +715,7 @@ public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements
// if the group is used for one or more roles on a single collection,
// admins can eventually manage it
List<CollectionRole> collectionRoles = collectionRoleService.findByGroup(context, group);
if (collectionRoles != null && collectionRoles.size() > 0) {
if (collectionRoles != null && !collectionRoles.isEmpty()) {
Set<Collection> colls = new HashSet<>();
for (CollectionRole cr : collectionRoles) {
colls.add(cr.getCollection());