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

Channel editor malfunctions when making changes while a filter is active #1653

Closed
raineth opened this issue Sep 20, 2023 · 0 comments · Fixed by #1699
Closed

Channel editor malfunctions when making changes while a filter is active #1653

raineth opened this issue Sep 20, 2023 · 0 comments · Fixed by #1699
Assignees
Labels
Milestone

Comments

@raineth
Copy link

raineth commented Sep 20, 2023

sdrtrunk Version
v0.6.0-beta-2

Describe the bug
In the channel editor, if I have a filter active and I then change a channel entry so that it no longer matches the filter, the channel dialog enters a broken state until restart.

In the broken state, changing the filter parameters (either the search box or switching 'view channels' between all/playing/auto-start)
generally has no effect (except for logging the exception below). I have had a few instances where clearing the filter box appeared to repopulate the full channel list, but no scroll bar appeared and it was not possible to scroll entries with the keyboard beyond the number of entries that were in the list while filtered (i.e. if the filter had 5 matches, I can't scroll more than 5 rows down even if there are more entries in the list).

To Reproduce
This seems to be a little fiddly to reproduce so I spent some time working out a reliable repro case with a minimal channel list.

Steps to reproduce the behavior:

  1. Open or manually create the following playlist. Only the channel names are important.
<playlist version="4">
<channel order="1" enabled="false" name="foo bar">
  <source_configuration type="sourceConfigTuner" frequency="42000000" source_type="TUNER"/>
  <event_log_configuration/>
  <aux_decode_configuration/>
  <decode_configuration type="decodeConfigDMR" use_compressed_talkgroups="false" traffic_channel_pool_size="3" ignore_crc="false" ignore_data_calls="true"/>
  <record_configuration/>
  <alias_list_name></alias_list_name>
</channel>
<channel order="1" enabled="false" name="foo bar baz">
  <source_configuration type="sourceConfigTuner" frequency="42000000" source_type="TUNER"/>
  <event_log_configuration/>
  <aux_decode_configuration/>
  <decode_configuration type="decodeConfigDMR" use_compressed_talkgroups="false" traffic_channel_pool_size="3" ignore_crc="false" ignore_data_calls="true"/>
  <record_configuration/>
  <alias_list_name></alias_list_name>
</channel>
<channel order="1" enabled="false" name="foo bar zazz">
  <source_configuration type="sourceConfigTuner" frequency="42000000" source_type="TUNER"/>
  <event_log_configuration/>
  <aux_decode_configuration/>
  <decode_configuration type="decodeConfigDMR" use_compressed_talkgroups="false" traffic_channel_pool_size="3" ignore_crc="false" ignore_data_calls="true"/>
  <record_configuration/>
  <alias_list_name></alias_list_name>
</channel>
</playlist>
  1. Switch to the channels tab
  2. Enter "bar" in the search box
  3. Select the middle "foo bar baz" entry.
  4. Change the name to something that doesn't match the filter, e.g. "foo car baz"
  5. Save changes. At this point, both "foo bar baz" and "foo bar zazz" disappear from the list for me, but no exception is thrown until I change the search box.
  6. Click the 'x' in the search box to clear the search text. An exception is thrown and the channel list is now in a broken state until sdrtrunk is restarted.

Expected behavior
Only the entry that no longer matches the search string should be removed from the visible list, and the channel list should repopulate appropriately when the search string is cleared.

Application Log

2023-09-20 13:21:59.051 INFO  i.g.dsheirer.gui.SDRTrunk - starting main application gui  [27MB/38MB 71%]
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: arraycopy: length -1 is negative
        at java.base/java.lang.System.arraycopy(Native Method)
        at javafx.base/javafx.collections.transformation.SortedList.updateUnsorted(Unknown Source)
        at javafx.base/javafx.collections.transformation.SortedList.sourceChanged(Unknown Source)
        at javafx.base/javafx.collections.transformation.TransformationList.lambda$getListener$0(Unknown Source)
        at javafx.base/javafx.collections.WeakListChangeListener.onChanged(Unknown Source)
        at javafx.base/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(Unknown Source)
        at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
        at javafx.base/javafx.collections.ObservableListBase.fireChange(Unknown Source)
        at javafx.base/javafx.collections.transformation.FilteredList.refilter(Unknown Source)
        at javafx.base/javafx.collections.transformation.FilteredList$1.invalidated(Unknown Source)
        at javafx.base/javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
        at javafx.base/javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
        at javafx.base/javafx.collections.transformation.FilteredList.setPredicate(Unknown Source)
        at io.github.dsheirer.gui.playlist.channel.ChannelEditor.updateChannelListFilter(ChannelEditor.java:373)
        at io.github.dsheirer.gui.playlist.channel.ChannelEditor.lambda$getSearchField$3(ChannelEditor.java:347)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.fireValueChangedEvent(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.markInvalid(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.controlContentHasChanged(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.lambda$new$0(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
        at javafx.controls/javafx.scene.control.TextField$TextFieldContent.delete(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.replaceText(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.filterAndSet(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.doSet(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.setText(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.clear(Unknown Source)
        at org.controlsfx.control.textfield.TextFields.lambda$setupClearButtonField$0(TextFields.java:100)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.base/javafx.event.Event.fireEvent(Unknown Source)
        at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at javafx.graphics/javafx.scene.Scene.processMouseEvent(Unknown Source)
        at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: arraycopy: length -2 is negative
        at java.base/java.lang.System.arraycopy(Native Method)
        at javafx.base/javafx.collections.transformation.SortedList.updateUnsorted(Unknown Source)
        at javafx.base/javafx.collections.transformation.SortedList.sourceChanged(Unknown Source)
        at javafx.base/javafx.collections.transformation.TransformationList.lambda$getListener$0(Unknown Source)
        at javafx.base/javafx.collections.WeakListChangeListener.onChanged(Unknown Source)
        at javafx.base/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(Unknown Source)
        at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(Unknown Source)
        at javafx.base/javafx.collections.ObservableListBase.fireChange(Unknown Source)
        at javafx.base/javafx.collections.transformation.FilteredList.refilter(Unknown Source)
        at javafx.base/javafx.collections.transformation.FilteredList$1.invalidated(Unknown Source)
        at javafx.base/javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
        at javafx.base/javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
        at javafx.base/javafx.collections.transformation.FilteredList.setPredicate(Unknown Source)
        at io.github.dsheirer.gui.playlist.channel.ChannelEditor.updateChannelListFilter(ChannelEditor.java:374)
        at io.github.dsheirer.gui.playlist.channel.ChannelEditor.lambda$getSearchField$3(ChannelEditor.java:347)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.fireValueChangedEvent(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.markInvalid(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.controlContentHasChanged(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.lambda$new$0(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
        at javafx.controls/javafx.scene.control.TextField$TextFieldContent.delete(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.replaceText(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.filterAndSet(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.doSet(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.setText(Unknown Source)
        at javafx.controls/javafx.scene.control.TextInputControl.clear(Unknown Source)
        at org.controlsfx.control.textfield.TextFields.lambda$setupClearButtonField$0(TextFields.java:100)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.base/javafx.event.Event.fireEvent(Unknown Source)
        at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at javafx.graphics/javafx.scene.Scene.processMouseEvent(Unknown Source)
        at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

Desktop (optional - complete the following information):

  • OS: Windows 10, using bundled JRE
@raineth raineth added the bug label Sep 20, 2023
@DSheirer DSheirer self-assigned this Nov 5, 2023
@DSheirer DSheirer added this to the Build 0.6.0 milestone Nov 5, 2023
DSheirer added a commit that referenced this issue Nov 5, 2023
#1653 Playlist Channel Edits With Applied Filter Produces Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants