| Summary: | filter(Objects::nonNull) changes Stream type to <Object> fails cast | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jared Stehler <jared.stehler> |
| Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> |
| Status: | VERIFIED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jared.stehler, manoj.palat |
| Version: | 4.5 | ||
| Target Milestone: | 4.6 M1 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Bug 469753 is also one where lambda block vs lambda expression makes a difference for inference results. I can reproduce in 4.5. This has already been fixed via bug 463728 (4.6 M1). *** This bug has been marked as a duplicate of bug 463728 *** Verified for Eclipse Neon 4.6 M1 Build id: I20150803-2000 |
Only seems to happen when I use braces in the .map lambda: public Stream<String> getStream(List<String> list) { return list.stream() .map(s1 -> { return s1.length() > 3 ? s1 : null; }) .filter(Objects::nonNull); } Description Resource Path Location Type Type mismatch: cannot convert from Stream<Object> to Stream<String> BrokenStreamFilter.java /sandbox/src/main/java/sandbox line 19 Java Problem