private void isReturnWindowBreached(OrderLine orderLine,OrderHeader orderHeader,JSONObject jsonObject) {
		Set<OrderLineDate> orderLineDates = orderLine.getOrderLineDates();
		Optional<OrderLineDate> dispatchDate = orderLineDates.stream()
				.filter(olDate -> "MS_COMPLETELY_SHIPPED_OR_CANCELLED".equalsIgnoreCase(olDate.getDateTypeId()))
				.findFirst();
		logger.info("Dispatched date for orderLineKey: {} is {}", orderLine.getOrderLineKey(), dispatchDate);
		String transitDays = eligibilityCriteriaConfig.getConfigValueFromKey(orderLine.getLevelOfService());
		logger.debug("ETD for orderLineKey: {} is {}", orderLine.getOrderLineKey(), transitDays);
		if (dispatchDate.isPresent() && orderLine.getReturnWindow() != null) {

			BigDecimal returnWindow = getReturnWindowForSalesAndNonSales(orderLine);
			logger.debug("Return window for orderLineKey: {} is {}", orderLine.getOrderLineKey(), returnWindow);
			LocalDate tentativeDeliveryDate = dispatchDate.get().getActualDate().plusDays(Long.parseLong(transitDays));
			logger.debug("Tentative delivery date for orderLineKey: {} is {}", orderLine.getOrderLineKey(), tentativeDeliveryDate);
			LocalDate lastReturnDate = tentativeDeliveryDate.plusDays(returnWindow.intValue());
			logger.debug("Last return date for orderLineKey: {} is {}", orderLine.getOrderLineKey(), lastReturnDate);
			LocalDate currentDate = LocalDate.now();
			long numberOfDaysPending = ChronoUnit.DAYS.between(currentDate, lastReturnDate);

			logger.debug("Fetching carrierData for orderRef : {}, for return Order No : {}, for country code : {}, for status code : {}",
					orderHeader.getOrderNo(), jsonObject.getString("value"), DNCApiConstants.SF, DNCApiConstants.STS002);

			CarrierData carrierData = null;
			Query query = Query.query(Criteria.where("carrierCode").is(DNCApiConstants.SF)
					.andOperator(Arrays.asList(
							Criteria.where("orderRef").is(orderHeader.getOrderNo()),
							Criteria.where("statusDetails.statusCode").is(DNCApiConstants.STS002)
					)));

			if (DNCApiConstants.TYPE_FILTER_VAL_KEY_LIST.contains(jsonObject.getString("type"))) {
				query.addCriteria(Criteria.where("returnOrderNumber").is(jsonObject.getString("value")));
			}

			carrierData = mongoTemplate.findOne(query, CarrierData.class);
			logger.info("Carrier Data received from DB —> {}", carrierData);

			if (null != carrierData) {
				String handOverDate = carrierData.getStatusDetails().getDate();
				if (null != handOverDate) {
					numberOfDaysPending = Math.max(numberOfDaysPending, ChronoUnit.DAYS.between(
							LocalDate.from(DateTimeFormatter.ofPattern("yyyy-MM-dd").parse(handOverDate)), lastReturnDate));
				}
			}
			logger.debug("Number of days pending to return before checking max return period for orderLineKey: {} is {}", orderLine.getOrderLineKey(), numberOfDaysPending);
			numberOfDaysPending = getNumberOfDaysLeftForeReturn(numberOfDaysPending, orderLine);
			logger.debug("Number of days pending for return after checking max return period for orderLineKey: {} is {}", orderLine.getOrderLineKey(), numberOfDaysPending);
			orderLine.setIsReturnWindowBreached(numberOfDaysPending >= 0 ? "N" : "Y");
		}
	}
in this  function....fix for ....Vulnerable API usage 
CVE-2022-45689 7.5 Out-of-bounds Write vulnerability
CVE-2022-45690 7.5 Out-of-bounds Write vulnerability
Results powered by Checkmarx(c)