Author: chatellier Date: 2008-11-20 16:11:53 +0000 (Thu, 20 Nov 2008) New Revision: 1610 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java Log: Can't be null here Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2008-11-20 14:26:29 UTC (rev 1609) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2008-11-20 16:11:53 UTC (rev 1610) @@ -279,12 +279,18 @@ /** * Get parameter property. * - *@return Parameter property. + * @return Parameter property. */ public SimulationParameter getParameter() { if(parameter == null){ Properties prop = new Properties(); File file = getSimulationParametersFile(); + + // log + if(log.isDebugEnabled()) { + log.debug("Loading properties from : " + file.getAbsolutePath()); + } + try { FileInputStream in = new FileInputStream(file); prop.load(in); @@ -603,16 +609,16 @@ log.info(_("Last entry was %s extract name %s", lastEntry, name)); File simDir = new File(directory, name); SimulationStorage result = new SimulationStorage(simDir, name, null); - if (result != null) { - File data = result.getDataBackupFile(); - // FIXME was file.exists() ? - if (data.exists()) { - TopiaContext tx = result.getStorage().beginTransaction(); - tx.restore(data); - tx.commitTransaction(); - tx.closeContext(); - } + + File data = result.getDataBackupFile(); + // FIXME was file.exists() ? + if (data.exists()) { + TopiaContext tx = result.getStorage().beginTransaction(); + tx.restore(data); + tx.commitTransaction(); + tx.closeContext(); } + return result; }