Source:
protected AmazonBillResultsDTO processRootAccount(String masterAccountNumber, String masterAccountName, DefaultKfsAccountForAwsResultWrapper defaultAccountWrapper) { AmazonBillResultsDTO resultsDTO = new AmazonBillResultsDTO(); resultsDTO.masterAccountName = masterAccountName; resultsDTO.masterAccountNumber = masterAccountNumber; boolean masterAccountSuccess = true; CloudCheckrWrapper cloudCheckrWrapper = null; try { cloudCheckrWrapper = cloudCheckrService.getCloudCheckrWrapper(findStartDate(), findEndDate(), masterAccountName); } catch (URISyntaxException | IOException e) { LOG.error("processRootAccount, unable to call cloudcheckr endpoint. This exception may print the URL which has an access token in it, so not logging the exception on purpose."); masterAccountSuccess = false; } if (ObjectUtils.isNotNull(cloudCheckrWrapper) && ObjectUtils.isNotNull(defaultAccountWrapper)) { AccountingXmlDocumentListWrapper documentWrapper = buildAccountingXmlDocumentListWrapper(cloudCheckrWrapper, defaultAccountWrapper, masterAccountNumber, masterAccountName, resultsDTO); LOG.info("generateDistributionOfIncomeDocumentsFromAWSService, built documentWrapper: " + documentWrapper); masterAccountSuccess &= generateXML(documentWrapper, masterAccountName); } else { masterAccountSuccess = false; LOG.error("generateDistributionOfIncomeDocumentsFromAWSService, cloudCheckrWrapper or defaultAccountWrapper was not built, can not generate DIs"); } resultsDTO.successfullyProcessed = masterAccountSuccess; return resultsDTO; }

Target:
protected AmazonBillResultsDTO processRootAccount(String masterAccountNumber, String masterAccountName, DefaultKfsAccountForAwsResultWrapper defaultAccountWrapper) { AmazonBillResultsDTO resultsDTO = new AmazonBillResultsDTO(); resultsDTO.masterAccountName = masterAccountName; resultsDTO.masterAccountNumber = masterAccountNumber; boolean masterAccountSuccess = true; CloudCheckrWrapper cloudCheckrWrapper = null; try { cloudCheckrWrapper = cloudCheckrService.getCloudCheckrWrapper(findStartDate(), findEndDate(), masterAccountName); } catch (URISyntaxException | IOException e) { StringBuilder errorMessageBuilder = new StringBuilder("processRootAccount, unable to call cloudcheckr endpoint."); errorMessageBuilder.append("This exception may print the URL which has an access token in it, so not logging the exception on purpose."); errorMessageBuilder.append(" startDate: ").append(findStartDate()); errorMessageBuilder.append(" endDate: ").append(findEndDate()); errorMessageBuilder.append(" masterAccountName: ").append(masterAccountName); LOG.error(errorMessageBuilder); masterAccountSuccess = false; } if (ObjectUtils.isNotNull(cloudCheckrWrapper) && ObjectUtils.isNotNull(defaultAccountWrapper)) { AccountingXmlDocumentListWrapper documentWrapper = buildAccountingXmlDocumentListWrapper(cloudCheckrWrapper, defaultAccountWrapper, masterAccountNumber, masterAccountName, resultsDTO); LOG.info("processRootAccount, built documentWrapper: " + documentWrapper); masterAccountSuccess &= generateXML(documentWrapper, masterAccountName); } else { masterAccountSuccess = false; LOG.error("processRootAccount, cloudCheckrWrapper or defaultAccountWrapper was not built, can not generate DIs"); } resultsDTO.successfullyProcessed = masterAccountSuccess; return resultsDTO; }