Skip to content
Open
Show file tree
Hide file tree
Changes from 31 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
4 changes: 3 additions & 1 deletion jabgui/src/main/java/org/jabref/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.jabref.logic.util.BuildInfo;
import org.jabref.logic.util.Directories;
import org.jabref.migrations.PreferencesMigrations;
import org.jabref.model.entry.BibEntryTypesManager;

import com.airhacks.afterburner.injection.Injector;
import org.slf4j.Logger;
Expand Down Expand Up @@ -56,6 +57,7 @@ public static void main(String[] args) {
Injector.setModelOrService(BuildInfo.class, new BuildInfo());

final JabRefGuiPreferences preferences = JabRefGuiPreferences.getInstance();
final BibEntryTypesManager bibEntryTypesManager = new BibEntryTypesManager();
Copy link
Member

Choose a reason for hiding this comment

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

Please do not store it as variable - you only need it once below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.


ArgumentProcessor argumentProcessor = new ArgumentProcessor(
args,
Expand Down Expand Up @@ -87,7 +89,7 @@ public static void main(String[] args) {
systemExit();
}

PreferencesMigrations.runMigrations(preferences);
PreferencesMigrations.runMigrations(preferences, bibEntryTypesManager);
Copy link
Member

Choose a reason for hiding this comment

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

Remove the parameter.

Later, use preferences.getCustomEntryTypesRepository() to get the bibEntryTypesManager

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the advantage of declaring BibEntryTypesManager bibEntryTypesManager = preferences.getCustomEntryTypesRepository(); and then upgradeStoredBibEntryTypes(preferences, mainPrefsNode, bibEntryTypesManager); instead of just upgradeStoredBibEntryTypes(preferences, mainPrefsNode, preferences.getCustomEntryTypesRepository());? Am i missing something here?


PostgreServer postgreServer = new PostgreServer();
Injector.setModelOrService(PostgreServer.class, postgreServer);
Expand Down
12 changes: 9 additions & 3 deletions jabgui/src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.net.ProxyRegisterer;
import org.jabref.logic.os.OS;
import org.jabref.logic.preferences.CliPreferences;
import org.jabref.logic.protectedterms.ProtectedTermsLoader;
import org.jabref.logic.remote.RemotePreferences;
import org.jabref.logic.remote.server.RemoteListenerServerManager;
Expand Down Expand Up @@ -71,6 +72,7 @@ public class JabRefGUI extends Application {

private static List<UiCommand> uiCommands;
private static GuiPreferences preferences;
private static CliPreferences cliPreferences;

// AI Service handles chat messages etc. Therefore, it is tightly coupled to the GUI.
private static AiService aiService;
Expand All @@ -85,6 +87,8 @@ public class JabRefGUI extends Application {
private static ClipBoardManager clipBoardManager;
private static DialogService dialogService;
private static JabRefFrame mainFrame;

private static BibEntryTypesManager bibEntryTypesManager;
private static GitHandlerRegistry gitHandlerRegistry;

private static RemoteListenerServerManager remoteListenerServerManager;
Expand Down Expand Up @@ -116,13 +120,14 @@ public void start(Stage stage) {
dialogService,
fileUpdateMonitor,
preferences,
cliPreferences,
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this.

See that GuiPreferences extends CliPreferences.

Thus, the GuiPreferences have all the CliPreferences

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

gitHandlerRegistry,
aiService,
stateManager,
countingUndoManager,
Injector.instantiateModelOrService(BibEntryTypesManager.class),
clipBoardManager,
taskExecutor,
gitHandlerRegistry);
taskExecutor);

openWindow();

Expand Down Expand Up @@ -163,7 +168,8 @@ public void initialize() {
gitHandlerRegistry = new GitHandlerRegistry();
Injector.setModelOrService(GitHandlerRegistry.class, gitHandlerRegistry);

BibEntryTypesManager entryTypesManager = preferences.getCustomEntryTypesRepository();
BibEntryTypesManager entryTypesManager = preferences.getCustomEntryTypesRepository(bibEntryTypesManager);

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 @@ -13,6 +13,7 @@
import org.jabref.gui.preferences.GuiPreferences;
import org.jabref.gui.util.UiTaskExecutor;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.preferences.CliPreferences;
import org.jabref.logic.quality.consistency.BibliographyConsistencyCheck;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntryTypesManager;
Expand All @@ -29,19 +30,22 @@ public class ConsistencyCheckAction extends SimpleCommand {
private final DialogService dialogService;
private final StateManager stateManager;
private final GuiPreferences preferences;
private final CliPreferences cliPreferences;
private final BibEntryTypesManager entryTypesManager;
private final UiTaskExecutor taskExecutor;

public ConsistencyCheckAction(Supplier<LibraryTab> tabSupplier,
DialogService dialogService,
StateManager stateManager,
GuiPreferences preferences,
CliPreferences cliPreferences,
BibEntryTypesManager entryTypesManager,
UiTaskExecutor taskExecutor) {
this.tabSupplier = tabSupplier;
this.dialogService = dialogService;
this.stateManager = stateManager;
this.preferences = preferences;
this.cliPreferences = cliPreferences;
this.entryTypesManager = entryTypesManager;
this.taskExecutor = taskExecutor;

Expand All @@ -62,7 +66,7 @@ public BibliographyConsistencyCheck.Result call() {

BibDatabaseContext bibContext = databaseContext.get();

BibliographyConsistencyCheck consistencyCheck = new BibliographyConsistencyCheck();
BibliographyConsistencyCheck consistencyCheck = new BibliographyConsistencyCheck(cliPreferences, entryTypesManager);
return consistencyCheck.check(bibContext, (count, total) ->
UiTaskExecutor.runInJavaFXThread(() -> {
updateProgress(count, total);
Expand Down
13 changes: 9 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 @@ -57,6 +57,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 @@ -88,6 +89,7 @@ private enum PanelMode { MAIN_TABLE, MAIN_TABLE_AND_ENTRY_EDITOR }
private static final Logger LOGGER = LoggerFactory.getLogger(JabRefFrame.class);

private final GuiPreferences preferences;
private final CliPreferences cliPreferences;
private final AiService aiService;
private final GlobalSearchBar globalSearchBar;

Expand All @@ -99,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 @@ -122,24 +124,26 @@ public JabRefFrame(Stage mainStage,
DialogService dialogService,
FileUpdateMonitor fileUpdateMonitor,
GuiPreferences preferences,
CliPreferences cliPreferences,
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.cliPreferences = cliPreferences;
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 Expand Up @@ -240,6 +244,7 @@ private void initLayout() {
sidePane,
pushToApplicationCommand,
preferences,
cliPreferences,
stateManager,
fileUpdateMonitor,
taskExecutor,
Expand Down
6 changes: 5 additions & 1 deletion jabgui/src/main/java/org/jabref/gui/frame/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import org.jabref.logic.journals.JournalAbbreviationRepository;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.os.OS;
import org.jabref.logic.preferences.CliPreferences;
import org.jabref.logic.util.TaskExecutor;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.entry.field.SpecialField;
Expand All @@ -101,6 +102,7 @@ public class MainMenu extends MenuBar {
private final SidePane sidePane;
private final GuiPushToApplicationCommand pushToApplicationCommand;
private final GuiPreferences preferences;
private final CliPreferences cliPreferences;
private final StateManager stateManager;
private final FileUpdateMonitor fileUpdateMonitor;
private final TaskExecutor taskExecutor;
Expand All @@ -119,6 +121,7 @@ public MainMenu(JabRefFrame frame,
SidePane sidePane,
GuiPushToApplicationCommand pushToApplicationCommand,
GuiPreferences preferences,
CliPreferences cliPreferences,
StateManager stateManager,
FileUpdateMonitor fileUpdateMonitor,
TaskExecutor taskExecutor,
Expand All @@ -136,6 +139,7 @@ public MainMenu(JabRefFrame frame,
this.sidePane = sidePane;
this.pushToApplicationCommand = pushToApplicationCommand;
this.preferences = preferences;
this.cliPreferences = cliPreferences;
this.stateManager = stateManager;
this.fileUpdateMonitor = fileUpdateMonitor;
this.taskExecutor = taskExecutor;
Expand Down Expand Up @@ -274,7 +278,7 @@ private void createMenu() {
factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(frame::getCurrentLibraryTab, dialogService, stateManager, preferences, entryTypesManager, taskExecutor)),
factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(dialogService, stateManager, undoManager, preferences)),
factory.createMenuItem(StandardActions.CHECK_INTEGRITY, new IntegrityCheckAction(frame::getCurrentLibraryTab, preferences, dialogService, stateManager, (UiTaskExecutor) taskExecutor, abbreviationRepository)),
factory.createMenuItem(StandardActions.CHECK_CONSISTENCY, new ConsistencyCheckAction(frame::getCurrentLibraryTab, dialogService, stateManager, preferences, entryTypesManager, (UiTaskExecutor) taskExecutor)),
factory.createMenuItem(StandardActions.CHECK_CONSISTENCY, new ConsistencyCheckAction(frame::getCurrentLibraryTab, dialogService, stateManager, preferences, cliPreferences, entryTypesManager, (UiTaskExecutor) taskExecutor)),
factory.createMenuItem(StandardActions.CLEANUP_ENTRIES, new CleanupAction(frame::getCurrentLibraryTab, preferences, dialogService, stateManager, taskExecutor, undoManager)),

new SeparatorMenuItem(),
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 @@ -48,15 +48,15 @@ private PreferencesMigrations() {
/**
* Perform checks and changes for users with a preference set from an older JabRef version.
*/
public static void runMigrations(JabRefGuiPreferences preferences) {
public static void runMigrations(JabRefGuiPreferences preferences, BibEntryTypesManager bibEntryTypesManager) {
Preferences mainPrefsNode = Preferences.userRoot().node("/org/jabref");

upgradePrefsToOrgJabRef(mainPrefsNode);
upgradeSortOrder(preferences);
upgradeFaultyEncodingStrings(preferences);
upgradeLabelPatternToCitationKeyPattern(preferences, mainPrefsNode);
upgradeImportFileAndDirePatterns(preferences, mainPrefsNode);
upgradeStoredBibEntryTypes(preferences, mainPrefsNode, preferences.getCustomEntryTypesRepository());
upgradeStoredBibEntryTypes(preferences, mainPrefsNode, preferences.getCustomEntryTypesRepository(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 @@ -63,7 +65,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 @@ -36,6 +36,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 @@ -91,7 +92,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
Loading
Loading