jmix-projects / jmix-ui

DEPRECATED. Use https://github.com/jmix-framework/jmix
https://www.jmix.io
3 stars 7 forks source link

UnsupportedOperationException is thrown while removing value in ValuesPicker using clear action #756

Closed Flaurite closed 2 years ago

Flaurite commented 2 years ago

Description

  1. Download demo project: demo.zip
  2. Open Application -> UserGroup
  3. Try to edit record
  4. In the editor click on clear button in ValuesPicker (sometimes it needs to repeat steps to reproduce the issue)

AR

java.lang.UnsupportedOperationException
    at java.util.AbstractCollection.add(AbstractCollection.java:262)
    at io.jmix.ui.model.impl.DataContextImpl.mergeSet(DataContextImpl.java:466)
    at io.jmix.ui.model.impl.DataContextImpl.mergeState(DataContextImpl.java:309)
    at io.jmix.ui.model.impl.DataContextImpl.internalMerge(DataContextImpl.java:236)
    at io.jmix.ui.model.impl.DataContextImpl.mergeState(DataContextImpl.java:315)
    at io.jmix.ui.model.impl.DataContextImpl.internalMerge(DataContextImpl.java:236)
    at io.jmix.ui.model.impl.DataContextImpl.merge(DataContextImpl.java:157)
    at io.jmix.ui.model.impl.DataContextImpl.merge(DataContextImpl.java:166)
    at io.jmix.ui.component.data.value.ContainerValueSource.updateMasterRefs(ContainerValueSource.java:287)
    at io.jmix.ui.component.data.value.ContainerValueSource.setValue(ContainerValueSource.java:168)
    at io.jmix.ui.component.data.value.ValueBinder$ValueBindingImpl.setValueToSource(ValueBinder.java:316)
    at io.jmix.ui.component.data.value.ValueBinder$ValueBindingImpl.componentValueChanged(ValueBinder.java:309)
    at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)
    at io.jmix.ui.component.impl.AbstractComponent.publish(AbstractComponent.java:85)
    at io.jmix.ui.component.impl.ValuesPickerImpl.fireValueChange(ValuesPickerImpl.java:115)
    at io.jmix.ui.component.impl.ValuesPickerImpl.setValueInternal(ValuesPickerImpl.java:53)
    at io.jmix.ui.component.impl.ValuesPickerImpl.setValueFromUser(ValuesPickerImpl.java:40)
    at io.jmix.ui.component.impl.ValuesPickerImpl.setValueFromUser(ValuesPickerImpl.java:27)
    at io.jmix.ui.action.valuepicker.ValueClearAction.execute(ValueClearAction.java:138)
    at io.jmix.ui.action.valuepicker.ValueClearAction.actionPerform(ValueClearAction.java:124)
    at io.jmix.ui.component.impl.ValuePickerImpl.lambda$setupButtonAction$0(ValuePickerImpl.java:231)
    at io.jmix.ui.widget.JmixButton.fireClick(JmixButton.java:77)
Flaurite commented 2 years ago

Cannot reproduce after fixes in: https://github.com/Haulmont/jmix-data/issues/102