Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
94e1770
feat: draft PR for substituting `BibEntryTypesManager` instead of `Bi…
dcarpentiero Sep 1, 2025
b42b7c8
Merge remote-tracking branch 'origin/main' into customized-entry-type…
dcarpentiero Sep 1, 2025
274d859
fix: removing comments
dcarpentiero Sep 2, 2025
b9d69c2
fix: resolving conflicts
dcarpentiero Sep 2, 2025
b2bc3a4
Merge branch 'main' into customized-entry-types-13794
dcarpentiero Sep 2, 2025
8128685
Merge branch 'main' into customized-entry-types-13794
dcarpentiero Sep 2, 2025
831ed3b
Merge branch 'main' into customized-entry-types-13794
dcarpentiero Sep 3, 2025
9942817
fix: modern best practices: Set.copyOf() instead of new HashSet<>()
dcarpentiero Sep 3, 2025
ff8006e
Merge remote-tracking branch 'origin/customized-entry-types-13794' in…
dcarpentiero Sep 3, 2025
d453516
feat: double constructor: a default and accepting manager constructor
dcarpentiero Sep 3, 2025
53b83d9
Update jablib/src/main/java/org/jabref/logic/quality/consistency/Bibl…
dcarpentiero Sep 4, 2025
b7145af
feat: passing down the BibEntryTypes manager to BibliographyConsisten…
dcarpentiero Sep 4, 2025
baeff03
feat: starting substituting CliPreferences with JabRefCliPreferences …
dcarpentiero Sep 4, 2025
3a79c98
Merge branch 'main' into customized-entry-types-13794
dcarpentiero Sep 4, 2025
d302f7c
fix: BibliographyConsistencyCheck now accept a CliPreference passed d…
dcarpentiero Sep 4, 2025
76394d7
Merge branch 'main' into customized-entry-types-13794
dcarpentiero Sep 5, 2025
3f97a75
feat: `BibliographyConsistencyCheckTest`, `BibliographyConsistencyChe…
dcarpentiero Sep 8, 2025
37416ff
fix: passing `getCustomEntryTypes` parameter to `JabKit`, `CheckConsi…
dcarpentiero Sep 8, 2025
66b2bbf
fix: typo
dcarpentiero Sep 8, 2025
2031f0e
fix: typo
dcarpentiero Sep 8, 2025
ad131c6
fix: typo and parameter order
dcarpentiero Sep 8, 2025
9c24a2f
fix: removal unnecessary parameter
dcarpentiero Sep 8, 2025
ff9a529
fix: removal unnecessary parameter
dcarpentiero Sep 8, 2025
d6d8278
fix: removing double import--using `argumentProcessor.cliPrefences`
dcarpentiero Sep 9, 2025
0d7e37d
fix: using `mockito` for testing
dcarpentiero Sep 9, 2025
1fc3810
fix: resolving conflicts
dcarpentiero Sep 9, 2025
d30b731
fix: resolving conflicts
dcarpentiero Sep 9, 2025
462657a
fix: resolving conflicts
dcarpentiero Sep 9, 2025
704885f
Merge branch 'main' into customized-entry-types-13794
dcarpentiero Sep 9, 2025
c321b78
fix: removing double imports
dcarpentiero Sep 9, 2025
79af35f
fix: removing double imports
dcarpentiero Sep 9, 2025
3befca7
fix: removing `CliPreferences` redundancy–– `GuiPreferences` already …
dcarpentiero Sep 10, 2025
7125b76
fix: `PreferencesMigrations.runMigrations(preferences);` now accepts …
dcarpentiero Sep 10, 2025
e580f9a
fix: passing null to `getCustomEntryTypesRepository` to get the first…
dcarpentiero Sep 10, 2025
d3bfbd8
fix: adding no-parameter `getCustomEntryRepository` method to `CliPre…
dcarpentiero Sep 10, 2025
6ed613a
fix: typo
dcarpentiero Sep 10, 2025
6cc90e2
fix: adding missing method to `BibliographyConsistencyCheckTest`
dcarpentiero Sep 10, 2025
f1adef0
fix: including previously excluded entries that have consistent (miss…
dcarpentiero Sep 10, 2025
6cea857
fix: typo
dcarpentiero Sep 10, 2025
c899efa
feat: now accepting entries that present consistent (eg. all absent) …
dcarpentiero Sep 11, 2025
3e6c4b1
fix: when filtering entries, checking if the entry has a differing fi…
dcarpentiero Sep 11, 2025
d681cd8
fix: when filtering entries, checking if the entry has a differing fi…
dcarpentiero Sep 11, 2025
5040b0c
Merge branch 'main' into customized-entry-types-13794
dcarpentiero Sep 16, 2025
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: 3 additions & 2 deletions jabgui/src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ public void start(Stage stage) {
dialogService,
fileUpdateMonitor,
preferences,
gitHandlerRegistry,
aiService,
stateManager,
countingUndoManager,
Injector.instantiateModelOrService(BibEntryTypesManager.class),
clipBoardManager,
taskExecutor,
gitHandlerRegistry);
taskExecutor);

openWindow();

Expand Down Expand Up @@ -164,6 +164,7 @@ public void initialize() {
Injector.setModelOrService(GitHandlerRegistry.class, gitHandlerRegistry);

BibEntryTypesManager entryTypesManager = preferences.getCustomEntryTypesRepository();

JournalAbbreviationRepository journalAbbreviationRepository = JournalAbbreviationLoader.loadRepository(preferences.getJournalAbbreviationPreferences());
Injector.setModelOrService(BibEntryTypesManager.class, entryTypesManager);
Injector.setModelOrService(JournalAbbreviationRepository.class, journalAbbreviationRepository);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public BibliographyConsistencyCheck.Result call() {

BibDatabaseContext bibContext = databaseContext.get();

BibliographyConsistencyCheck consistencyCheck = new BibliographyConsistencyCheck();
BibliographyConsistencyCheck consistencyCheck = new BibliographyConsistencyCheck(preferences, entryTypesManager);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch introduces a constructor call with parameters, but it does not ensure that null is never passed to the method, which violates the guideline that null should never be passed to a method.

return consistencyCheck.check(bibContext, (count, total) ->
UiTaskExecutor.runInJavaFXThread(() -> {
updateProgress(count, total);
Expand Down
9 changes: 5 additions & 4 deletions jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.jabref.logic.ai.AiService;
import org.jabref.logic.git.util.GitHandlerRegistry;
import org.jabref.logic.journals.JournalAbbreviationRepository;
import org.jabref.logic.preferences.CliPreferences;
import org.jabref.logic.util.BuildInfo;
import org.jabref.logic.util.TaskExecutor;
import org.jabref.model.database.BibDatabaseContext;
Expand Down Expand Up @@ -100,11 +101,11 @@ private enum PanelMode { MAIN_TABLE, MAIN_TABLE_AND_ENTRY_EDITOR }
private final StateManager stateManager;
private final CountingUndoManager undoManager;
private final DialogService dialogService;
private final GitHandlerRegistry gitHandlerRegistry;
private final FileUpdateMonitor fileUpdateMonitor;
private final BibEntryTypesManager entryTypesManager;
private final ClipBoardManager clipBoardManager;
private final TaskExecutor taskExecutor;
private final GitHandlerRegistry gitHandlerRegistry;

private final JabRefFrameViewModel viewModel;
private final GuiPushToApplicationCommand pushToApplicationCommand;
Expand All @@ -123,24 +124,24 @@ public JabRefFrame(Stage mainStage,
DialogService dialogService,
FileUpdateMonitor fileUpdateMonitor,
GuiPreferences preferences,
GitHandlerRegistry gitHandlerRegistry,
AiService aiService,
StateManager stateManager,
CountingUndoManager undoManager,
BibEntryTypesManager entryTypesManager,
ClipBoardManager clipBoardManager,
TaskExecutor taskExecutor,
GitHandlerRegistry gitHandlerRegistry) {
TaskExecutor taskExecutor) {
this.mainStage = mainStage;
this.dialogService = dialogService;
this.fileUpdateMonitor = fileUpdateMonitor;
this.preferences = preferences;
this.gitHandlerRegistry = gitHandlerRegistry;
this.aiService = aiService;
this.stateManager = stateManager;
this.undoManager = undoManager;
this.entryTypesManager = entryTypesManager;
this.clipBoardManager = clipBoardManager;
this.taskExecutor = taskExecutor;
this.gitHandlerRegistry = gitHandlerRegistry;

setId("frame");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.jabref.gui.util.ControlHelper;
import org.jabref.gui.util.ViewModelListCellFactory;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.entry.BibEntryTypesManager;

import com.airhacks.afterburner.views.ViewLoader;
import com.tobiasdiez.easybind.EasyBind;
Expand All @@ -39,6 +40,7 @@ public class PreferencesDialogView extends BaseDialog<PreferencesDialogViewModel

@Inject private DialogService dialogService;
@Inject private GuiPreferences preferences;
@Inject private BibEntryTypesManager bibEntryTypesManager;

private PreferencesDialogViewModel viewModel;
private final Class<? extends PreferencesTab> preferencesTabToSelectClass;
Expand Down Expand Up @@ -67,7 +69,7 @@ public PreferencesDialogViewModel getViewModel() {

@FXML
private void initialize() {
viewModel = new PreferencesDialogViewModel(dialogService, preferences);
viewModel = new PreferencesDialogViewModel(dialogService, preferences, bibEntryTypesManager);

preferenceTabList.itemsProperty().setValue(viewModel.getPreferenceTabs());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ public class PreferencesDialogViewModel extends AbstractViewModel {
private final DialogService dialogService;
private final GuiPreferences preferences;
private final ObservableList<PreferencesTab> preferenceTabs;
private final BibEntryTypesManager bibEntryTypesManager;

public PreferencesDialogViewModel(DialogService dialogService, GuiPreferences preferences) {
public PreferencesDialogViewModel(DialogService dialogService, GuiPreferences preferences, BibEntryTypesManager bibEntryTypesManager) {
this.dialogService = dialogService;
this.preferences = preferences;
this.bibEntryTypesManager = bibEntryTypesManager;

// This enables passing unsaved preference values from the AI tab to the "web search" tab.
AiTab aiTab = new AiTab();
Expand Down Expand Up @@ -190,9 +192,9 @@ public void storeAllSettings() {
+ Localization.lang("You must restart JabRef for this to come into effect."));
}

Injector.setModelOrService(BibEntryTypesManager.class, preferences.getCustomEntryTypesRepository());
Injector.setModelOrService(BibEntryTypesManager.class, preferences.getCustomEntryTypesRepository(bibEntryTypesManager));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct dependency injection manipulation in GUI code violates layered architecture principle. This logic should be moved to a service layer in org.jabref.logic.

dialogService.notify(Localization.lang("Preferences recorded."));
}
};

/**
* Inserts the preference values into the Properties of the ViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class CustomEntryTypesTab extends AbstractPreferenceTabView<CustomEntryTy
@FXML private Button addNewFieldButton;

@Inject private StateManager stateManager;
@Inject private BibEntryTypesManager bibEntryTypesManager;

private final ControlsFxVisualizer visualizer = new ControlsFxVisualizer();

Expand All @@ -76,7 +77,7 @@ public String getTabName() {
public void initialize() {
BibDatabaseMode mode = stateManager.getActiveDatabase().map(BibDatabaseContext::getMode)
.orElse(preferences.getLibraryPreferences().getDefaultBibDatabaseMode());
BibEntryTypesManager entryTypesRepository = preferences.getCustomEntryTypesRepository();
BibEntryTypesManager entryTypesRepository = preferences.getCustomEntryTypesRepository(bibEntryTypesManager);

this.viewModel = new CustomEntryTypesTabViewModel(mode, entryTypesRepository, dialogService, preferences);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ private PreferencesMigrations() {
*/
public static void runMigrations(JabRefGuiPreferences preferences) {
Preferences mainPrefsNode = Preferences.userRoot().node("/org/jabref");
BibEntryTypesManager bibEntryTypesManager = preferences.getCustomEntryTypesRepository();

upgradePrefsToOrgJabRef(mainPrefsNode);
upgradeSortOrder(preferences);
upgradeFaultyEncodingStrings(preferences);
upgradeLabelPatternToCitationKeyPattern(preferences, mainPrefsNode);
upgradeImportFileAndDirePatterns(preferences, mainPrefsNode);
upgradeStoredBibEntryTypes(preferences, mainPrefsNode, preferences.getCustomEntryTypesRepository());
upgradeStoredBibEntryTypes(preferences, mainPrefsNode, bibEntryTypesManager);
upgradeKeyBindingsToJavaFX(preferences);
addCrossRefRelatedFieldsForAutoComplete(preferences);
upgradePreviewStyle(preferences);
Expand Down
3 changes: 2 additions & 1 deletion jabkit/src/main/java/org/jabref/JabKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class JabKit {
private static Logger LOGGER;

private static final String JABKIT_BRAND = "JabKit - command line toolkit for JabRef";
private static final BibEntryTypesManager bibEntryTypesManager = new BibEntryTypesManager();

public static void main(String[] args) {
initLogging(args);
Expand All @@ -68,7 +69,7 @@ public static void main(String[] args) {
BuildInfo buildInfo = new BuildInfo();
Injector.setModelOrService(BuildInfo.class, buildInfo);

BibEntryTypesManager entryTypesManager = preferences.getCustomEntryTypesRepository();
BibEntryTypesManager entryTypesManager = preferences.getCustomEntryTypesRepository(bibEntryTypesManager);
Injector.setModelOrService(BibEntryTypesManager.class, entryTypesManager);

ArgumentProcessor argumentProcessor = new ArgumentProcessor(preferences, entryTypesManager);
Expand Down
4 changes: 3 additions & 1 deletion jabkit/src/main/java/org/jabref/cli/CheckConsistency.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.jabref.logic.quality.consistency.BibliographyConsistencyCheckResultTxtWriter;
import org.jabref.logic.quality.consistency.BibliographyConsistencyCheckResultWriter;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntryTypesManager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -26,6 +27,7 @@
@Command(name = "check-consistency", description = "Check consistency of the library.")
class CheckConsistency implements Callable<Integer> {
private static final Logger LOGGER = LoggerFactory.getLogger(CheckConsistency.class);
private static final BibEntryTypesManager bibEntryTypesManager = new BibEntryTypesManager();

@ParentCommand
private ArgumentProcessor argumentProcessor;
Expand Down Expand Up @@ -64,7 +66,7 @@ public Integer call() {

BibDatabaseContext databaseContext = parserResult.get().getDatabaseContext();

BibliographyConsistencyCheck consistencyCheck = new BibliographyConsistencyCheck();
BibliographyConsistencyCheck consistencyCheck = new BibliographyConsistencyCheck(argumentProcessor.cliPreferences, bibEntryTypesManager);
BibliographyConsistencyCheck.Result result = consistencyCheck.check(databaseContext, (count, total) -> {
if (!sharedOptions.porcelain) {
System.out.println(Localization.lang("Checking consistency for entry type %0 of %1", count + 1, total));
Expand Down
3 changes: 2 additions & 1 deletion jabkit/src/main/java/org/jabref/cli/PdfUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
@Command(name = "update", description = "Update linked PDFs with XMP and/or embedded BibTeX.")
class PdfUpdate implements Runnable {
private static final Logger LOGGER = LoggerFactory.getLogger(PdfUpdate.class);
private static final BibEntryTypesManager bibEntryTypesManager = new BibEntryTypesManager();

@ParentCommand
protected Pdf pdf;
Expand Down Expand Up @@ -93,7 +94,7 @@ public void run() {
pdf.argumentProcessor.cliPreferences.getXmpPreferences(),
pdf.argumentProcessor.cliPreferences.getFilePreferences(),
pdf.argumentProcessor.cliPreferences.getLibraryPreferences().getDefaultBibDatabaseMode(),
pdf.argumentProcessor.cliPreferences.getCustomEntryTypesRepository(),
pdf.argumentProcessor.cliPreferences.getCustomEntryTypesRepository(bibEntryTypesManager),
pdf.argumentProcessor.cliPreferences.getFieldPreferences(),
Injector.instantiateModelOrService(JournalAbbreviationRepository.class),
formats.contains("xmp"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.jabref.logic.util.StandardFileType;
import org.jabref.logic.xmp.XmpPreferences;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.metadata.SelfContainedSaveOrder;

public class ExporterFactory {
Expand All @@ -30,6 +31,7 @@ public static ExporterFactory create(CliPreferences preferences) {
XmpPreferences xmpPreferences = preferences.getXmpPreferences();
FieldPreferences fieldPreferences = preferences.getFieldPreferences();
BibDatabaseMode bibDatabaseMode = preferences.getLibraryPreferences().getDefaultBibDatabaseMode();
BibEntryTypesManager bibEntryTypesManager = new BibEntryTypesManager();

List<Exporter> exporters = new ArrayList<>();

Expand Down Expand Up @@ -59,7 +61,7 @@ public static ExporterFactory create(CliPreferences preferences) {
exporters.add(new ModsExporter());
exporters.add(new XmpExporter(xmpPreferences));
exporters.add(new XmpPdfExporter(xmpPreferences));
exporters.add(new EmbeddedBibFilePdfExporter(bibDatabaseMode, preferences.getCustomEntryTypesRepository(), fieldPreferences));
exporters.add(new EmbeddedBibFilePdfExporter(bibDatabaseMode, preferences.getCustomEntryTypesRepository(bibEntryTypesManager), fieldPreferences));
exporters.add(new CffExporter());
exporters.add(new EndnoteXmlExporter(preferences.getBibEntryPreferences()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public interface CliPreferences {
*/
SelfContainedSaveConfiguration getSelfContainedExportConfiguration();

BibEntryTypesManager getCustomEntryTypesRepository(BibEntryTypesManager bibEntryTypesManager);

BibEntryTypesManager getCustomEntryTypesRepository();

void storeCustomEntryTypesRepository(BibEntryTypesManager entryTypesManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,15 +1219,20 @@ public JournalAbbreviationPreferences getJournalAbbreviationPreferences() {
//*************************************************************************************************************
// CustomEntryTypes
//*************************************************************************************************************

@Override
public BibEntryTypesManager getCustomEntryTypesRepository() {
BibEntryTypesManager bibEntryTypesManager = new BibEntryTypesManager();
EnumSet.allOf(BibDatabaseMode.class).forEach(mode ->
bibEntryTypesManager.addCustomOrModifiedTypes(getBibEntryTypes(mode), mode));
return bibEntryTypesManager;
}

@Override
public BibEntryTypesManager getCustomEntryTypesRepository(BibEntryTypesManager bibEntryTypesManager) {
EnumSet.allOf(BibDatabaseMode.class).forEach(mode ->
bibEntryTypesManager.addCustomOrModifiedTypes(getBibEntryTypes(mode), mode));
return bibEntryTypesManager;
}

private List<BibEntryType> getBibEntryTypes(BibDatabaseMode bibDatabaseMode) {
List<BibEntryType> storedEntryTypes = new ArrayList<>();
Preferences prefsNode = getPrefsNodeForCustomizedEntryTypes(bibDatabaseMode);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jabref.logic.quality.consistency;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand All @@ -17,16 +16,14 @@
import org.jabref.logic.bibtex.comparator.BibEntryByFieldsComparator;
import org.jabref.logic.bibtex.comparator.FieldComparatorStack;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryType;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.entry.field.Field;
import org.jabref.model.entry.field.InternalField;
import org.jabref.model.entry.field.SpecialField;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.field.UserSpecificCommentField;
import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions;
import org.jabref.model.entry.types.BibtexEntryTypeDefinitions;
import org.jabref.model.entry.types.EntryType;

import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -55,6 +52,12 @@ public class BibliographyConsistencyCheck {
StandardField.MODIFICATIONDATE
);

private final BibEntryTypesManager bibEntryTypesManager;

public BibliographyConsistencyCheck(org.jabref.logic.preferences.CliPreferences cliPreferences, BibEntryTypesManager bibEntryTypesManager) {
this.bibEntryTypesManager = cliPreferences.getCustomEntryTypesRepository(bibEntryTypesManager);
}

private static Set<Field> filterExcludedFields(Collection<Field> fields) {
return fields.stream()
.filter(field -> !EXPLICITLY_EXCLUDED_FIELDS.contains(field))
Expand All @@ -73,11 +76,17 @@ private static Set<Field> filterExcludedFields(Collection<Field> fields) {
@VisibleForTesting
List<BibEntry> filterAndSortEntriesWithFieldDifferences(Set<BibEntry> entries, Set<Field> differingFields, Set<Field> requiredFields) {
return entries.stream()
.filter(entry ->
// This removes entries that have all differing fields set (could be confusing to the user)
!Collections.disjoint(entry.getFields(), differingFields)
// This ensures that all entries with missing required fields are included
|| !entry.getFields().containsAll(requiredFields))
.filter(entry -> {
// Include entries that are missing any required fields
boolean missingRequiredField = requiredFields.stream().anyMatch(field -> !entry.hasField(field));

// Include entries that have any of the differing fields
boolean hasDifferingField = differingFields.stream().anyMatch(entry::hasField);

// Include all entries when there are differing fields (to show inconsistencies)
// OR when missing required fields
return !differingFields.isEmpty() || missingRequiredField;
})
.sorted(new FieldComparatorStack<>(List.of(
new BibEntryByCitationKeyComparator(),
new BibEntryByFieldsComparator()
Expand Down Expand Up @@ -112,12 +121,10 @@ public Result check(BibDatabaseContext bibContext, BiConsumer<Integer, Integer>

collectEntriesIntoMaps(bibContext, entryTypeToFieldsInAnyEntryMap, entryTypeToFieldsInAllEntriesMap, entryTypeToEntriesMap);

List<BibEntryType> entryTypeDefinitions;
if (bibContext.getMode() == BibDatabaseMode.BIBLATEX) {
entryTypeDefinitions = BiblatexEntryTypeDefinitions.ALL;
} else {
entryTypeDefinitions = BibtexEntryTypeDefinitions.ALL;
}
List<BibEntryType> entryTypeDefinitions = bibEntryTypesManager
.getAllTypes(bibContext.getMode())
.stream()
.toList();
Comment on lines +124 to +127
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to convert to a list - Collection should directly work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collection is a interface though–i need some class to implement it right? For example HashSet class implement the Set interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-09-04 alle 11 07 41

Also (correct me if I'm wrong, I'm here to learn) the expected type is a list, so I can't provide something else.


// Use LinkedHashMap to preserve the order of Bib(tex|latex)EntryTypeDefinitions.ALL
Map<EntryType, EntryTypeResult> resultMap = new LinkedHashMap<>();
Expand Down Expand Up @@ -161,7 +168,6 @@ public Result check(BibDatabaseContext bibContext, BiConsumer<Integer, Integer>
}

private static void collectEntriesIntoMaps(BibDatabaseContext bibContext, Map<EntryType, Set<Field>> entryTypeToFieldsInAnyEntryMap, Map<EntryType, Set<Field>> entryTypeToFieldsInAllEntriesMap, Map<EntryType, Set<BibEntry>> entryTypeToEntriesMap) {
BibDatabaseMode mode = bibContext.getMode();
List<BibEntry> entries = bibContext.getEntries();

for (BibEntry entry : entries) {
Expand Down
Loading
Loading