From e18c161f9680ca8b1311e769c4f276415e9e3488 Mon Sep 17 00:00:00 2001 From: Sowmya Ujjappa Banakar Date: Tue, 4 Jun 2024 11:17:06 +0530 Subject: [PATCH] MOSIP-32461 code changes Signed-off-by: Sowmya Ujjappa Banakar --- .../validator/impl/BiometricsSignatureValidator.java | 5 ++++- .../quality/classifier/stage/QualityClassifierStage.java | 8 ++++++-- .../status/service/impl/AnonymousProfileServiceImpl.java | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/validator/impl/BiometricsSignatureValidator.java b/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/validator/impl/BiometricsSignatureValidator.java index 3b002f82fa4..c48d8c0e3f6 100644 --- a/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/validator/impl/BiometricsSignatureValidator.java +++ b/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/validator/impl/BiometricsSignatureValidator.java @@ -74,7 +74,10 @@ public void validateSignature(String id, String process, BiometricRecord biometr List birs = biometricRecord.getSegments(); for (BIR bir : birs) { - HashMap othersInfo = (HashMap) bir.getOthers(); + Map othersInfo = null; + if(bir.getOthers() instanceof HashMap) { + othersInfo = (Map) bir.getOthers(); + } if (othersInfo == null) { throw new BiometricSignatureValidationException("Others value is null inside BIR"); } diff --git a/registration-processor/pre-processor/registration-processor-quality-classifier-stage/src/main/java/io/mosip/registration/processor/quality/classifier/stage/QualityClassifierStage.java b/registration-processor/pre-processor/registration-processor-quality-classifier-stage/src/main/java/io/mosip/registration/processor/quality/classifier/stage/QualityClassifierStage.java index 097b6c8350c..f1fda098bda 100644 --- a/registration-processor/pre-processor/registration-processor-quality-classifier-stage/src/main/java/io/mosip/registration/processor/quality/classifier/stage/QualityClassifierStage.java +++ b/registration-processor/pre-processor/registration-processor-quality-classifier-stage/src/main/java/io/mosip/registration/processor/quality/classifier/stage/QualityClassifierStage.java @@ -423,8 +423,12 @@ private Map getQualityTags(List birs) throws BiometricExcep for (BIR bir : birs) { if (bir.getOthers() != null) { - HashMap othersInfo = (HashMap) bir.getOthers(); + Map othersInfo = null; + if (bir.getOthers() instanceof HashMap) { + othersInfo = (Map) bir.getOthers(); + } boolean exceptionValue = false; + if(othersInfo!=null) { for (Map.Entry other : othersInfo.entrySet()) { if (other.getKey().equals(EXCEPTION)) { if (other.getValue().equals(TRUE)) { @@ -433,7 +437,7 @@ private Map getQualityTags(List birs) throws BiometricExcep break; } } - + } if (exceptionValue) { continue; } diff --git a/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/AnonymousProfileServiceImpl.java b/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/AnonymousProfileServiceImpl.java index 7c28f5dda87..10817ce65f9 100644 --- a/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/AnonymousProfileServiceImpl.java +++ b/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/AnonymousProfileServiceImpl.java @@ -277,7 +277,10 @@ private void getExceptionAndBiometricInfo(BiometricRecord biometricRecord, Anony List birs = biometricRecord.getSegments(); for (BIR bir : birs) { - HashMap othersInfo = (HashMap) bir.getOthers(); + Map othersInfo = null; + if (bir.getOthers() instanceof HashMap) { + othersInfo = (Map) bir.getOthers(); + } if (othersInfo == null) { continue;