Bug 573403 - [databinding] WritableList must overwrite ObservableList.iterator()
Summary: [databinding] WritableList must overwrite ObservableList.iterator()
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.20   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-06 09:35 EDT by Christoph Laeubrich CLA
Modified: 2021-05-06 10:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Laeubrich CLA 2021-05-06 09:35:53 EDT
Currently WritableList do no overwrites

org.eclipse.core.databinding.observable.list.ObservableList.iterator()

this leads to 

java.lang.UnsupportedOperationException
	at org.eclipse.core.databinding.observable.list.ObservableList$1.remove(ObservableList.java:126)

using an iterator to remove elements from the list.
Comment 1 Christoph Laeubrich CLA 2021-05-06 09:50:14 EDT
The same applies to 

org.eclipse.core.databinding.observable.list.ObservableList.listIterator(int)

e.g. a Collections.sort(writeableList) throws 

java.lang.UnsupportedOperationException
	at org.eclipse.core.databinding.observable.list.ObservableList$2.set(ObservableList.java:253)
	at java.base/java.util.List.sort(List.java:510)
	at java.base/java.util.Collections.sort(Collections.java:179)
Comment 2 Eclipse Genie CLA 2021-05-06 10:12:04 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/180303