mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
Another batch of Error Prone fixes. (#3061)
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
package org.dspace.content;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -250,7 +250,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
}
|
||||
List<Relationship> rightRelationships = findByItemAndRelationshipType(context, itemToProcess, relationshipType,
|
||||
isLeft);
|
||||
if (maxCardinality != null && rightRelationships.size() >= maxCardinality) {
|
||||
if (rightRelationships.size() >= maxCardinality) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -266,6 +266,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
return StringUtils.equals(leftEntityType, entityTypeToProcess.getLabel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Relationship find(Context context, int id) throws SQLException {
|
||||
Relationship relationship = relationshipDAO.findByID(context, Relationship.class, id);
|
||||
return relationship;
|
||||
@@ -407,7 +408,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
// Set a limit on the total depth of relationships to traverse during a relationship change
|
||||
int maxDepth = configurationService.getIntProperty("relationship.update.relateditems.maxdepth", 5);
|
||||
// This is the list containing all items which will have changes to their virtual metadata
|
||||
List<Item> itemsToUpdate = new LinkedList<>();
|
||||
List<Item> itemsToUpdate = new ArrayList<>();
|
||||
itemsToUpdate.add(relationship.getLeftItem());
|
||||
itemsToUpdate.add(relationship.getRightItem());
|
||||
|
||||
|
Reference in New Issue
Block a user