JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.63k stars 2.59k forks source link

Exception when trying to use context menu #6085

Closed ilippert closed 4 years ago

ilippert commented 4 years ago

JabRef 5.0--2020-03-08--93de138 Linux 5.5.7-200.fc31.x86_64 amd64 Java 13.0.2

Sorry, I am not sure how this happened...

Paste your log details here.

Detail information: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source) at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source) at java.base/java.util.Objects.checkIndex(Unknown Source) at java.base/java.util.ArrayList.get(Unknown Source) at org.jabref.merged.module/com.sun.javafx.collections.ObservableListWrapper.get(Unknown Source) at org.jabref/org.jabref.gui.actions.ActionHelper.isAnyFieldSetForSelectedEntry(Unknown Source) at org.jabref/org.jabref.gui.actions.ActionHelper.isFieldSetForSelectedEntry(Unknown Source) at org.jabref/org.jabref.gui.maintable.OpenFolderAction.(Unknown Source) at org.jabref/org.jabref.gui.maintable.RightClickMenu.create(Unknown Source) at org.jabref/org.jabref.gui.maintable.MainTable.lambda$new$1(Unknown Source) at org.jabref/org.jabref.gui.util.ViewModelTableRowFactory.lambda$call$6(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene.processMenuEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene$ScenePeerListener.menuEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMenuEvent$3(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMenuEvent$4(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMenuEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.handleMenuEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.notifyMenu(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)
calixtus commented 4 years ago

Thank you for your bug report. Can you tell me a bit about the entry you tried to right click on? Does it have a file attached? Is the attached file actually also present on your system?

ilippert commented 4 years ago

I am trying to reproduce it, but cannot. I am, sorry.

It did happen for all entries yesterday. Meanwhile I have restarted the computer, now it does not reappear...

I know this is not very helpful - and I am sorry for bothering. Still hope the report might be helpful.

calixtus commented 4 years ago

Thank you anyways. Every bug report is helping, even if it's not reproducible at this moment. What you have experienced might someone else as well. And this bug report can probably help to triangulate the causing issue later.

stefan-kolb commented 4 years ago

The only reason I can think of might be caused by the following code snippet:

    public static BooleanExpression isAnyFieldSetForSelectedEntry(List<Field> fields, StateManager stateManager) {
        BibEntry entry = stateManager.getSelectedEntries().get(0);
        return Bindings.createBooleanBinding(
                () -> entry.getFields().stream().anyMatch(fields::contains),
                entry.getFieldsObservable(),
                stateManager.getSelectedEntries());
    }

BibEntry entry = stateManager.getSelectedEntries().get(0);

Also I do not know how to trigger this method without an entry selected it might still be an empty list. At least this is what the error log says. So we can only get the entry when it exists.

Siedlerchr commented 4 years ago

@ilippert Could you please test if this issue is now solved?

ilippert commented 4 years ago

stefan-kolb's "another bug" is not solved.

i get these details when following the process

1 select two entries (one with an attached file one without) First needs to be the one with a file! 2 select open folder in context menu 3 exception occurs for selected entry without attached file

JabRef 5.1--2020-04-18--38e3aa7 Linux 5.5.16-200.fc31.x86_64 amd64 Java 14.0.1

Log File java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source) at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source) at java.base/java.util.Objects.checkIndex(Unknown Source) at java.base/java.util.ArrayList.get(Unknown Source) at org.jabref/org.jabref.gui.maintable.OpenFolderAction.lambda$execute$0(Unknown Source) at java.base/java.lang.Iterable.forEach(Unknown Source) at org.jabref/org.jabref.gui.maintable.OpenFolderAction.lambda$execute$1(Unknown Source) at java.base/java.util.Optional.ifPresent(Unknown Source) at org.jabref/org.jabref.gui.maintable.OpenFolderAction.execute(Unknown Source) at org.jabref/org.jabref.gui.actions.JabRefAction.lambda$new$2(Unknown Source) at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.control.MenuItem.fire(Unknown Source) at org.jabref.merged.module/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source) at org.jabref.merged.module/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene$MouseHandler.process(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene.processMouseEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.handleMouseEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.notifyMouse(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)
calixtus commented 4 years ago

@stefan-kolb 's fix wasn't mentioned here yet: #6122

ilippert commented 4 years ago

@Siedlerchr, sorry, this issue still has the label status: waiting-for-customer-feedback. I am not sure whether I can provide more input...

the issue described at https://github.com/JabRef/jabref/issues/6085#issuecomment-616246685 is still present

at

JabRef 5.1--2020-05-02--1d9957b Linux 5.6.8-200.fc31.x86_64 amd64 Java 14.0.1

Log File java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source) at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source) at java.base/java.util.Objects.checkIndex(Unknown Source) at java.base/java.util.ArrayList.get(Unknown Source) at org.jabref/org.jabref.gui.maintable.OpenFolderAction.lambda$execute$0(Unknown Source) at java.base/java.lang.Iterable.forEach(Unknown Source) at org.jabref/org.jabref.gui.maintable.OpenFolderAction.lambda$execute$1(Unknown Source) at java.base/java.util.Optional.ifPresent(Unknown Source) at org.jabref/org.jabref.gui.maintable.OpenFolderAction.execute(Unknown Source) at org.jabref/org.jabref.gui.actions.JabRefAction.lambda$new$2(Unknown Source) at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.control.MenuItem.fire(Unknown Source) at org.jabref.merged.module/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source) at org.jabref.merged.module/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene$MouseHandler.process(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene.processMouseEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.handleMouseEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.notifyMouse(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)
Siedlerchr commented 4 years ago

This error should be gone in the latest master (currently building, should be ready in approx half an hour)