Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344571

Summary: [xbase] allow collection.addAll(iterable)
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: RC1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Moritz Eysholdt CLA 2011-05-03 09:45:40 EDT
It would be nice to have a 

CollectionExtensions.addAll(Collection<? super T>, Iterable<? super T>)

to allow code such as

foo() {
  val r = <String>newArrayList();
  r.addAll(newArrayList(newArrayList("foo")).flatten);
  r;
}
Comment 1 Sebastian Zarnekow CLA 2011-05-03 09:50:15 EDT
see google.collect.Iterables#addAll(..)

Current workaround: import Iterables as static extension.
Comment 2 Sebastian Zarnekow CLA 2011-05-04 06:05:12 EDT
I'll add CollectionExtensions#addAll and change CollectionExtension#operator_add to take an iterable instead of a collection as the second arg.
Comment 3 Sebastian Zarnekow CLA 2011-05-04 06:52:18 EDT
pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 17:14:45 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:26:20 EDT
Closing all bugs that were set to RESOLVED before Neon.0