Skip to content

Commit

Permalink
Revert lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Jan 8, 2024
1 parent 751c4b4 commit af10895
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/main/java/org/jabref/model/database/BibDatabaseContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,16 @@ public Path getFulltextIndexPath() {
Path appData = OS.getNativeDesktop().getFulltextIndexBaseDirectory();
Path indexPath;

indexPath = getDatabasePath().map(databasePath -> {
Path databaseFileName = databasePath.getFileName();
if (getDatabasePath().isPresent()) {
Path databaseFileName = getDatabasePath().get().getFileName();
String fileName = BackupFileUtil.getUniqueFilePrefix(databaseFileName) + "--" + databaseFileName;
Path result = appData.resolve(fileName);
LOGGER.debug("Index path for {} is {}", getDatabasePath().get(), result);
return result;
}).orElseGet(() -> {
Path result = appData.resolve("unsaved");
LOGGER.debug("Using index for unsaved database: {}", result);
return result;
});
indexPath = appData.resolve(fileName);
LOGGER.debug("Index path for {} is {}", getDatabasePath().get(), indexPath);
return indexPath;
}

indexPath = appData.resolve("unsaved");
LOGGER.debug("Using index for unsaved database: {}", indexPath);
return indexPath;
}

Expand Down

0 comments on commit af10895

Please sign in to comment.