Source:
private AccountingXmlDocumentAccountingLine fixAccountFieldReferences(AccountingXmlDocumentAccountingLine xmlAccountingLine, String defaultAccountString) { if (!validateChartCode(xmlAccountingLine.getChartCode())) { String defaultCharCode = getDefaultChartCodeFromParameter(); xmlAccountingLine.setChartCode(defaultCharCode); } if (StringUtils.equalsIgnoreCase(CuFPConstants.AmazonWebServiceBillingConstants.ACCOUNT_NONE, xmlAccountingLine.getAccountNumber())) { return getDefaultAccountingLine(defaultAccountString); } if (!StringUtils.equalsIgnoreCase(defaultAccountString, CuFPConstants.AmazonWebServiceBillingConstants.INTERNAL_KFS_ACCOUNT_DESCRIPTION) && !validateAccount(xmlAccountingLine.getChartCode(), xmlAccountingLine.getAccountNumber())) { return getDefaultAccountingLine(defaultAccountString); } if (!validateObjectCode(xmlAccountingLine.getChartCode(), xmlAccountingLine.getObjectCode())) { String defaultObjectCode = getDefaultObjectCodeFromParameter(); xmlAccountingLine.setObjectCode(defaultObjectCode); } if (!validateSubAccountNumber(xmlAccountingLine.getChartCode(), xmlAccountingLine.getAccountNumber(), xmlAccountingLine.getSubAccountNumber())) { xmlAccountingLine.setSubAccountNumber(StringUtils.EMPTY); } if (!validateSubObjectCode(xmlAccountingLine.getChartCode(), xmlAccountingLine.getAccountNumber(), xmlAccountingLine.getObjectCode(), xmlAccountingLine.getSubObjectCode())) { xmlAccountingLine.setSubObjectCode(StringUtils.EMPTY); } if (!validateProjectCode(xmlAccountingLine.getProjectCode())) { xmlAccountingLine.setProjectCode(StringUtils.EMPTY); } if (!validateOrgRefId(xmlAccountingLine.getOrgRefId())) { xmlAccountingLine.setOrgRefId(StringUtils.EMPTY); } return xmlAccountingLine; }

Target:
private AccountingXmlDocumentAccountingLine fixAccountFieldReferences(AccountingXmlDocumentAccountingLine xmlAccountingLine, String defaultAccountString) { if (!validateChartCode(xmlAccountingLine.getChartCode())) { String defaultChartCode = getDefaultChartCodeFromParameter(); xmlAccountingLine.setChartCode(defaultChartCode); } if (StringUtils.equalsIgnoreCase(CuFPConstants.AmazonWebServiceBillingConstants.ACCOUNT_NONE, xmlAccountingLine.getAccountNumber())) { xmlAccountingLine = getDefaultAccountingLine(defaultAccountString); } if (!StringUtils.equalsIgnoreCase(defaultAccountString, CuFPConstants.AmazonWebServiceBillingConstants.INTERNAL_KFS_ACCOUNT_DESCRIPTION) && !validateAccount(xmlAccountingLine.getChartCode(), xmlAccountingLine.getAccountNumber())) { xmlAccountingLine = getDefaultAccountingLine(defaultAccountString); } if (!validateObjectCode(xmlAccountingLine.getChartCode(), xmlAccountingLine.getObjectCode())) { String defaultObjectCode = getDefaultObjectCodeFromParameter(); xmlAccountingLine.setObjectCode(defaultObjectCode); } if (!validateSubAccountNumber(xmlAccountingLine.getChartCode(), xmlAccountingLine.getAccountNumber(), xmlAccountingLine.getSubAccountNumber())) { xmlAccountingLine.setSubAccountNumber(StringUtils.EMPTY); } if (!validateSubObjectCode(xmlAccountingLine.getChartCode(), xmlAccountingLine.getAccountNumber(), xmlAccountingLine.getObjectCode(), xmlAccountingLine.getSubObjectCode())) { xmlAccountingLine.setSubObjectCode(StringUtils.EMPTY); } if (!validateProjectCode(xmlAccountingLine.getProjectCode())) { xmlAccountingLine.setProjectCode(StringUtils.EMPTY); } if (!validateOrgRefId(xmlAccountingLine.getOrgRefId())) { xmlAccountingLine.setOrgRefId(StringUtils.EMPTY); } return xmlAccountingLine; }