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

Changing owner name crashes the application #10924

Closed
2 tasks done
LoayGhreeb opened this issue Feb 26, 2024 · 3 comments · Fixed by #10932
Closed
2 tasks done

Changing owner name crashes the application #10924

LoayGhreeb opened this issue Feb 26, 2024 · 3 comments · Fixed by #10932
Labels
bug Confirmed bugs or reports that are very likely to be bugs preferences

Comments

@LoayGhreeb
Copy link
Collaborator

LoayGhreeb commented Feb 26, 2024

JabRef version

5.12 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Go to Preferences.
  2. Navigate to the Entry tab.
  3. Try to change the owner's name.
  4. Save the changes.

image

I tried to figure out why this went wrong, and I found this line that sets filePreferences = null, I want to know why this is important?

EasyBind.listen(ownerPreferences.defaultOwnerProperty(), (obs, oldValue, newValue) -> {
put(DEFAULT_OWNER, newValue);
// trigger re-determination of userAndHost and the dependent preferences
userAndHost = null;
filePreferences = null;
internalPreferences = null;
});

During the saving process, when it saves the preferences of the External file types tab, it changes in the externalFileTypes.

filePreferences.getExternalFileTypes().clear();
filePreferences.getExternalFileTypes().addAll(saveList);

This change will trigger this listener which has filePreferences set to null.

filePreferences.getExternalFileTypes().addListener((SetChangeListener<ExternalFileType>) c ->
put(EXTERNAL_FILE_TYPES, ExternalFileTypes.toStringList(filePreferences.getExternalFileTypes())));

@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs preferences labels Feb 26, 2024
@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Feb 26, 2024
@Siedlerchr
Copy link
Member

Siedlerchr commented Feb 26, 2024

Thanks for the investigation, I could reproduce this as well
It was implemented in #9910 and to be honest I don't understand it as well. Looks really odd to me. It must have something to do with setting/getting the hostname and username again but odd
Maybe @calixtus has an idea

@koppor
Copy link
Member

koppor commented Feb 26, 2024

Note that the reference to line 1404 should have included a reference to the comment two lines above:

// trigger re-determination of userAndHost and the dependent preferences

Thus, there is something wrong at "re-determination".

@koppor
Copy link
Member

koppor commented Feb 26, 2024

Full stack trace:

java.lang.NullPointerException: Cannot invoke "org.jabref.preferences.FilePreferences.getExternalFileTypes()" because "this.filePreferences" is null
	at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.lambda$getFilePreferences$111(JabRefPreferences.java:2209)
	at javafx.base@21.0.2/com.sun.javafx.collections.SetListenerHelper$SingleChange.fireValueChangedEvent(SetListenerHelper.java:161)
	at javafx.base@21.0.2/com.sun.javafx.collections.SetListenerHelper.fireValueChangedEvent(SetListenerHelper.java:70)
	at javafx.base@21.0.2/com.sun.javafx.collections.ObservableSetWrapper.callObservers(ObservableSetWrapper.java:128)
	at javafx.base@21.0.2/com.sun.javafx.collections.ObservableSetWrapper.add(ObservableSetWrapper.java:269)
	at javafx.base@21.0.2/com.sun.javafx.collections.ObservableSetWrapper.addAll(ObservableSetWrapper.java:318)
	at org.jabref@100.0.0/org.jabref.gui.preferences.externalfiletypes.ExternalFileTypesTabViewModel.storeSettings(ExternalFileTypesTabViewModel.java:52)
	at org.jabref@100.0.0/org.jabref.gui.preferences.AbstractPreferenceTabView.storeSettings(AbstractPreferenceTabView.java:34)
	at org.jabref@100.0.0/org.jabref.gui.preferences.PreferencesDialogViewModel.storeAllSettings(PreferencesDialogViewModel.java:182)
	at org.jabref@100.0.0/org.jabref.gui.preferences.PreferencesDialogView.savePreferencesAndCloseDialog(PreferencesDialogView.java:132)
	at org.jabref@100.0.0/org.jabref.gui.preferences.PreferencesDialogView.lambda$new$0(PreferencesDialogView.java:56)
	at org.jabref@100.0.0/org.jabref.gui.util.ControlHelper.lambda$setAction$0(ControlHelper.java:29)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler$NormalEventFilterRecord.handleCapturingEvent(CompositeEventHandler.java:321)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchCapturingEvent(CompositeEventHandler.java:98)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:219)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(EventHandlerManager.java:178)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics@21.0.2/javafx.scene.Node.fireEvent(Node.java:8875)
	at javafx.controls@21.0.2/javafx.scene.control.Button.fire(Button.java:203)
	at javafx.controls@21.0.2/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
	at javafx.controls@21.0.2/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics@21.0.2/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
	at javafx.graphics@21.0.2/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
	at javafx.graphics@21.0.2/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at javafx.graphics@21.0.2/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at javafx.graphics@21.0.2/com.sun.glass.ui.View.notifyMouse(View.java:937)
	at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
	at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:212)
	at javafx.graphics@21.0.2/com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:515)
	at javafx.graphics@21.0.2/com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:650)
	at javafx.graphics@21.0.2/javafx.stage.Stage.showAndWait(Stage.java:469)
	at javafx.controls@21.0.2/javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162)
	at javafx.controls@21.0.2/javafx.scene.control.Dialog.showAndWait(Dialog.java:346)
	at org.jabref@100.0.0/org.jabref.gui.JabRefDialogService.showCustomDialogAndWait(JabRefDialogService.java:273)
	at org.jabref@100.0.0/org.jabref.gui.preferences.ShowPreferencesAction.execute(ShowPreferencesAction.java:26)
	at org.jabref@100.0.0/org.jabref.gui.actions.JabRefAction.lambda$new$3(JabRefAction.java:40)
	at org.controlsfx.controls@11.2.0/org.controlsfx.control.action.Action.handle(Action.java:423)
	at org.controlsfx.controls@11.2.0/org.controlsfx.control.action.Action.handle(Action.java:64)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.controls@21.0.2/javafx.scene.control.MenuItem.fire(MenuItem.java:459)
	at javafx.controls@21.0.2/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1415)
	at javafx.controls@21.0.2/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1368)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics@21.0.2/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
	at javafx.graphics@21.0.2/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
	at javafx.graphics@21.0.2/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at javafx.graphics@21.0.2/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at javafx.graphics@21.0.2/com.sun.glass.ui.View.notifyMouse(View.java:937)
	at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs preferences
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants