mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-22 00:03:20 +00:00
[SERVEUR] NoRevertFileSaleDao : correction du bug empêchant de charger le fichier de logs de ventes
This commit is contained in:
parent
cdeb16f15d
commit
957bdcf5d3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user