From 7b3d1b30081f433fb674033c3974bed7d6729a01 Mon Sep 17 00:00:00 2001 From: khuddus shariff Date: Wed, 20 Dec 2023 10:54:29 +0530 Subject: [PATCH 1/3] if condition fix to not to breake the loop if responce contains error Signed-off-by: khuddus shariff --- .../uingenerator/stage/UinGeneratorStage.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java index a14470e0a58..a486409733d 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java @@ -291,10 +291,9 @@ public MessageDTO process(MessageDTO object) { registrationStatusDto.getRegistrationType(), demographicIdentity, uinField, description); if (idResponseDTO.getErrors() == null || idResponseDTO.getErrors().isEmpty() - || idResponseDTO.getErrors().get(0) - .getErrorCode() != INVALID_INPUT_PARAMETER_ERROR_CODE) + || !idResponseDTO.getErrors().get(0) + .getErrorCode().equalsIgnoreCase(INVALID_INPUT_PARAMETER_ERROR_CODE)) break; - } } boolean isUinAlreadyPresent = isUinAlreadyPresent(idResponseDTO, registrationId); @@ -476,8 +475,11 @@ else if (json instanceof JSONArray) { JSONArray jsonArray = new JSONArray(value); for (int i = 0; i < jsonArray.length(); i++) { Object obj = jsonArray.get(i); - HashMap hashMap = new ObjectMapper().readValue(obj.toString(), HashMap.class); - jsonList.add(hashMap); + + if(((org.json.JSONObject) obj).get("language") instanceof String && ((org.json.JSONObject) obj).get("value") instanceof String) { + HashMap hashMap = new ObjectMapper().readValue(obj.toString().trim(), HashMap.class); + jsonList.add(hashMap); + } } demographicIdentity.putIfAbsent(e.getKey(), jsonList); } else @@ -488,6 +490,7 @@ else if (json instanceof JSONArray) { } } + /** * Send id repo with uin. * From 16b8e7d205f6784ed9c28f6bd3a79f371de076ec Mon Sep 17 00:00:00 2001 From: khuddus shariff Date: Wed, 20 Dec 2023 10:57:22 +0530 Subject: [PATCH 2/3] if condition fix to not to breake the loop if responce contains error Signed-off-by: khuddus shariff --- .../stages/uingenerator/stage/UinGeneratorStage.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java index a486409733d..7e0000118a3 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java @@ -475,11 +475,8 @@ else if (json instanceof JSONArray) { JSONArray jsonArray = new JSONArray(value); for (int i = 0; i < jsonArray.length(); i++) { Object obj = jsonArray.get(i); - - if(((org.json.JSONObject) obj).get("language") instanceof String && ((org.json.JSONObject) obj).get("value") instanceof String) { - HashMap hashMap = new ObjectMapper().readValue(obj.toString().trim(), HashMap.class); - jsonList.add(hashMap); - } + HashMap hashMap = new ObjectMapper().readValue(obj.toString().trim(), HashMap.class); + jsonList.add(hashMap); } demographicIdentity.putIfAbsent(e.getKey(), jsonList); } else From 0896372d0276a5a9d1a541870ecddadbd9fbbcdd Mon Sep 17 00:00:00 2001 From: khuddus shariff Date: Wed, 20 Dec 2023 10:57:58 +0530 Subject: [PATCH 3/3] if condition fix to not to breake the loop if responce contains error Signed-off-by: khuddus shariff --- .../processor/stages/uingenerator/stage/UinGeneratorStage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java index 7e0000118a3..a80704e0170 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java @@ -475,7 +475,7 @@ else if (json instanceof JSONArray) { JSONArray jsonArray = new JSONArray(value); for (int i = 0; i < jsonArray.length(); i++) { Object obj = jsonArray.get(i); - HashMap hashMap = new ObjectMapper().readValue(obj.toString().trim(), HashMap.class); + HashMap hashMap = new ObjectMapper().readValue(obj.toString(), HashMap.class); jsonList.add(hashMap); } demographicIdentity.putIfAbsent(e.getKey(), jsonList);