From d61e4ee7e779c7986f0de92f99171547c2365341 Mon Sep 17 00:00:00 2001 From: himeshr Date: Fri, 15 Dec 2023 11:01:19 +0530 Subject: [PATCH] #109 | Use Double.valueOf for conversion --- .../goonj/repository/ActivityRepository.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/goonj/src/main/java/org/avni_integration_service/goonj/repository/ActivityRepository.java b/goonj/src/main/java/org/avni_integration_service/goonj/repository/ActivityRepository.java index 730f6e1e..b4c64714 100644 --- a/goonj/src/main/java/org/avni_integration_service/goonj/repository/ActivityRepository.java +++ b/goonj/src/main/java/org/avni_integration_service/goonj/repository/ActivityRepository.java @@ -122,10 +122,10 @@ private ActivityDTO createActivityRequest(Subject subject) { /* Measurement fields */ activityDTO.setMeasurementType((String) subject.getObservation(MEASUREMENTS_TYPE)); activityDTO.setNos((Integer) subject.getObservation(NOS)); - activityDTO.setBreadth((subject.getObservation(BREADTH) == null) ? 0D : (Double) subject.getObservation(BREADTH)); - activityDTO.setDiameter((subject.getObservation(DIAMETER) == null) ? 0D : (Double) subject.getObservation(DIAMETER)); - activityDTO.setLength((subject.getObservation(LENGTH) == null) ? 0D : (Double) subject.getObservation(LENGTH)); - activityDTO.setDepthHeight((subject.getObservation(HEIGHT_DEPTH) == null) ? 0D : (Double) subject.getObservation(HEIGHT_DEPTH)); + activityDTO.setBreadth((subject.getObservation(BREADTH) == null) ? 0D : Double.valueOf(subject.getObservation(BREADTH).toString())); + activityDTO.setDiameter((subject.getObservation(DIAMETER) == null) ? 0D : Double.valueOf(subject.getObservation(DIAMETER).toString())); + activityDTO.setLength((subject.getObservation(LENGTH) == null) ? 0D : Double.valueOf(subject.getObservation(LENGTH).toString())); + activityDTO.setDepthHeight((subject.getObservation(HEIGHT_DEPTH) == null) ? 0D : Double.valueOf(subject.getObservation(HEIGHT_DEPTH).toString())); /* Photograph fields */ activityDTO.setBeforeImplementationPhotograph(getPhotographStrings(BEFORE_IMPLEMENTATION_PHOTOGRAPH, subject)); activityDTO.setDuringImplementationPhotograph(getPhotographStrings(DURING_IMPLEMENTATION_PHOTOGRAPH, subject));