Bug 509234 - ListenerList should override Iterable#spliterator() and implement #stream() and #parallelStream()
Summary: ListenerList should override Iterable#spliterator() and implement #stream() a...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Components (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: Oxygen M5   Edit
Assignee: equinox.components-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks: 509410 510330
  Show dependency tree
 
Reported: 2016-12-14 10:59 EST by Mikaël Barbero CLA
Modified: 2017-01-12 05:37 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikaël Barbero CLA 2016-12-14 10:59:39 EST
Currently, ListenerList uses the default implementation of spliterator from Iterable. It knows nothing about the underlying structure and is thus non optimal. It's better to use Arrays.spliterator on the array of listeners. 

It is also an opportunity to implement #stream and #parallelStream() as it is in java.util.Collection

Patch to come.
Comment 1 Mikaël Barbero CLA 2016-12-14 11:00:53 EST
Adding platform-runtime in cc as ListenerList is in org.eclipse.core.runtime package.
Comment 2 Eclipse Genie CLA 2016-12-14 11:15:28 EST
New Gerrit change created: https://git.eclipse.org/r/87144
Comment 3 Eclipse Genie CLA 2016-12-15 06:39:21 EST
New Gerrit change created: https://git.eclipse.org/r/87218
Comment 4 Mikaël Barbero CLA 2016-12-15 06:43:07 EST
I did not notice first that it would force some plugins to move JavaSE-8 as BREE (equinox.preferences, core.jobs and core.runtime). If this is not desired, let's just abandon this change.
Comment 5 Andrey Loskutov CLA 2016-12-15 09:54:57 EST
(In reply to Mikaël Barbero from comment #4)
> I did not notice first that it would force some plugins to move JavaSE-8 as
> BREE (equinox.preferences, core.jobs and core.runtime). If this is not
> desired, let's just abandon this change.

I'm personally not aware about any reason why shouldn't we bump the version of the two bundles if it is required by the code, in M5 it should be OK. 

I've asked Stefan and Sergey on the patch if they have any objections, but let ask Markus and Dani if they have some.
Comment 7 Thomas Watson CLA 2017-01-03 09:03:13 EST
(In reply to Mikaël Barbero from comment #4)
> I did not notice first that it would force some plugins to move JavaSE-8 as
> BREE (equinox.preferences, core.jobs and core.runtime). If this is not
> desired, let's just abandon this change.

Why do these need to be moved to Java 8?  I am not opposed to moving these up, but not sure why it is required.
Comment 9 Markus Keller CLA 2017-01-11 14:24:16 EST
(In reply to Thomas Watson from comment #7)
> Why do these need to be moved to Java 8?  I am not opposed to moving these
> up, but not sure why it is required.

https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg14052.html explains that the exposed 1.8 types in ListenerList's API now create compile errors like this in client code: "The type java.util.stream.Stream cannot be resolved. It is indirectly referenced from required .class files".

Ant was another victim of this. Fixed with bug 509410.
Comment 10 Markus Keller CLA 2017-01-11 14:36:32 EST
Just a general statement about forcing dependent plug-ins to move their BREE by exposing new types in the API:

We usually try to avoid such source-incompatible changes if reasonably possible. However, since 1.7 has been out of service for quite a while now, the change is not a big deal if it's properly announced.

Mikael, could you please add an N&N entry with the information from your mailing list message to https://www.eclipse.org/eclipse/news/4.7/M5/#Platform-Dev ?
Comment 11 Eclipse Genie CLA 2017-01-12 03:32:57 EST
New Gerrit change created: https://git.eclipse.org/r/88539
Comment 12 Mikaël Barbero CLA 2017-01-12 03:33:35 EST
(In reply to Markus Keller from comment #10)
> Mikael, could you please add an N&N entry with the information from your
> mailing list message to
> https://www.eclipse.org/eclipse/news/4.7/M5/#Platform-Dev ?

Done: https://git.eclipse.org/r/88539