[DS-4522] Refactor skipFilter Boolean -> boolean (primitive) as per review

This commit is contained in:
Kim Shepherd
2021-07-12 13:05:19 +12:00
parent 713469cd80
commit 2e6552c0c9
3 changed files with 20 additions and 20 deletions

View File

@@ -229,7 +229,7 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
* @throws IdentifierException
*/
@Override
public String register(Context context, DSpaceObject dso, Boolean skipFilter)
public String register(Context context, DSpaceObject dso, boolean skipFilter)
throws IdentifierException {
if (!(dso instanceof Item)) {
// DOI are currently assigned only to Item
@@ -253,7 +253,7 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
* @throws IdentifierException
*/
@Override
public void register(Context context, DSpaceObject dso, String identifier, Boolean skipFilter)
public void register(Context context, DSpaceObject dso, String identifier, boolean skipFilter)
throws IdentifierException {
if (!(dso instanceof Item)) {
// DOI are currently assigned only to Item
@@ -322,7 +322,7 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
* @throws SQLException
*/
@Override
public void reserve(Context context, DSpaceObject dso, String identifier, Boolean skipFilter)
public void reserve(Context context, DSpaceObject dso, String identifier, boolean skipFilter)
throws IdentifierException, IllegalArgumentException {
String doi = doiService.formatIdentifier(identifier);
DOI doiRow = null;
@@ -371,7 +371,7 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
* @throws IllegalArgumentException
* @throws SQLException
*/
public void reserveOnline(Context context, DSpaceObject dso, String identifier, Boolean skipFilter)
public void reserveOnline(Context context, DSpaceObject dso, String identifier, boolean skipFilter)
throws IdentifierException, IllegalArgumentException, SQLException {
String doi = doiService.formatIdentifier(identifier);
// get TableRow and ensure DOI belongs to dso regarding our db
@@ -414,9 +414,9 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
* @throws IllegalArgumentException
* @throws SQLException
*/
public void registerOnline(Context context, DSpaceObject dso, String identifier, Boolean skipFilter)
public void registerOnline(Context context, DSpaceObject dso, String identifier, boolean skipFilter)
throws IdentifierException, IllegalArgumentException, SQLException {
log.debug("registerOnline: skipFilter is " + skipFilter.toString());
log.debug("registerOnline: skipFilter is " + skipFilter);
String doi = doiService.formatIdentifier(identifier);
// get TableRow and ensure DOI belongs to dso regarding our db
@@ -470,7 +470,7 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
String doi = doiService.formatIdentifier(identifier);
Boolean skipFilter = false;
boolean skipFilter = false;
if (doiService.findDOIByDSpaceObject(context, dso) != null) {
// We can skip the filter here since we know the DOI already exists for the item
@@ -576,12 +576,12 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
* Mint a new DOI in DSpace - this is usually the first step of registration
* @param context - DSpace context
* @param dso - DSpaceObject identified by the new identifier
* @param skipFilter - boolean indicating whether to skip any filtering of items before minting
* @param skipFilter - boolean indicating whether to skip any filtering of items before minting.
* @return a String containing the new identifier
* @throws IdentifierException
*/
@Override
public String mint(Context context, DSpaceObject dso, Boolean skipFilter) throws IdentifierException {
public String mint(Context context, DSpaceObject dso, boolean skipFilter) throws IdentifierException {
String doi = null;
try {
@@ -910,7 +910,7 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
* @throws SQLException
* @throws DOIIdentifierException
*/
protected DOI loadOrCreateDOI(Context context, DSpaceObject dso, String doiIdentifier, Boolean skipFilter)
protected DOI loadOrCreateDOI(Context context, DSpaceObject dso, String doiIdentifier, boolean skipFilter)
throws SQLException, DOIIdentifierException, IdentifierNotApplicableException {
DOI doi = null;
@@ -1105,8 +1105,8 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider {
if (this.filterService != null && contentServiceFactory
.getDSpaceObjectService(dso).getTypeText(dso).equals("ITEM")) {
try {
Boolean result = filterService.getResult(context, (Item) dso);
log.debug("Result of filter for " + dso.getHandle() + " is " + result.toString());
boolean result = filterService.getResult(context, (Item) dso);
log.debug("Result of filter for " + dso.getHandle() + " is " + result);
if (!result) {
throw new DOIIdentifierNotApplicableException("Item " + dso.getHandle() +
" was evaluated as 'false' by the item filter, not minting");

View File

@@ -43,7 +43,7 @@ public abstract class FilteredIdentifierProvider extends IdentifierProvider {
* @return identifier
* @throws IdentifierException
*/
public abstract String register(Context context, DSpaceObject dso, Boolean skipFilter)
public abstract String register(Context context, DSpaceObject dso, boolean skipFilter)
throws IdentifierException;
/**
@@ -54,7 +54,7 @@ public abstract class FilteredIdentifierProvider extends IdentifierProvider {
* @param skipFilter - boolean indicating whether to skip any filtering of items before performing registration
* @throws IdentifierException
*/
public abstract void register(Context context, DSpaceObject dso, String identifier, Boolean skipFilter)
public abstract void register(Context context, DSpaceObject dso, String identifier, boolean skipFilter)
throws IdentifierException;
/**
@@ -67,18 +67,18 @@ public abstract class FilteredIdentifierProvider extends IdentifierProvider {
* @throws IllegalArgumentException
* @throws SQLException
*/
public abstract void reserve(Context context, DSpaceObject dso, String identifier, Boolean skipFilter)
public abstract void reserve(Context context, DSpaceObject dso, String identifier, boolean skipFilter)
throws IdentifierException, IllegalArgumentException, SQLException;
/**
* Mint a new identifier in DSpace - this is usually the first step of registration
* @param context - DSpace context
* @param dso - DSpaceObject identified by the new identifier
* @param skipFilter - boolean indicating whether to skip any filtering of items before minting
* @param skipFilter - boolean indicating whether to skip any filtering of items before minting.
* @return a String containing the new identifier
* @throws IdentifierException
*/
public abstract String mint(Context context, DSpaceObject dso, Boolean skipFilter) throws IdentifierException;
public abstract String mint(Context context, DSpaceObject dso, boolean skipFilter) throws IdentifierException;
/**
* Check configured item filters to see if this identifier is allowed to be minted

View File

@@ -61,7 +61,7 @@ public class DOIOrganiser {
protected ItemService itemService;
protected DOIService doiService;
protected ConfigurationService configurationService;
protected Boolean skipFilter;
protected boolean skipFilter;
/**
* Constructor to be called within the main() method
@@ -398,7 +398,7 @@ public class DOIOrganiser {
* @throws SQLException
* @throws DOIIdentifierException
*/
public void register(DOI doiRow, Boolean skipFilter) throws SQLException, DOIIdentifierException {
public void register(DOI doiRow, boolean skipFilter) throws SQLException, DOIIdentifierException {
DSpaceObject dso = doiRow.getDSpaceObject();
if (Constants.ITEM != dso.getType()) {
throw new IllegalArgumentException("Currenty DSpace supports DOIs for Items only.");
@@ -497,7 +497,7 @@ public class DOIOrganiser {
* @throws SQLException
* @throws DOIIdentifierException
*/
public void reserve(DOI doiRow, Boolean skipFilter) {
public void reserve(DOI doiRow, boolean skipFilter) {
DSpaceObject dso = doiRow.getDSpaceObject();
if (Constants.ITEM != dso.getType()) {
throw new IllegalArgumentException("Currently DSpace supports DOIs for Items only.");