I have 2 variables in if-statement and i am performing addition task on it. but first variable sumOfWeightedIndicator is working good and adding all value but the second variable sumOfIndicator is not getting call. therefore my retnull is also not getting call.

try {
    if (countriesMap.get(indicatorDetail.getiCountryId().getId()) != null) {
        System.out.println("if called");

        sumOfWeightedIndicator = sumOfWeightedIndicator + countriesMap.get(indicatorDetail.getiCountryId().getId());

        sumOfIndicator = sumOfIndicator + (Double.valueOf(indicatorDetail.getiIndicatorValue()) * countriesMap.get(indicatorDetail.getiCountryId().getId()));
        retnull = true;

    }
} catch (Exception e) {
    System.out.println("Exception : " + e);
}

0 Answers