mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 21:13:19 +00:00
Clean up warnings, suggestions, and an unthrown and incorrect Throwable.
This commit is contained in:

committed by
Mark H. Wood

parent
6d2e3b3ea3
commit
e61352ef29
@@ -41,7 +41,7 @@ import java.util.*;
|
|||||||
public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> implements CollectionService {
|
public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> implements CollectionService {
|
||||||
|
|
||||||
/** log4j category */
|
/** log4j category */
|
||||||
private static Logger log = Logger.getLogger(CollectionServiceImpl.class);
|
private static final Logger log = Logger.getLogger(CollectionServiceImpl.class);
|
||||||
|
|
||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
protected CollectionDAO collectionDAO;
|
protected CollectionDAO collectionDAO;
|
||||||
@@ -132,7 +132,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
|||||||
return findAuthorized(context, null, actionID);
|
return findAuthorized(context, null, actionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Collection> myResults = new ArrayList<Collection>();
|
List<Collection> myResults = new ArrayList<>();
|
||||||
|
|
||||||
if(authorizeService.isAdmin(context))
|
if(authorizeService.isAdmin(context))
|
||||||
{
|
{
|
||||||
@@ -359,6 +359,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
|||||||
/**
|
/**
|
||||||
* Get the value of a metadata field
|
* Get the value of a metadata field
|
||||||
*
|
*
|
||||||
|
* @param collection
|
||||||
* @param field
|
* @param field
|
||||||
* the name of the metadata field to get
|
* the name of the metadata field to get
|
||||||
*
|
*
|
||||||
@@ -533,7 +534,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.addEvent(new Event(Event.ADD, Constants.COLLECTION, collection.getID(),
|
context.addEvent(new Event(Event.ADD, Constants.COLLECTION, collection.getID(),
|
||||||
Constants.ITEM, item.getID(), item.getHandle(),
|
Constants.ITEM, item.getID(), item.getHandle(),
|
||||||
getIdentifiers(context, collection)));
|
getIdentifiers(context, collection)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,13 +547,13 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
|||||||
item.removeCollection(collection);
|
item.removeCollection(collection);
|
||||||
|
|
||||||
//Check if we orphaned our poor item
|
//Check if we orphaned our poor item
|
||||||
if (item.getCollections().size() == 0)
|
if (item.getCollections().isEmpty())
|
||||||
{
|
{
|
||||||
// Orphan; delete it
|
// Orphan; delete it
|
||||||
itemService.delete(context, item);
|
itemService.delete(context, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.addEvent(new Event(Event.REMOVE, Constants.COLLECTION,
|
context.addEvent(new Event(Event.REMOVE, Constants.COLLECTION,
|
||||||
collection.getID(), Constants.ITEM, item.getID(), item.getHandle(),
|
collection.getID(), Constants.ITEM, item.getID(), item.getHandle(),
|
||||||
getIdentifiers(context, collection)));
|
getIdentifiers(context, collection)));
|
||||||
}
|
}
|
||||||
@@ -733,9 +734,9 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Collection> findAuthorized(Context context, Community community, int actionID) throws SQLException {
|
public List<Collection> findAuthorized(Context context, Community community, int actionID) throws SQLException {
|
||||||
List<Collection> myResults = new ArrayList<Collection>();
|
List<Collection> myResults = new ArrayList<>();
|
||||||
|
|
||||||
List<Collection> myCollections = null;
|
List<Collection> myCollections;
|
||||||
|
|
||||||
if (community != null)
|
if (community != null)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user