[SERVEUR] NoRevertFileSaleDao : correction du bug empêchant de charger le fichier de logs de ventes

This commit is contained in:
Notmoo-PC\Notmoo 2018-01-25 00:16:35 +01:00
parent cdeb16f15d
commit 957bdcf5d3

View File

@ -99,7 +99,7 @@ public class NoRevertFileSaleDao implements ISaleDao {
private long readLastSaleIdFromFile(){
long id = DEFAULT_SALE_ID;
if(FileUtil.exist(getLogFilePath())){
try(ReversedLinesFileReader rlfr = new ReversedLinesFileReader(new File("SALE_LOG_FILE_NAME"))){
try(ReversedLinesFileReader rlfr = new ReversedLinesFileReader(new File(getLogFilePath()))){
boolean stop = false;
do{
try {
@ -108,7 +108,7 @@ public class NoRevertFileSaleDao implements ISaleDao {
id = Long.parseLong(line.substring(1));
stop = true;
}
}catch (EOFException e){
}catch (NullPointerException | EOFException e){
stop = true;
}
}while(!stop);