77582: Rename formatHandle to parseHandle & add @Override

This commit is contained in:
Yura Bondarenko
2021-03-26 16:20:11 +01:00
parent 315e29d2b1
commit a43e07f89a
5 changed files with 8 additions and 7 deletions

View File

@@ -386,7 +386,8 @@ public class HandleServiceImpl implements HandleService {
return handleDAO.countRows(context); return handleDAO.countRows(context);
} }
public String formatHandle(String identifier) { @Override
public String parseHandle(String identifier) {
if (identifier == null) { if (identifier == null) {
return null; return null;
} }

View File

@@ -191,5 +191,5 @@ public interface HandleService {
* @param identifier * @param identifier
* @return * @return
*/ */
String formatHandle(String identifier); String parseHandle(String identifier);
} }

View File

@@ -60,7 +60,7 @@ public class HandleIdentifierProvider extends IdentifierProvider {
@Override @Override
public boolean supports(String identifier) { public boolean supports(String identifier) {
return handleService.formatHandle(identifier) != null; return handleService.parseHandle(identifier) != null;
} }
@Override @Override
@@ -136,7 +136,7 @@ public class HandleIdentifierProvider extends IdentifierProvider {
public DSpaceObject resolve(Context context, String identifier, String... attributes) { public DSpaceObject resolve(Context context, String identifier, String... attributes) {
// We can do nothing with this, return null // We can do nothing with this, return null
try { try {
identifier = handleService.formatHandle(identifier); identifier = handleService.parseHandle(identifier);
return handleService.resolveToObject(context, identifier); return handleService.resolveToObject(context, identifier);
} catch (IllegalStateException | SQLException e) { } catch (IllegalStateException | SQLException e) {
log.error(LogManager.getHeader(context, "Error while resolving handle to item", "handle: " + identifier), log.error(LogManager.getHeader(context, "Error while resolving handle to item", "handle: " + identifier),

View File

@@ -78,7 +78,7 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
@Override @Override
public boolean supports(String identifier) { public boolean supports(String identifier) {
return handleService.formatHandle(identifier) != null; return handleService.parseHandle(identifier) != null;
} }
@Override @Override
@@ -284,7 +284,7 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
public DSpaceObject resolve(Context context, String identifier, String... attributes) { public DSpaceObject resolve(Context context, String identifier, String... attributes) {
// We can do nothing with this, return null // We can do nothing with this, return null
try { try {
identifier = handleService.formatHandle(identifier); identifier = handleService.parseHandle(identifier);
return handleService.resolveToObject(context, identifier); return handleService.resolveToObject(context, identifier);
} catch (IllegalStateException | SQLException e) { } catch (IllegalStateException | SQLException e) {
log.error(LogManager.getHeader(context, "Error while resolving handle to item", "handle: " + identifier), log.error(LogManager.getHeader(context, "Error while resolving handle to item", "handle: " + identifier),

View File

@@ -72,7 +72,7 @@ public class VersionedHandleIdentifierProviderWithCanonicalHandles extends Ident
@Override @Override
public boolean supports(String identifier) { public boolean supports(String identifier) {
return handleService.formatHandle(identifier) != null; return handleService.parseHandle(identifier) != null;
} }
@Override @Override