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

Changes to preferences are not saved #3845

Closed
wujastyk opened this issue Mar 14, 2018 · 12 comments
Closed

Changes to preferences are not saved #3845

wujastyk opened this issue Mar 14, 2018 · 12 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty. preferences

Comments

@wujastyk
Copy link

wujastyk commented Mar 14, 2018

JabRef 4.2-dev--snapshot--2018-03-13--master--90c7afa1c
Linux 4.13.0-36-generic amd64
Java 1.8.0_161

Steps to reproduce:

  1. open options/preferences
  2. make any change, e.g., entry table columns, or export sort order, or anything afaik
  3. press OK

Nothing happens. The preferences window stays open, and no changes are saved.

Log:

Opening: /home/dom/Dropbox/Projects/HSSA/issue 5.2 rasayana issue/07 Sehnalova/paper/sehnalova.bib
Opening: /home/dom/Dropbox/localtexmf/bibtex/bib/biblio4-utf8.bib
Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.ArithmeticException: / by zero
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCyclePosition(PreviewPreferences.java:80)
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCycle(PreviewPreferences.java:72)
at org.jabref.gui.preftabs.PreviewPrefsTab.storeSettings(PreviewPrefsTab.java:247)
at org.jabref.gui.preftabs.PreferencesDialog.storeAllSettings(PreferencesDialog.java:243)
at org.jabref.gui.preftabs.PreferencesDialog.access$000(PreferencesDialog.java:54)
at org.jabref.gui.preftabs.PreferencesDialog$OkAction.actionPerformed(PreferencesDialog.java:271)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.ArithmeticException: / by zero
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCyclePosition(PreviewPreferences.java:80)
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCycle(PreviewPreferences.java:72)
at org.jabref.gui.preftabs.PreviewPrefsTab.storeSettings(PreviewPrefsTab.java:247)
at org.jabref.gui.preftabs.PreferencesDialog.storeAllSettings(PreferencesDialog.java:243)
at org.jabref.gui.preftabs.PreferencesDialog.access$000(PreferencesDialog.java:54)
at org.jabref.gui.preftabs.PreferencesDialog$OkAction.actionPerformed(PreferencesDialog.java:271)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.ArithmeticException: / by zero
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCyclePosition(PreviewPreferences.java:80)
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCycle(PreviewPreferences.java:72)
at org.jabref.gui.preftabs.PreviewPrefsTab.storeSettings(PreviewPrefsTab.java:247)
at org.jabref.gui.preftabs.PreferencesDialog.storeAllSettings(PreferencesDialog.java:243)
at org.jabref.gui.preftabs.PreferencesDialog.access$000(PreferencesDialog.java:54)
at org.jabref.gui.preftabs.PreferencesDialog$OkAction.actionPerformed(PreferencesDialog.java:271)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.ArithmeticException: / by zero
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCyclePosition(PreviewPreferences.java:80)
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCycle(PreviewPreferences.java:72)
at org.jabref.gui.preftabs.PreviewPrefsTab.storeSettings(PreviewPrefsTab.java:247)
at org.jabref.gui.preftabs.PreferencesDialog.storeAllSettings(PreferencesDialog.java:243)
at org.jabref.gui.preftabs.PreferencesDialog.access$000(PreferencesDialog.java:54)
at org.jabref.gui.preftabs.PreferencesDialog$OkAction.actionPerformed(PreferencesDialog.java:271)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.ArithmeticException: / by zero
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCyclePosition(PreviewPreferences.java:80)
at org.jabref.preferences.PreviewPreferences$Builder.withPreviewCycle(PreviewPreferences.java:72)
at org.jabref.gui.preftabs.PreviewPrefsTab.storeSettings(PreviewPrefsTab.java:247)
at org.jabref.gui.preftabs.PreferencesDialog.storeAllSettings(PreferencesDialog.java:243)
at org.jabref.gui.preftabs.PreferencesDialog.access$000(PreferencesDialog.java:54)
at org.jabref.gui.preftabs.PreferencesDialog$OkAction.actionPerformed(PreferencesDialog.java:271)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

@wujastyk wujastyk changed the title Changes to preferences are not changed Changes to preferences are not saved Mar 14, 2018
@Siedlerchr Siedlerchr reopened this Mar 14, 2018
@Siedlerchr
Copy link
Member

You seem to have some odd things in your Preview Preferences Tab, Could you try adding and removing some of the Preview Styles? and see if it works afterwards?

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Mar 14, 2018
@wujastyk
Copy link
Author

wujastyk commented Mar 14, 2018 via email

@wujastyk
Copy link
Author

I opened JabRef 4.0, went into Options/Preferences/Entry preview, and I was able to delete the selected styles in the right pane. But I had to do each one separately, followed by a save. Finally I was down to the default "Preview", and could save.

Then I reopened
JabRef 4.2-dev--snapshot--2018-03-13--master--90c7afa1c
Linux 4.13.0-36-generic amd64
Java 1.8.0_161

and I could now add and remove styles and save.

But with other Options/Preferences, I could still not save. For example I can't change the Appearance. I mean, I can change it, but I can't save the change. Checking many other settings at random, I can't save changes to any of them.

@Siedlerchr
Copy link
Member

Hm. The error indicates that something with storing the current cycled position of the preview (when you cycle through the entry preview layouts with F9) is wrong.
Whenever you cycle through the entry previews, the current cycle position is stored. And there the error was raised.

public Builder withPreviewCyclePosition(int position) {
previeCyclePosition = position;
while (previeCyclePosition < 0) {
previeCyclePosition += previewCycle.size();
}
previeCyclePosition %= previewCycle.size();
return this;
}

@tobiasdiez tobiasdiez added bug Confirmed bugs or reports that are very likely to be bugs preferences and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Mar 14, 2018
@Siedlerchr
Copy link
Member

Do you get now different errors in the log or still the same when you try to save prefs in 4.2?

@tobiasdiez
Copy link
Member

In line 80, you may divide by 0 (implicitly using the reminder % operation) and thus the error occurs.

@tobiasdiez tobiasdiez added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Mar 14, 2018
@wujastyk
Copy link
Author

wujastyk commented Mar 14, 2018 via email

@tobiasdiez
Copy link
Member

This should be fixed in the latest development version. Could you please check the build from http://builds.jabref.org/master/. Thanks!

@wujastyk
Copy link
Author

wujastyk commented Apr 16, 2018 via email

@douglasrizzo
Copy link

Sorry if this is not the place to ask this, but are the preferences saved in a file? If so, where is it located?

@douglasrizzo
Copy link

Nevermind, I found them at ~/.java/.userPrefs/org/jabref.

@Siedlerchr
Copy link
Member

The storage location is the default preference storage location from Java. It differs on systems. On Unix it's stored in files, in windows in the registry

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 good first issue An issue intended for project-newcomers. Varies in difficulty. preferences
Projects
None yet
Development

No branches or pull requests

4 participants