Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 17635 Details for
Bug 84251
[1.5][compiler] lower bounded wildcard misunderstood
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Complete test case
Test.java (text/plain), 834 bytes, created by
Olivier Thomann
on 2005-02-02 14:12:27 EST
(
hide
)
Description:
Complete test case
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-02-02 14:12:27 EST
Size:
834 bytes
patch
obsolete
>import java.util.ArrayList; >import java.util.Collection; > >interface Sink<T> { > void flush(T t); >} >class SimpleSinkImpl<T> implements Sink<T> { > public void flush(T t) {} >} >public class Test { > > private <T> T writeAll(Collection<T> coll, Sink<? super T> snk) { > T last = null; > for (T t : coll) { > last = t; > snk.flush(last); > } > return last; > } > > public void test1() { > Sink<Object> s = new SimpleSinkImpl<Object>(); > Collection<String> cs = new ArrayList<String>(); > cs.add("hello!"); > cs.add("goodbye"); > cs.add("see you"); > > String str = this.writeAll(cs, s); > } > > public static void main(String[] args) { > Test test = new Test(); > > test.test1(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 84251
: 17635