mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Refactor: Rename fields and methods, return early
This commit is contained in:
parent
802dcad2fb
commit
d27e4dc249
@ -29,28 +29,28 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Singleton
|
||||
public class CorruptedStorageFileHandler {
|
||||
private final List<String> corruptedDatabaseFiles = new ArrayList<>();
|
||||
private final List<String> files = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
public CorruptedStorageFileHandler() {
|
||||
}
|
||||
|
||||
public void onFileCorrupted(String fileName) {
|
||||
corruptedDatabaseFiles.add(fileName);
|
||||
public void addFile(String fileName) {
|
||||
files.add(fileName);
|
||||
}
|
||||
|
||||
public Optional<List<String>> getCorruptedDatabaseFiles() {
|
||||
if (!corruptedDatabaseFiles.isEmpty()) {
|
||||
if (corruptedDatabaseFiles.size() == 1 && corruptedDatabaseFiles.get(0).equals("ViewPathAsString")) {
|
||||
log.debug("We detected incompatible data base file for Navigation. " +
|
||||
"That is a minor issue happening with refactoring of UI classes " +
|
||||
"and we don't display a warning popup to the user.");
|
||||
return Optional.empty();
|
||||
} else {
|
||||
return Optional.of(corruptedDatabaseFiles);
|
||||
}
|
||||
} else {
|
||||
public Optional<List<String>> getFiles() {
|
||||
if (files.isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
if (files.size() == 1 && files.get(0).equals("ViewPathAsString")) {
|
||||
log.debug("We detected incompatible data base file for Navigation. " +
|
||||
"That is a minor issue happening with refactoring of UI classes " +
|
||||
"and we don't display a warning popup to the user.");
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(files);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user