jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Uncaught java.lang.NullPointerException

Open ryan-carpenter opened this issue 1 year ago • 2 comments

JabRef version

Latest development branch build (please note build date below)

Operating system

GNU / Linux

Details on version and operating system

openSUSE Tumbleweed with KDE Plasma 6.0.5

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

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

Steps to reproduce the behaviour

  1. Select a search group
  2. Drag an entry to another group that excludes the entry from the search group
  3. Select another group => Uncaught exception

Possibly related to https://github.com/JabRef/jabref/issues/11628

JabRef 5.16--2024-08-13--1374813 Linux 6.9.9-1-default amd64 Java 21.0.2 JavaFX 22.0.2+4

Appendix

...

Log File
java.lang.NullPointerException
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
	at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.toList(Unknown Source)
	at [email protected]/org.jabref.gui.LibraryTab.lambda$createMainTable$12(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.fireChange(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.commit(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.endChange(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.endChange(Unknown Source)
	at [email protected]/com.sun.javafx.scene.control.SelectedItemsReadOnlyObservableList.lambda$new$0(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.fireChange(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.commit(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.endChange(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.endChange(Unknown Source)
	at [email protected]/com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList._endChange(Unknown Source)
	at [email protected]/javafx.scene.control.MultipleSelectionModelBase$SelectedIndicesList._endChange(Unknown Source)
	at [email protected]/javafx.scene.control.ControlUtils.updateSelectedIndices(Unknown Source)
	at [email protected]/javafx.scene.control.TableView$TableViewArrayListSelectionModel.fireCustomSelectedCellsListChangeEvent(Unknown Source)
	at [email protected]/javafx.scene.control.TableView$TableViewArrayListSelectionModel.lambda$new$0(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.fireChange(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.commit(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.endChange(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.endChange(Unknown Source)
	at [email protected]/javafx.collections.transformation.SortedList.sourceChanged(Unknown Source)
	at [email protected]/javafx.collections.transformation.TransformationList.lambda$getListener$0(Unknown Source)
	at [email protected]/javafx.collections.WeakListChangeListener.onChanged(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.fireChange(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.commit(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.endChange(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.endChange(Unknown Source)
	at [email protected]/javafx.collections.ModifiableObservableListBase.add(Unknown Source)
	at java.base/java.util.AbstractList.add(Unknown Source)
	at [email protected]/com.sun.javafx.scene.control.SelectedCellsMap.add(Unknown Source)
	at [email protected]/javafx.scene.control.TableView$TableViewArrayListSelectionModel.select(Unknown Source)
	at [email protected]/javafx.scene.control.TableView$TableViewArrayListSelectionModel.select(Unknown Source)
	at [email protected]/javafx.scene.control.MultipleSelectionModelBase.shiftSelection(Unknown Source)
	at [email protected]/javafx.scene.control.MultipleSelectionModelBase.shiftSelection(Unknown Source)
	at [email protected]/javafx.scene.control.TableView$TableViewArrayListSelectionModel.updateSelection(Unknown Source)
	at [email protected]/javafx.scene.control.TableView$TableViewArrayListSelectionModel.lambda$new$2(Unknown Source)
	at [email protected]/javafx.collections.WeakListChangeListener.onChanged(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.fireChange(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.commit(Unknown Source)
	at [email protected]/javafx.collections.ListChangeBuilder.endChange(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.endChange(Unknown Source)
	at [email protected]/javafx.collections.transformation.SortedList.sourceChanged(Unknown Source)
	at [email protected]/javafx.collections.transformation.TransformationList.lambda$getListener$0(Unknown Source)
	at [email protected]/javafx.collections.WeakListChangeListener.onChanged(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
	at [email protected]/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
	at [email protected]/javafx.collections.ObservableListBase.fireChange(Unknown Source)
	at [email protected]/javafx.collections.transformation.FilteredList.refilter(Unknown Source)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at [email protected]/org.jabref.gui.util.FilteredListProxy.refilterListReflection(Unknown Source)
	at [email protected]/org.jabref.gui.maintable.MainTableDataModel.lambda$updateGroupMatches$18(Unknown Source)
	at [email protected]/org.jabref.gui.util.UiTaskExecutor.lambda$getJavaFXTask$3(Unknown Source)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
	at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
	at [email protected]/javafx.concurrent.EventHelper.fireEvent(Unknown Source)
	at [email protected]/javafx.concurrent.Task.fireEvent(Unknown Source)
	at [email protected]/javafx.concurrent.Task.setState(Unknown Source)
	at [email protected]/javafx.concurrent.Task$TaskCallable.lambda$call$1(Unknown Source)
	at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
	at [email protected]/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$10(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

ryan-carpenter avatar Aug 19 '24 23:08 ryan-carpenter

I can't reproduce the issue.

I have the following library:

@Article{,
  title = {e1},
}

@Article{,
  title  = {e2},
  groups = {g1},
}

@Article{,
  title = {e3},
}

@Article{,
  title  = {e4},
  groups = {g2},
}

@Comment{jabref-meta: databaseType:bibtex;}

@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 SearchGroup:Not g1\;1\;groups != g1\;0\;0\;1\;\;\;\;;
1 StaticGroup:g1\;1\;0\;\;\;\;;
1 StaticGroup:g2\;1\;1\;\;\;\;;
}
  • Selected the group "Not g1".
  • Dragged entries into "g1".
  • The entries will either hidden or the background color will change if in the floating mode.
  • Switching to "g1" or "g2" did not cause any exceptions.

LoayGhreeb avatar Aug 21 '24 00:08 LoayGhreeb

I am now on JabRef 5.16--2024-08-26--1620002 and will try to reproduce the exception. There isn't anything in the trace that I can decipher, so here are some details that could be important (guesses).

  • the library contains about 120 user-created groups plus a long list created by JabRef from the keywords field.
  • The groups and search groups associated with the exception were user-created.
  • The search groups include Boolean statements without regular expressions.
  • Group names include non-alphanumeric characters such as : and /, with ; as the separator
  • Most of the groups are nested one level deep.

Here are some examples.

2 StaticGroup::mygroup-001/example\;2\;1\;0xcd5865ff\;\;A static-group description\;;
3 SearchGroup:buyme\;2\;groups=:paywall and file!="" and groups!=/exclude\;0\;0\;1\;0x008000ff\;CURRENCY_USD\;A search-group description\;;

ryan-carpenter avatar Aug 27 '24 17:08 ryan-carpenter

Dev-call: The issue was filed in August 2024, can you try this with the latest dev-version @ryan-carpenter, if this is still valid? In case yes: Someone should pair with @ryan-carpenter to reproduce and triangulate the problem. We need to postpone this to june, since this will take some more thinking.

Refs #13109 about sharing your library with pseydonyms to avoid leaking company information.

calixtus avatar May 12 '25 19:05 calixtus

/assign-me

jenilpatel264 avatar Jun 04 '25 09:06 jenilpatel264

👋 Hey @jenilpatel264, thank you for your interest in this issue! 🎉

We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

For questions on JabRef functionality and the code base, you can consult the JabRef Guru or ask on our Gitter chat.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

github-actions[bot] avatar Jun 04 '25 09:06 github-actions[bot]

Hi team, as per my testing and understanding, I tried to reproduce with more than 50 groups, but there is nothing in the trace. I have some the observations, such as most of the groups are one level deep.

But switching one group to another group won't be given any exception.

jenilpatel264 avatar Jun 04 '25 09:06 jenilpatel264

I haven't done much work lately with grouping, but I don't think this is a problem any more. I'll check and then close the issue.

ryan-carpenter avatar Jun 04 '25 19:06 ryan-carpenter

⏰ Assignment Reminder

Hi @jenilpatel264, this is a friendly reminder about your assignment to this issue.

[!WARNING] This issue will be automatically unassigned in 11 days if there's no activity.

Remember that you can ask the JabRef Guru or DeepWiki about anything regarding JabRef. Additionally, our contributing guide has hints on creating a pull request and a link to our Gitter chat.

How to keep your assignment


If you are working on it, you can prevent automatic unassignment by:

  • Submitting a draft pull request with your progress within 11 days
  • Asking for the 📌 Pinned label if you need more time

We appreciate your contribution and are here to help if needed!

github-actions[bot] avatar Jun 15 '25 12:06 github-actions[bot]

I have not been able to reproduce this with the current environment.

JabRef 100.0.0
Linux 6.15.0-1-default amd64 
Java 24.0.1 
JavaFX 24.0.1+4

ryan-carpenter avatar Jun 17 '25 07:06 ryan-carpenter