-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
jfx17
-
x86_64
-
os_x
A DESCRIPTION OF THE PROBLEM :
After having created a new instance of ListView I've added a change listener to the items property.
If, then, I call ListView.setItems() passing a non-empty list, then the listener is invoked.
If, instead, I call ListView.setItems() passing an empty list, the listener is not invoked. I think this is an error because the new list is a different instance than the original one in the ListView. For me this is a problem because the (not) called listener should add/update a ListChangeListener to the ListView's items list.
I've tracked the problem being in the ExpressionHelper.fireValueChangedEvent methods where "changed" is false because "currentValue.equals(oldValue)" return true.
"items" is an ObjectProperty whose value is an ObservableList, not its content. So a different ObservableList instance with the same content should be considered different.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a new ListView.
2. Add a change listener to the items property.
3. Call ListView.setItems(...) passing a newly created, empty ObservableList.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The change listener being invoked.
ACTUAL -
The change listener is not invoked.
FREQUENCY : always
After having created a new instance of ListView I've added a change listener to the items property.
If, then, I call ListView.setItems() passing a non-empty list, then the listener is invoked.
If, instead, I call ListView.setItems() passing an empty list, the listener is not invoked. I think this is an error because the new list is a different instance than the original one in the ListView. For me this is a problem because the (not) called listener should add/update a ListChangeListener to the ListView's items list.
I've tracked the problem being in the ExpressionHelper.fireValueChangedEvent methods where "changed" is false because "currentValue.equals(oldValue)" return true.
"items" is an ObjectProperty whose value is an ObservableList, not its content. So a different ObservableList instance with the same content should be considered different.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a new ListView.
2. Add a change listener to the items property.
3. Call ListView.setItems(...) passing a newly created, empty ObservableList.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The change listener being invoked.
ACTUAL -
The change listener is not invoked.
FREQUENCY : always
- relates to
-
JDK-8334429 ObservableValue docs wrongly state that reference equality is used to detect and report changes
- Open