Summary: | Consider Java 8 impact on Handly API design | ||
---|---|---|---|
Product: | [Technology] Handly | Reporter: | Vladimir Piskarev <pisv> |
Component: | Core | Assignee: | Vladimir Piskarev <pisv> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | Keywords: | api |
Version: | 0.4 | ||
Target Milestone: | 0.4 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Bug Depends on: | |||
Bug Blocks: | 472914, 474023 |
Description
Vladimir Piskarev
2015-07-31 05:35:10 EDT
It is important to note that streams don't mix well with checked exceptions. See for example http://stackoverflow.com/questions/19757300/java-8-lambda-streams-filter-by-method-with-exception Since many Eclipse Platform APIs throw CoreException, this might become quite an issue for stream-oriented processing. This general problem calls for a general solution. I don't (yet) think we can and should address it separately in Handly. Default interface methods would help with evolution of interfaces that clients may implement and could provide convenient "mini-implementations" that don't lock clients into a particular class hierarchy (see bug 474023 for an example of where they would be really useful in Handly). Just a note that streams also don't mix especially well with iterables: http://stackoverflow.com/questions/23114015/why-does-iterablet-not-provide-stream-and-parallelstream-methods A broad perspective on API design with Java 8: https://jarthorn.github.io/EclipseCon2014/java8/ To summarize, I think that default methods in Java 8 could be really useful for Handly. Streams look promising, but unfortunately don't mix well with checked exceptions such as the CoreException omnipresent in Eclipse. We need to adopt Java 8 as soon as it becomes feasible (bug 474391). |