Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cursor jumping #11282

Merged
merged 86 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
dcb6e31
Modernize tests in BibEntryWriterTest
koppor May 6, 2024
d75c1a5
Add tests for current behavior
koppor May 6, 2024
197e723
Improve comments and code
koppor May 6, 2024
0331c2e
Re-order tests
koppor May 6, 2024
42faa91
Extract method
koppor May 6, 2024
6594317
Fix handling of ##
koppor May 6, 2024
05d9cbf
Fix detection of multiline fields
koppor May 6, 2024
60efa87
Fix space removal
koppor May 6, 2024
1b62eb3
Fix trimming of content
koppor May 6, 2024
548bec4
Codestyle: Tests
koppor May 7, 2024
e32f712
Remove standard cleanups
koppor May 7, 2024
8b7dc30
Add CHANGELOG.md entry
koppor May 7, 2024
06805f7
Right trim multiline fields
koppor May 7, 2024
5f2dde2
Add links to CHANGELOG.md
koppor May 7, 2024
ab6e5fd
Merge remote-tracking branch 'upstream/main' into fix-5904
koppor May 14, 2024
e901b32
Test case cleanup
koppor May 14, 2024
2f2d256
Fix whitespace formatting
koppor May 14, 2024
febbcc8
Reformat comment (and add TODO marker)
koppor May 14, 2024
09f7c80
More whitespace tweaking
koppor May 14, 2024
1a1a8e6
Merge branch 'main' into fix-5904
koppor Jun 4, 2024
2a6da5e
Use our builder if possible
koppor Jun 4, 2024
49adca5
Fix whitespace at import
koppor Jun 4, 2024
f03a172
Merge remote-tracking branch 'origin/main' into fix-5904
koppor Jun 4, 2024
94afc94
Try to get gradle executing all tests on GitHub CI
koppor Jun 4, 2024
18b41ea
Tweak parallel tests
koppor Jun 4, 2024
185698a
Optimize build
koppor Jun 4, 2024
c1524a3
Trim whole field content
koppor Jun 4, 2024
49540f0
Fix variable name
koppor Jun 4, 2024
c0fd92b
Use `toList()`
koppor Jun 7, 2024
70605e7
More modern BibEntry generating
koppor Jun 7, 2024
aa00de3
Better linebreaks
koppor Jun 7, 2024
83263dc
Fix logic
koppor Jun 7, 2024
324aac9
Fix an (unlreated) test
koppor Jun 7, 2024
acc1264
Update CHANGELOG.md
koppor Jun 7, 2024
a0bddde
Update build.gradle
koppor Jun 7, 2024
5d6a8e6
Use TrimWhitespaceFormatter() instead of internal "trim()"
koppor Jun 7, 2024
c04d943
Merge branch 'main' into fix-5904
koppor Jun 13, 2024
6150506
Fix typo
koppor Jun 13, 2024
da76176
Simplify code
koppor Jun 13, 2024
9122a01
Try to make code more readable
koppor Jun 13, 2024
7eb600d
Add diffing for correct caret repositioning
koppor Jun 13, 2024
0f69e32
Fix CHANGELOG
koppor Jun 13, 2024
f5298a4
Improve code
koppor Jun 13, 2024
e611cbf
Refine text
koppor Jun 13, 2024
37f89b6
Fix binding issue
koppor Jun 13, 2024
7525cdf
Fix BackupManager to modify the UI
koppor Jun 14, 2024
4e30bd2
Works for simple case
koppor Jun 14, 2024
bc707a0
FieldFormatter not used at reading any more
koppor Jun 14, 2024
ae2aabb
Convert FieldContentFormatter to NormalizeWhitespaceFormatter
koppor Jun 14, 2024
1e1b678
Make use of new change-aware bindings in other text-based editors, too
koppor Jun 14, 2024
793982c
Fix tinylog
koppor Jun 14, 2024
40e3af2
Fix when end is trimmed
koppor Jun 14, 2024
12842f8
Merge remote-tracking branch 'origin/main' into fix-5904
koppor Jun 14, 2024
b5498e1
Fix CHANGELOG.md
koppor Jun 14, 2024
e313c06
Adapt tests to new behavior
koppor Jun 14, 2024
e7cb925
Fix imports
koppor Jun 14, 2024
06afd41
Fix paranthethes
koppor Jun 14, 2024
e5c8df7
Fix WTF
koppor Jun 14, 2024
b81fe07
fix test
Siedlerchr Jun 15, 2024
804e851
fix autosave thread
Siedlerchr Jun 15, 2024
ef300c4
Remove dead code
koppor Jun 16, 2024
6079130
Improve code
koppor Jun 16, 2024
5e2868b
Fix semantics of "VERBATIM" and remove 1:1 relation of property and f…
koppor Jun 16, 2024
bbb5d45
Fix casing (and variable)
koppor Jun 16, 2024
70a222c
More FieldProperty cleanup
koppor Jun 16, 2024
4104798
Enhanced KeyField support (required for customized entry types)
koppor Jun 16, 2024
948b84b
Fix fixing of double white spaces
koppor Jun 16, 2024
31ddb1e
Prepare: Fix cleanup of imported entries
koppor Jun 16, 2024
75d697c
Add TODOs
koppor Jun 16, 2024
39e130e
Add normalizing of white spaces to import
koppor Jun 17, 2024
f5fc48b
Really cleanup the entry
koppor Jun 17, 2024
0c5a401
Adapt MathSciNetTest to new normalizing approach
koppor Jun 17, 2024
450b87b
Fix DBLP tests
koppor Jun 17, 2024
4fd160b
Use "List.of()" instead of "Collections.singletonList"
koppor Jun 17, 2024
67c65fb
Add @NonNull annotation
koppor Jun 17, 2024
42514e3
Merge remote-tracking branch 'origin/main' into fix-5904
koppor Jun 17, 2024
caf7562
Remove obsolete JavaDoc comment
koppor Jun 17, 2024
dfa13d3
Fix NPE at tests
koppor Jun 17, 2024
9f6d3c2
Incease heap space (again)
koppor Jun 17, 2024
96a1486
Fix missing dependency injection
koppor Jun 17, 2024
e033f20
Merge branch 'hotfix' into fix-5904
koppor Jun 17, 2024
ce1ad83
Fix NPE
koppor Jun 17, 2024
6922762
Fix checkstyle
koppor Jun 17, 2024
b8a9e62
Merge remote-tracking branch 'origin/main' into fix-5904
koppor Jun 17, 2024
b88b27a
Refine comment
koppor Jun 17, 2024
b2d5ec4
Add more comments
koppor Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where drag and dropping entries from one library to another was not always working. [#11254](https://github.com/JabRef/jabref/issues/11254)
- We fixed an issue where drag and dropping entries created a shallow copy. [#11160](https://github.com/JabRef/jabref/issues/11160)
- We fixed an issue where imports to a custom group would only work for the first entry [#11085](https://github.com/JabRef/jabref/issues/11085), [#11269](https://github.com/JabRef/jabref/issues/11269)
- We fixed an issue when cursor jumped to the beginning of the line. [#5904](https://github.com/JabRef/jabref/issues/5904)
- We fixed an issue where a new entry was not added to the selected group [#8933](https://github.com/JabRef/jabref/issues/8933)
- We fixed an issue where the horizontal position of the Entry Preview inside the entry editor was not remembered across restarts [#11281](https://github.com/JabRef/jabref/issues/11281)
- We fixed an issue where the search index was not updated after linking PDF files. [#11317](https://github.com/JabRef/jabref/pull/11317)
- We fixed rendering of (first) author with a single letter surname. [forum#4330](https://discourse.jabref.org/t/correct-rendering-of-first-author-with-a-single-letter-surname/4330)
- We fixed that the import of the related articles tab sometimes used the wrong library mode. [#11282](https://github.com/JabRef/jabref/pull/11282)
- We fixed an issue where the entry editor context menu was not shown correctly when JabRef is opened on a second, extended screen [#11323](https://github.com/JabRef/jabref/issues/11323), [#11174](https://github.com/JabRef/jabref/issues/11174)
- We fixe an issue where the value of "Override default font settings" was not applied on startup [#11344](https://github.com/JabRef/jabref/issues/11344)
- We fixed an issue where the value of "Override default font settings" was not applied on startup [#11344](https://github.com/JabRef/jabref/issues/11344)
- We fixed an issue when "Library changed on disk" appeared after a save by JabRef. [#4877](https://github.com/JabRef/jabref/issues/4877)

### Removed

Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,11 @@ testlogger {

tasks.withType(Test) {
reports.html.outputLocation.set(file("${reporting.baseDir}/${name}"))
// Enable parallel tests. See https://docs.gradle.org/8.1/userguide/performance.html#execute_tests_in_parallel for details.
maxParallelForks = Runtime.runtime.availableProcessors() - 1
ignoreFailures = true
// Enable parallel tests (on desktop).
// See https://docs.gradle.org/8.1/userguide/performance.html#execute_tests_in_parallel for details.
if (!providers.environmentVariable("CI").isPresent()) {
maxParallelForks = Math.max(Runtime.runtime.availableProcessors() - 1, 1)
}
}

tasks.register('databaseTest', Test) {
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
org.gradle.vs.watch=true

# hint by https://docs.gradle.org/current/userguide/performance.html#increase_the_heap_size
org.gradle.jvmargs=-Xmx4096M
# Hint by https://docs.gradle.org/current/userguide/performance.html#increase_the_heap_size
# Otherwise, one gets "Java heap space" errors.
org.gradle.jvmargs=-Xmx6096M

# hint by https://docs.gradle.org/current/userguide/performance.html#enable_configuration_cache
# Does not work:
Expand Down
18 changes: 15 additions & 3 deletions src/main/java/org/jabref/gui/autosaveandbackup/BackupManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
import org.jabref.logic.util.BackupFileType;
import org.jabref.logic.util.CoarseChangeFilter;
import org.jabref.logic.util.io.BackupFileUtil;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.event.BibDatabaseContextChangedEvent;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.metadata.SaveOrder;
import org.jabref.model.metadata.SelfContainedSaveOrder;
Expand Down Expand Up @@ -67,7 +69,7 @@ public class BackupManager {
private final LibraryTab libraryTab;

// Contains a list of all backup paths
// During a write, the less recent backup file is deleted
// During writing, the less recent backup file is deleted
private final Queue<Path> backupFilesQueue = new LinkedBlockingQueue<>();
private boolean needsBackup = false;

Expand Down Expand Up @@ -259,10 +261,19 @@ void performBackup(Path backupPath) {
.withSaveOrder(saveOrder)
.withReformatOnSave(preferences.getLibraryPreferences().shouldAlwaysReformatOnSave());

// "Clone" the database context
// We "know" that "only" the BibEntries might be changed during writing (see [org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase])
List<BibEntry> list = bibDatabaseContext.getDatabase().getEntries().stream()
.map(BibEntry::clone)
.map(BibEntry.class::cast)
.toList();
BibDatabase bibDatabaseClone = new BibDatabase(list);
BibDatabaseContext bibDatabaseContextClone = new BibDatabaseContext(bibDatabaseClone, bibDatabaseContext.getMetaData());

Charset encoding = bibDatabaseContext.getMetaData().getEncoding().orElse(StandardCharsets.UTF_8);
// We want to have successful backups only
// Thus, we do not use a plain "FileWriter", but the "AtomicFileWriter"
// Example: What happens if one hard powers off the machine (or kills the jabref process) during the write of the backup?
// Example: What happens if one hard powers off the machine (or kills the jabref process) during writing of the backup?
// This MUST NOT create a broken backup file that then jabref wants to "restore" from?
try (Writer writer = new AtomicFileWriter(backupPath, encoding, false)) {
BibWriter bibWriter = new BibWriter(writer, bibDatabaseContext.getDatabase().getNewLineSeparator());
Expand All @@ -272,7 +283,8 @@ void performBackup(Path backupPath) {
preferences.getFieldPreferences(),
preferences.getCitationKeyPatternPreferences(),
entryTypesManager)
.saveDatabase(bibDatabaseContext);
// we save the clone to prevent the original database (and thus the UI) from being changed
.saveDatabase(bibDatabaseContextClone);
backupFilesQueue.add(backupPath);

// We wrote the file successfully
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private List<EntryEditorTab> createTabs() {
tabs.add(new SciteTab(preferencesService, taskExecutor, dialogService));
tabs.add(new CitationRelationsTab(dialogService, databaseContext,
undoManager, stateManager, fileMonitor, preferencesService, libraryTab, taskExecutor));
tabs.add(new RelatedArticlesTab(entryEditorPreferences, preferencesService, dialogService, taskExecutor));
tabs.add(new RelatedArticlesTab(databaseContext, entryEditorPreferences, preferencesService, dialogService, taskExecutor));
sourceTab = new SourceTab(
databaseContext,
undoManager,
Expand Down Expand Up @@ -361,9 +361,6 @@ private void adaptVisibleTabs() {
}
}

/**
* @return the currently edited entry
*/
public BibEntry getCurrentlyEditedEntry() {
return currentlyEditedEntry;
}
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import org.jabref.logic.importer.ImportCleanup;
import org.jabref.logic.importer.fetcher.MrDLibFetcher;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseModeDetection;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.StandardField;
import org.jabref.preferences.MrDlibPreferences;
Expand All @@ -47,13 +46,18 @@ public class RelatedArticlesTab extends EntryEditorTab {
private final DialogService dialogService;
private final TaskExecutor taskExecutor;

private final BibDatabaseContext databaseContext;

private final PreferencesService preferencesService;
private final EntryEditorPreferences entryEditorPreferences;

public RelatedArticlesTab(EntryEditorPreferences entryEditorPreferences,
public RelatedArticlesTab(BibDatabaseContext databaseContext,
EntryEditorPreferences entryEditorPreferences,
PreferencesService preferencesService,
DialogService dialogService,
TaskExecutor taskExecutor) {
this.databaseContext = databaseContext;

this.dialogService = dialogService;
this.taskExecutor = taskExecutor;

Expand Down Expand Up @@ -82,7 +86,7 @@ private StackPane getRelatedArticlesPane(BibEntry entry) {
.wrap(() -> fetcher.performSearch(entry))
.onRunning(() -> progress.setVisible(true))
.onSuccess(relatedArticles -> {
ImportCleanup cleanup = ImportCleanup.targeting(BibDatabaseModeDetection.inferMode(new BibDatabase(List.of(entry))));
ImportCleanup cleanup = ImportCleanup.targeting(databaseContext.getMode(), preferencesService.getFieldPreferences());
cleanup.doPostCleanup(relatedArticles);
progress.setVisible(false);
root.getChildren().add(getRelatedArticleInfo(relatedArticles, fetcher));
Expand Down
54 changes: 27 additions & 27 deletions src/main/java/org/jabref/gui/externalfiles/ImportHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class ImportHandler {

private static final Logger LOGGER = LoggerFactory.getLogger(ImportHandler.class);
private final BibDatabaseContext bibDatabaseContext;
private final PreferencesService preferencesService;
private final PreferencesService preferences;
private final FileUpdateMonitor fileUpdateMonitor;
private final ExternalFilesEntryLinker linker;
private final ExternalFilesContentImporter contentImporter;
Expand All @@ -75,22 +75,22 @@ public class ImportHandler {
private final TaskExecutor taskExecutor;

public ImportHandler(BibDatabaseContext database,
PreferencesService preferencesService,
PreferencesService preferences,
FileUpdateMonitor fileupdateMonitor,
UndoManager undoManager,
StateManager stateManager,
DialogService dialogService,
TaskExecutor taskExecutor) {

this.bibDatabaseContext = database;
this.preferencesService = preferencesService;
this.preferences = preferences;
this.fileUpdateMonitor = fileupdateMonitor;
this.stateManager = stateManager;
this.dialogService = dialogService;
this.taskExecutor = taskExecutor;

this.linker = new ExternalFilesEntryLinker(preferencesService.getFilePreferences(), database, dialogService);
this.contentImporter = new ExternalFilesContentImporter(preferencesService.getImportFormatPreferences());
this.linker = new ExternalFilesEntryLinker(preferences.getFilePreferences(), database, dialogService);
this.contentImporter = new ExternalFilesContentImporter(preferences.getImportFormatPreferences());
this.undoManager = undoManager;
}

Expand Down Expand Up @@ -185,7 +185,7 @@ private BibEntry createEmptyEntryWithLink(Path file) {
* There is no automatic download done.
*/
public void importEntries(List<BibEntry> entries) {
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode());
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode(), preferences.getFieldPreferences());
cleanup.doPostCleanup(entries);
importCleanedEntries(entries);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ private void importEntryWithDuplicateCheck(BibDatabaseContext bibDatabaseContext

@VisibleForTesting
BibEntry cleanUpEntry(BibDatabaseContext bibDatabaseContext, BibEntry entry) {
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode());
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode(), preferences.getFieldPreferences());
return cleanup.doPostCleanup(entry);
}

Expand Down Expand Up @@ -246,26 +246,26 @@ public Optional<BibEntry> handleDuplicates(BibDatabaseContext bibDatabaseContext
}

public DuplicateDecisionResult getDuplicateDecision(BibEntry originalEntry, BibEntry duplicateEntry, BibDatabaseContext bibDatabaseContext, DuplicateResolverDialog.DuplicateResolverResult decision) {
DuplicateResolverDialog dialog = new DuplicateResolverDialog(duplicateEntry, originalEntry, DuplicateResolverDialog.DuplicateResolverType.IMPORT_CHECK, bibDatabaseContext, stateManager, dialogService, preferencesService);
DuplicateResolverDialog dialog = new DuplicateResolverDialog(duplicateEntry, originalEntry, DuplicateResolverDialog.DuplicateResolverType.IMPORT_CHECK, bibDatabaseContext, stateManager, dialogService, preferences);
if (decision == BREAK) {
decision = dialogService.showCustomDialogAndWait(dialog).orElse(BREAK);
}
if (preferencesService.getMergeDialogPreferences().shouldMergeApplyToAllEntries()) {
preferencesService.getMergeDialogPreferences().setAllEntriesDuplicateResolverDecision(decision);
if (preferences.getMergeDialogPreferences().shouldMergeApplyToAllEntries()) {
preferences.getMergeDialogPreferences().setAllEntriesDuplicateResolverDecision(decision);
}
return new DuplicateDecisionResult(decision, dialog.getMergedEntry());
}

public void setAutomaticFields(List<BibEntry> entries) {
UpdateField.setAutomaticFields(
entries,
preferencesService.getOwnerPreferences(),
preferencesService.getTimestampPreferences()
preferences.getOwnerPreferences(),
preferences.getTimestampPreferences()
);
}

public void downloadLinkedFiles(BibEntry entry) {
if (preferencesService.getFilePreferences().shouldDownloadLinkedFiles()) {
if (preferences.getFilePreferences().shouldDownloadLinkedFiles()) {
entry.getFiles().stream()
.filter(LinkedFile::isOnlineLink)
.forEach(linkedFile ->
Expand All @@ -275,7 +275,7 @@ public void downloadLinkedFiles(BibEntry entry) {
bibDatabaseContext,
taskExecutor,
dialogService,
preferencesService
preferences
).download(false)
);
}
Expand All @@ -300,19 +300,19 @@ private void addToGroups(List<BibEntry> entries, Collection<GroupTreeNode> group
* @param entries entries to generate keys for
*/
private void generateKeys(List<BibEntry> entries) {
if (!preferencesService.getImporterPreferences().isGenerateNewKeyOnImport()) {
if (!preferences.getImporterPreferences().isGenerateNewKeyOnImport()) {
return;
}
CitationKeyGenerator keyGenerator = new CitationKeyGenerator(
bibDatabaseContext.getMetaData().getCiteKeyPatterns(preferencesService.getCitationKeyPatternPreferences()
.getKeyPatterns()),
bibDatabaseContext.getMetaData().getCiteKeyPatterns(preferences.getCitationKeyPatternPreferences()
.getKeyPatterns()),
bibDatabaseContext.getDatabase(),
preferencesService.getCitationKeyPatternPreferences());
preferences.getCitationKeyPatternPreferences());
entries.forEach(keyGenerator::generateAndSetKey);
}

public List<BibEntry> handleBibTeXData(String entries) {
BibtexParser parser = new BibtexParser(preferencesService.getImportFormatPreferences(), fileUpdateMonitor);
BibtexParser parser = new BibtexParser(preferences.getImportFormatPreferences(), fileUpdateMonitor);
try {
List<BibEntry> result = parser.parseEntries(new ByteArrayInputStream(entries.getBytes(StandardCharsets.UTF_8)));
Collection<BibtexString> stringConstants = parser.getStringValues();
Expand Down Expand Up @@ -370,9 +370,9 @@ public List<BibEntry> handleStringData(String data) throws FetcherException {
private List<BibEntry> tryImportFormats(String data) {
try {
ImportFormatReader importFormatReader = new ImportFormatReader(
preferencesService.getImporterPreferences(),
preferencesService.getImportFormatPreferences(),
preferencesService.getCitationKeyPatternPreferences(),
preferences.getImporterPreferences(),
preferences.getImportFormatPreferences(),
preferences.getCitationKeyPatternPreferences(),
fileUpdateMonitor
);
UnknownFormatImport unknownFormatImport = importFormatReader.importUnknownFormat(data);
Expand All @@ -385,19 +385,19 @@ private List<BibEntry> tryImportFormats(String data) {

private List<BibEntry> fetchByDOI(DOI doi) throws FetcherException {
LOGGER.info("Found DOI identifier in clipboard");
Optional<BibEntry> entry = new DoiFetcher(preferencesService.getImportFormatPreferences()).performSearchById(doi.getDOI());
Optional<BibEntry> entry = new DoiFetcher(preferences.getImportFormatPreferences()).performSearchById(doi.getDOI());
return OptionalUtil.toList(entry);
}

private List<BibEntry> fetchByArXiv(ArXivIdentifier arXivIdentifier) throws FetcherException {
LOGGER.info("Found arxiv identifier in clipboard");
Optional<BibEntry> entry = new ArXivFetcher(preferencesService.getImportFormatPreferences()).performSearchById(arXivIdentifier.getNormalizedWithoutVersion());
Optional<BibEntry> entry = new ArXivFetcher(preferences.getImportFormatPreferences()).performSearchById(arXivIdentifier.getNormalizedWithoutVersion());
return OptionalUtil.toList(entry);
}

private List<BibEntry> fetchByISBN(ISBN isbn) throws FetcherException {
LOGGER.info("Found ISBN identifier in clipboard");
Optional<BibEntry> entry = new IsbnFetcher(preferencesService.getImportFormatPreferences()).performSearchById(isbn.getNormalized());
Optional<BibEntry> entry = new IsbnFetcher(preferences.getImportFormatPreferences()).performSearchById(isbn.getNormalized());
return OptionalUtil.toList(entry);
}

Expand All @@ -410,8 +410,8 @@ public void importEntriesWithDuplicateCheck(BibDatabaseContext database, List<Bi
firstEntry = false;
continue;
}
if (preferencesService.getMergeDialogPreferences().shouldMergeApplyToAllEntries()) {
DuplicateResolverDialog.DuplicateResolverResult decision = preferencesService.getMergeDialogPreferences().getAllEntriesDuplicateResolverDecision();
if (preferences.getMergeDialogPreferences().shouldMergeApplyToAllEntries()) {
DuplicateResolverDialog.DuplicateResolverResult decision = preferences.getMergeDialogPreferences().getAllEntriesDuplicateResolverDecision();
LOGGER.debug("Not first entry, pref flag is true, we use {}", decision);
importEntryWithDuplicateCheck(database, entry, decision);
} else {
Expand Down
Loading
Loading