Skip to content

Commit e892ec3

Browse files
committed
Refactor:renamed path validity method & put placeholders in properties listeners
1 parent a358457 commit e892ec3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

jabgui/src/main/java/org/jabref/gui/mergebibfilesintocurrentbib/MergeBibFilesIntoCurrentBibAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private void mergeEntries(List<BibEntry> entries) {
156156
}
157157

158158
private List<Path> getAllBibFiles(Path directory, Path databasePath) {
159-
if (!checkPathValidity(directory)) {
159+
if (!isValidPath(directory)) {
160160
return List.of();
161161
}
162162
try (Stream<Path> stream = Files.find(
@@ -172,7 +172,7 @@ private List<Path> getAllBibFiles(Path directory, Path databasePath) {
172172
return List.of();
173173
}
174174

175-
private boolean checkPathValidity(Path directory) {
175+
private boolean isValidPath(Path directory) {
176176
if (!Files.exists(directory)) {
177177
dialogService.showErrorDialogAndWait(Localization.lang("Chosen folder does not exist:") + " " + directory);
178178
return false;

jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,8 +1323,8 @@ public MergeBibFilesIntoCurrentBibPreferences getMergeBibFilesIntoCurrentBibPref
13231323
getBoolean(MERGE_DUPLICATE_ENTRIES)
13241324
);
13251325

1326-
EasyBind.listen(mergeBibFilesIntoCurrentBibPreferences.shouldMergeSameKeyEntriesProperty(), (obs, oldValue, newValue) -> putBoolean(MERGE_SAME_KEY_ENTRIES, newValue));
1327-
EasyBind.listen(mergeBibFilesIntoCurrentBibPreferences.shouldMergeDuplicateEntriesProperty(), (obs, oldValue, newValue) -> putBoolean(MERGE_DUPLICATE_ENTRIES, newValue));
1326+
EasyBind.listen(mergeBibFilesIntoCurrentBibPreferences.shouldMergeSameKeyEntriesProperty(), (_, _, newValue) -> putBoolean(MERGE_SAME_KEY_ENTRIES, newValue));
1327+
EasyBind.listen(mergeBibFilesIntoCurrentBibPreferences.shouldMergeDuplicateEntriesProperty(), (_, _, newValue) -> putBoolean(MERGE_DUPLICATE_ENTRIES, newValue));
13281328

13291329
return mergeBibFilesIntoCurrentBibPreferences;
13301330
}

0 commit comments

Comments
 (0)