Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JDT Embraces Lambda Expressions - EclipseCon No...

Noopur
March 19, 2014

JDT Embraces Lambda Expressions - EclipseCon North America 2014

Java 8 is coming. It is happening right here. Developers of your favorite Java IDE are participating in shaping this long awaited milestone for the Java ecosystem: On time with the GA of Java 8, JDT will ship its first release with support for developing in Java 8.

If you have a basic understanding of the new features in Java 8, come here and learn how the JDT team mastered the challenges of lifting the Eclipse Java IDE to the next language version.

The main focus of this talk will be on lambda expressions, touching also some changes in the libraries that leverage lambda expressions. We will expose some examples demonstrating the complexity of the language and mention some caveats which should help you avoid some unpleasent surprises.

We will demo how to get started using Java 8 in Eclipse and show the latest tool features for working with lambda expressions including new quick assists etc.

Finally, we'll give a retrospective discussion of the situation of the JDT team, in terms of team changes, contributors, deadlines, interaction with expert groups, with the Eclipse community, and more.

Noopur

March 19, 2014
Tweet

More Decks by Noopur

Other Decks in Programming

Transcript

  1. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 1 Srikanth

    Sankaran IBM India Stephan Herrmann GK Software Noopur Gupta IBM India
  2. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 2 Java

    8 features: JSR335 - Project Lambda  Lambda Expressions & Method References  Extensions to Overload resolution & Type inference  Support for “code carrying” interface methods. JSR308 - Type Annotations JEP120 - Repeating Annotations JEP118 - Method Parameter Reflection JSR269 - Pluggable Annotation Processor API & javax.lang.model API enhancements for Java 8
  3. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 10 LambdaExpression

    ::= LambdaParameters '->' LambdaBody LambdaParameters -> BeginLambda LambdaParameterList LambdaParameterList -> '(' FormalParameterListopt ')„ LambdaBody -> Expression LambdaBody -> Block I i = BeginLambda (x) -> { };
  4. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 15 Scanning

    + Parsing => Parse tree + Resolution => Resolved parse tree + Data/control flow analysis => Flow analyzed parse tree + Code generation => Class files. () -> { throw new Exception(); } is void and value compatible.
  5. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 17 o

    Changes the very notion of a type. o Some subsystems should view @NonNull String != @ReadOnly String o while others should view them as being the same. o Abstractions need to support either world view efficiently. String is a String is a String
  6. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 21 Collectors.<Person,String,Integer>toMap(..)

    Collectors.toMap(..) Collector<String,Integer> coll = new MyCollector<>();
  7. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 29 

    Recipe for disaster: • implement java.util.List → compile against JRE 7 → OK • upgrade to JRE 8 but compile as 1.7  Undefined compiler behavior • 1.7 compiler cannot handle default methods (from .class) • exact answer depends on compiler implementation details • there is no specification • ecj and javac differ • assimilation is difficult
  8. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 48 Far

    too risky to cram late into 8 (Nov 2013)
  9. EclipseCon NA 2014 | JDT Embraces Lambda Expressions 59 Dramatis

    personæ - The usual suspects Jay Arthanareeswaran Deepak Azad Shankha Banerjee Anirban Chakarborty Vikas Chandra Noopur Gupta Ayushman Jain Manju Mathew Manoj Palat Srikanth Sankaran Sarika Sinha Jesper S. Møller Stephan Herrmann Markus Keller Dani Megert Andy Clement Steve Francisco Michael Rennie Olivier Thomann Curtis Windatt Walter Harley David Williams