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

Fix right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected #8821

Merged
merged 3 commits into from
May 22, 2022

Conversation

LIM0000
Copy link
Contributor

@LIM0000 LIM0000 commented May 18, 2022

Previous discussion about right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected #8012

Big thank you to @ThiloteE and @Siedlerchr for all the provided information in #8012 that help me to find the root of this issue.

Root of issue #8012

  1. We have a entry with only author and groups as fields.
    111
  2. When we right click on group 111 and click on "Remove selected entries from this group", this entry will be deleted and still stay in previousEntry and outOfFocusBound variables.
  3. However, previousEntry or outOfFocusBound only have author as field after "Remove selected entries from this group".
    111
  4. In the image below, we are iterating through all fields in newEntry which has keys author and groups.
    222
  5. Since outOfFocusBound does not have groups field, assigning value to a null result in error.
    222

Proposed solution

Fixes #8012
Add a validation before setting value to a field.

if (outOfFocusEntry.getField(fieldName).isPresent()) {
            outOfFocusEntry.setField(fieldName, newValue);
}
  • 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.

@Siedlerchr
Copy link
Member

Partly fixed, I can still trigger and Index out of Bounds exception by removing the last entry of the group
, but this is related to the main table listener


java.lang.IndexOutOfBoundsException: [ fromIndex: 0, toIndex: 2, size: 1 ]
	at javafx.controls@18/com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList.subList(ReadOnlyUnbackedObservableList.java:171)
	at javafx.base@18/javafx.collections.ListChangeListener$Change.getAddedSubList(ListChangeListener.java:243)
	at javafx.controls@18/com.sun.javafx.scene.control.behavior.TableViewBehaviorBase.lambda$new$1(TableViewBehaviorBase.java:92)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.controls@18/com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList.callObservers(ReadOnlyUnbackedObservableList.java:110)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.fireCustomSelectedCellsListChangeEvent(TableView.java:3033)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.transformation.SortedList.sourceChanged(SortedList.java:111)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:162)
	at java.base/java.util.AbstractList.add(AbstractList.java:111)
	at javafx.controls@18/com.sun.javafx.scene.control.SelectedCellsMap.add(SelectedCellsMap.java:118)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.select(TableView.java:2509)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.updateDefaultSelection(TableView.java:2993)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.lambda$new$2(TableView.java:2181)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:524)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.transformation.SortedList.sourceChanged(SortedList.java:111)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.transformation.FilteredList.sourceChanged(FilteredList.java:147)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:485)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at com.tobiasdiez.easybind@2.2/com.tobiasdiez.easybind.MappedBackedList.sourceChanged(MappedBackedList.java:69)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at org.jabref@100.0.0/org.jabref.gui.util.UiThreadList.sourceChanged(UiThreadList.java:23)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.FXCollections$UnmodifiableObservableListImpl.lambda$new$0(FXCollections.java:963)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.FXCollections$SynchronizedObservableList.lambda$new$0(FXCollections.java:1217)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:485)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/com.sun.javafx.collections.ObservableListWrapper.access$200(ObservableListWrapper.java:45)
	at javafx.base@18/com.sun.javafx.collections.ObservableListWrapper$1$1.invalidated(ObservableListWrapper.java:75)
	at javafx.base@18/com.sun.javafx.collections.MapListenerHelper$Generic.fireValueChangedEvent(MapListenerHelper.java:320)
	at javafx.base@18/com.sun.javafx.collections.MapListenerHelper.fireValueChangedEvent(MapListenerHelper.java:72)
	at javafx.base@18/com.sun.javafx.collections.ObservableMapWrapper.callObservers(ObservableMapWrapper.java:115)
	at javafx.base@18/com.sun.javafx.collections.ObservableMapWrapper.put(ObservableMapWrapper.java:169)
	at org.jabref@100.0.0/org.jabref.model.entry.BibEntry.setField(BibEntry.java:561)
	at org.jabref@100.0.0/org.jabref.model.entry.BibEntry.setField(BibEntry.java:579)
	at org.jabref@100.0.0/org.jabref.gui.entryeditor.SourceTab.storeSource(SourceTab.java:310)
	at org.jabref@100.0.0/org.jabref.gui.entryeditor.SourceTab.bindToEntry(SourceTab.java:239)
	at org.jabref@100.0.0/org.jabref.gui.entryeditor.EntryEditorTab.notifyAboutFocus(EntryEditorTab.java:42)
	at org.jabref@100.0.0/org.jabref.gui.entryeditor.EntryEditor.setEntry(EntryEditor.java:342)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at org.jabref@100.0.0/org.jabref.gui.LibraryTab.lambda$createMainTable$15(LibraryTab.java:492)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.controls@18/com.sun.javafx.scene.control.SelectedItemsReadOnlyObservableList.lambda$new$0(SelectedItemsReadOnlyObservableList.java:91)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.controls@18/com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList._endChange(ReadOnlyUnbackedObservableList.java:64)
	at javafx.controls@18/javafx.scene.control.MultipleSelectionModelBase$SelectedIndicesList._endChange(MultipleSelectionModelBase.java:918)
	at javafx.controls@18/javafx.scene.control.ControlUtils.updateSelectedIndices(ControlUtils.java:208)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.fireCustomSelectedCellsListChangeEvent(TableView.java:3027)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.transformation.SortedList.sourceChanged(SortedList.java:111)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:162)
	at java.base/java.util.AbstractList.add(AbstractList.java:111)
	at javafx.controls@18/com.sun.javafx.scene.control.SelectedCellsMap.add(SelectedCellsMap.java:118)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.select(TableView.java:2509)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.select(TableView.java:2485)
	at javafx.controls@18/javafx.scene.control.MultipleSelectionModelBase.shiftSelection(MultipleSelectionModelBase.java:250)
	at javafx.controls@18/javafx.scene.control.MultipleSelectionModelBase.shiftSelection(MultipleSelectionModelBase.java:196)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.updateSelection(TableView.java:2353)
	at javafx.controls@18/javafx.scene.control.TableView$TableViewArrayListSelectionModel.lambda$new$2(TableView.java:2214)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.transformation.SortedList.sourceChanged(SortedList.java:111)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.transformation.FilteredList.sourceChanged(FilteredList.java:147)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:485)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at com.tobiasdiez.easybind@2.2/com.tobiasdiez.easybind.MappedBackedList.sourceChanged(MappedBackedList.java:69)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at org.jabref@100.0.0/org.jabref.gui.util.UiThreadList.sourceChanged(UiThreadList.java:23)
	at javafx.base@18/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.FXCollections$UnmodifiableObservableListImpl.lambda$new$0(FXCollections.java:963)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.FXCollections$SynchronizedObservableList.lambda$new$0(FXCollections.java:1217)
	at javafx.base@18/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:485)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/com.sun.javafx.collections.ObservableListWrapper.access$200(ObservableListWrapper.java:45)
	at javafx.base@18/com.sun.javafx.collections.ObservableListWrapper$1$1.invalidated(ObservableListWrapper.java:75)
	at javafx.base@18/com.sun.javafx.collections.MapListenerHelper$Generic.fireValueChangedEvent(MapListenerHelper.java:320)
	at javafx.base@18/com.sun.javafx.collections.MapListenerHelper.fireValueChangedEvent(MapListenerHelper.java:72)
	at javafx.base@18/com.sun.javafx.collections.ObservableMapWrapper.callObservers(ObservableMapWrapper.java:115)
	at javafx.base@18/com.sun.javafx.collections.ObservableMapWrapper.put(ObservableMapWrapper.java:169)
	at org.jabref@100.0.0/org.jabref.model.entry.BibEntry.setField(BibEntry.java:561)
	at org.jabref@100.0.0/org.jabref.model.entry.BibEntry.setField(BibEntry.java:579)
	at org.jabref@100.0.0/org.jabref.model.groups.WordKeywordGroup.remove(WordKeywordGroup.java:94)
	at org.jabref@100.0.0/org.jabref.model.groups.GroupTreeNode.removeEntriesFromGroup(GroupTreeNode.java:303)
	at org.jabref@100.0.0/org.jabref.gui.groups.GroupTreeViewModel.removeSelectedEntries(GroupTreeViewModel.java:355)
	at org.jabref@100.0.0/org.jabref.gui.groups.GroupTreeView.lambda$createContextMenuForGroup$29(GroupTreeView.java:435)
	at javafx.base@18/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@18/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@18/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.base@18/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.controls@18/javafx.scene.control.MenuItem.fire(MenuItem.java:459)
	at javafx.controls@18/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1385)
	at javafx.controls@18/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1338)
	at javafx.base@18/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at javafx.base@18/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at javafx.base@18/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@18/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@18/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.base@18/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics@18/javafx.scene.Scene$MouseHandler.process(Scene.java:3881)
	at javafx.graphics@18/javafx.scene.Scene.processMouseEvent(Scene.java:1874)
	at javafx.graphics@18/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2607)
	at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at javafx.graphics@18/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at javafx.graphics@18/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at javafx.graphics@18/com.sun.glass.ui.View.notifyMouse(View.java:937)
	at javafx.graphics@18/com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127)

@ThiloteE
Copy link
Member

ThiloteE commented May 18, 2022

I just did a few tests with this PR (see #8826) and it seems to work better than Jabref 5.6 stable.

There are still other errors and index out of bounds, but at least one of them is gone :-)
On first glance this PR here does not seem to break anything that was not already broken. Ready for review, unless you want to add something to this PR (e.g. fixing the other issues as well) :-)

@LIM0000
Copy link
Contributor Author

LIM0000 commented May 18, 2022

Thank you for your feedback @Siedlerchr.
I could not reproduce issue that you have mentioned:

trigger and Index out of Bounds exception by removing the last entry of the group

Could you please include steps to reproduce the issue?

Additional information:

I have tested #8826 with this PR but could not reproduce the issue (in Window 10). Would these issues dependent on operating system?

@ThiloteE
Copy link
Member

ThiloteE commented May 19, 2022

Here a test of this pr and the related issue about renaming groups (#8826) in the entry-editor general tab using Linux Mint.

Bildschirmaufnahme2022-05-19_12_46_47handbrake.mp4

Edit: It does not really show in the video, but all I did was to press the return key on my keyboard, which would have renamed test to tes.

Edit2: But I would say that what is shown in this video does not really block this PR from merging, because I can trigger errors when trying to do this also in JabRef 5.6 stable.

@LIM0000
Copy link
Contributor Author

LIM0000 commented May 19, 2022

Thank you @ThiloteE. My guesses to issue #8826 are:

  1. OS dependent
  2. Other fields or preferences trigger the issue

Still unable to reproduce the issue after watching your video. I will keep an eye on #8826 if there are more information.
Thanks again!

@LIM0000 LIM0000 marked this pull request as ready for review May 19, 2022 23:32
@Siedlerchr
Copy link
Member

As the original exception/error is fixed I would vote to merge this.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 21, 2022
@Siedlerchr
Copy link
Member

Can you please add a changelog entry?

@LIM0000
Copy link
Contributor Author

LIM0000 commented May 22, 2022

Hi @Siedlerchr, I have updated CHANGELOG.md file.
Cheers.

@Siedlerchr Siedlerchr merged commit 7257350 into JabRef:main May 22, 2022
Siedlerchr added a commit to Christina0114/jabref that referenced this pull request May 22, 2022
* upstream/main: (109 commits)
  Fix right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected (JabRef#8821)
  Fix single identifier cannot be opened on click (JabRef#8838)
  Add Pubmed/Medline Query Transformer (JabRef#8818)
  adjust and add testcases for FileAnnotationViewModel (JabRef#8830)
  Append config instead of replacing (JabRef#8834)
  Fix eclipse config (JabRef#8835)
  Add Nemo file manager (JabRef#8831)
  Fix missing clear action on pressing esc within the "Filter groups" field (JabRef#8829)
  Update bouncycalse to new base version (JabRef#8827)
  add: add test cases for FileUtil (JabRef#8810)
  Restrict use of standard streams (JabRef#8816)
  updated 8802 (JabRef#8817)
  Bump pascalgn/automerge-action from 0.15.2 to 0.15.3 (JabRef#8803)
  Bump jackson-dataformat-yaml from 2.13.2 to 2.13.3 (JabRef#8804)
  Bump icu4j-charset from 70.1 to 71.1 (JabRef#8805)
  Fix notifications that overlap task bar (JabRef#8775)
  checkstye
  Default path for ssl key store is nested inside "JabRef" directory (JabRef#8796)
  Add log on disk (JabRef#8791)
  Fix for JabRef#8788 JabRef not showing contents of shared database library (JabRef#8793)
  ...
Siedlerchr added a commit to josepylee/jabref that referenced this pull request May 22, 2022
* upstream/main:
  Fix right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected (JabRef#8821)
  Fix single identifier cannot be opened on click (JabRef#8838)
  Add Pubmed/Medline Query Transformer (JabRef#8818)
  adjust and add testcases for FileAnnotationViewModel (JabRef#8830)
  Append config instead of replacing (JabRef#8834)
  Fix eclipse config (JabRef#8835)
  Add Nemo file manager (JabRef#8831)
  Fix missing clear action on pressing esc within the "Filter groups" field (JabRef#8829)
Siedlerchr added a commit to fly-ing-fish/jabref that referenced this pull request May 22, 2022
…-masked-characters#8787

* upstream/main:
  Add: Add test cases for non-default styles in CitationStyleTest (JabRef#8828)
  Open event log when clicking on collapsed notification (JabRef#8837)
  Fix right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected (JabRef#8821)
  Fix single identifier cannot be opened on click (JabRef#8838)
  Add Pubmed/Medline Query Transformer (JabRef#8818)
  adjust and add testcases for FileAnnotationViewModel (JabRef#8830)
  Append config instead of replacing (JabRef#8834)
  Fix eclipse config (JabRef#8835)
  Add Nemo file manager (JabRef#8831)
  Fix missing clear action on pressing esc within the "Filter groups" field (JabRef#8829)
  Update bouncycalse to new base version (JabRef#8827)
  add: add test cases for FileUtil (JabRef#8810)
  Restrict use of standard streams (JabRef#8816)
koppor added a commit that referenced this pull request Jun 6, 2022
…ies from this group" leads to error when Bibtex source tab is selected (#8821)"

This reverts commit 7257350.
@koppor
Copy link
Member

koppor commented Jun 6, 2022

Reverted at 6fd3be5 due to request at #8859 (comment)

@koppor
Copy link
Member

koppor commented Jun 6, 2022

Changelog reverted at 5fe375d

Siedlerchr added a commit that referenced this pull request Jun 6, 2022
* upstream/main:
  Remove obsolte CHANGELOG.md entry
  Revert "Fix right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected (#8821)"
  test linux terminal (#8890)
Siedlerchr added a commit that referenced this pull request Jun 23, 2022
* upstream/main: (27 commits)
  Add gitpod config (#8921)
  Fix javafx version not displayed in About Dialog (#8918)
  Redesign "Manage field names & content" dialog (#8892)
  Rework IACR fetcher (#8904)
  Bump h2-mvstore from 2.1.212 to 2.1.214 in /buildSrc (#8915)
  Bump unoloader from 7.3.3 to 7.3.4 (#8912)
  Bump libreoffice from 7.3.3 to 7.3.4 (#8913)
  Bump tika-core from 2.4.0 to 2.4.1 (#8914)
  Bump org.eclipse.jgit from 6.1.0.202203080745-r to 6.2.0.202206071550-r (#8916)
  Squashed 'buildres/csl/csl-styles/' changes from e740261..845dee0 (#8903)
  Bump flowless from 0.6.9 to 0.6.10 (#8898)
  Bump postgresql from 42.3.5 to 42.4.0 (#8900)
  Bump mockito-core from 4.6.0 to 4.6.1 (#8899)
  Bump antlr-runtime from 3.5.2 to 3.5.3 (#8897)
  Update to MADR 3.0.0-beta.2 (#8896)
  Increase the network connection timeout and improve error message (#8894)
  Fix linux terminal opening process error (#8891)
  Fix exception if linked file has masked umlauts / invalid characters in path (#8851)
  Remove obsolte CHANGELOG.md entry
  Revert "Fix right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected (#8821)"
  ...

# Conflicts:
#	build.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entry-editor groups status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
4 participants