jabref icon indicating copy to clipboard operation
jabref copied to clipboard

DI Part A

Open calixtus opened this issue 1 year ago • 1 comments

First step towards implementing proper DI

Major changes

  • Migrates the old globals to the Injector map modelsAndServices
  • Removes Globals class
  • Removes DefaultInjector class
  • Refactored KeyBindingRepository to singleton
  • Replaced convertToString implementation with Guava string splitter and added tests
  • Collected logging intialization in one method
  • Refactored Launcher
  • Moved initialization stuff in JabRefGUI to a new method

Follows https://github.com/koppor/jabref/pull/687

Mandatory checks

  • [ ] Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • [ ] Tests created for changes (if applicable)
  • [ ] Manually tested changed features in running JabRef (always required)
  • [ ] Screenshots added in PR description (for UI changes)
  • [ ] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • [ ] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

calixtus avatar May 27 '24 19:05 calixtus

~~The code locally checked out is not the same as treated by GitHub 😱~~

Update: We had some remote branch issues (same branch name on two upstreams).

koppor avatar Jun 17 '24 20:06 koppor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

github-actions[bot] avatar Jun 17 '24 21:06 github-actions[bot]

@calixtus, saving preferences throws an exception:

ERROR: Uncaught exception occurred in Thread[#53,JavaFX Application Thread,5,main]: java.lang.IllegalStateException: Cannot instantiate view: interface org.jabref.gui.frame.UiMessageHandler
	at afterburner.fx/com.airhacks.afterburner.injection.Injector.lambda$getDefaultInstanceSupplier$6(Injector.java:237)
	at afterburner.fx/com.airhacks.afterburner.injection.Injector.instantiateModelOrService(Injector.java:111)
	at afterburner.fx/com.airhacks.afterburner.injection.Injector.instantiateModelOrService(Injector.java:104)
	at [email protected]/org.jabref.gui.preferences.general.GeneralTabViewModel.storeSettings(GeneralTabViewModel.java:265)
	at [email protected]/org.jabref.gui.preferences.AbstractPreferenceTabView.storeSettings(AbstractPreferenceTabView.java:34)
	at [email protected]/org.jabref.gui.preferences.PreferencesDialogViewModel.storeAllSettings(PreferencesDialogViewModel.java:183)
	at [email protected]/org.jabref.gui.preferences.PreferencesDialogView.savePreferencesAndCloseDialog(PreferencesDialogView.java:132)
	at [email protected]/org.jabref.gui.preferences.PreferencesDialogView.lambda$new$0(PreferencesDialogView.java:56)
	at [email protected]/org.jabref.gui.util.ControlHelper.lambda$setAction$0(ControlHelper.java:29)

LoayGhreeb avatar Jun 18 '24 04:06 LoayGhreeb

Thanks. Hotfix created.

calixtus avatar Jun 18 '24 05:06 calixtus