[DURACOM-318] improve code

(cherry picked from commit 8e0ca2e6f88b0251edf8a840f65135590c65f088)
(cherry picked from commit 4270170d40)
This commit is contained in:
Mykhaylo Boychuk
2025-02-03 19:30:16 +01:00
committed by max.nuding
parent a24340a197
commit 2104d605bd
2 changed files with 3 additions and 1 deletions

View File

@@ -549,4 +549,5 @@ public final class Utils {
return false;
}
}
}

View File

@@ -11,6 +11,7 @@ import java.io.Serializable;
import java.sql.SQLException;
import java.util.UUID;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.StringUtils;
import org.dspace.app.rest.model.ResourcePolicyRest;
import org.dspace.app.rest.utils.ContextUtil;
@@ -69,7 +70,7 @@ public class ResourcePolicyAdminPermissionEvalutatorPlugin extends RestObjectPer
try {
DSpaceObject dso = null;
if (Utils.isConvertibleToInt(targetId.toString())) {
if (NumberUtils.isNumber(targetId.toString())) {
var id = Integer.parseInt(targetId.toString());
dso = getDSO(context, id);
} else {