Author: dcosse Date: 2014-09-29 14:31:46 +0200 (Mon, 29 Sep 2014) New Revision: 3926 Url: http://forge.chorem.org/projects/lima/repository/revisions/3926 Log: refs #1032 on ne modifie pas une variable parametre Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-09-29 08:27:32 UTC (rev 3925) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-09-29 12:31:46 UTC (rev 3926) @@ -354,13 +354,16 @@ return targetedFinancialStatement; } - protected FinancialStatement returnRootFinancialStatement(FinancialStatement financialStatement) { + protected FinancialStatement returnRootFinancialStatement(final FinancialStatement financialStatement) { FinancialStatement rootFinancialStatement = null; - while (rootFinancialStatement == null) { - if (financialStatement.getMasterFinancialStatement() == null){ - rootFinancialStatement = financialStatement; - } else { - financialStatement = financialStatement.getMasterFinancialStatement(); + FinancialStatement interFinancialStatement = financialStatement; + if (interFinancialStatement != null) { + while (rootFinancialStatement == null) { + if (interFinancialStatement.getMasterFinancialStatement() == null){ + rootFinancialStatement = interFinancialStatement; + } else { + interFinancialStatement = interFinancialStatement.getMasterFinancialStatement(); + } } } return rootFinancialStatement;