From 6ddb59ec6f204b4ea3a54412f5d6486cabb4b774 Mon Sep 17 00:00:00 2001 From: Ian Allen Date: Fri, 29 Sep 2023 14:05:40 -0300 Subject: [PATCH] Avoid duplicate call to findOneByUuid --- services/src/main/java/org/fao/geonet/api/ApiUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/main/java/org/fao/geonet/api/ApiUtils.java b/services/src/main/java/org/fao/geonet/api/ApiUtils.java index de3a503774e..771b1b7a8a7 100644 --- a/services/src/main/java/org/fao/geonet/api/ApiUtils.java +++ b/services/src/main/java/org/fao/geonet/api/ApiUtils.java @@ -119,7 +119,7 @@ public static String getInternalId(String uuidOrInternalId, Boolean approved) AbstractMetadata metadata = metadataUtils.findOneByUuid(uuidOrInternalId); String id = null; if (metadata != null) { - id = String.valueOf(metadataUtils.findOneByUuid(uuidOrInternalId).getId()); + id = String.valueOf(metadata.getId()); } if (StringUtils.isEmpty(id)) {