JDK-7115044 : Umbrella: Add support for lambda expressions
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2011-11-23
  • Updated: 2013-11-20
  • Resolved: 2013-07-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-7115046 :  
JDK-7115049 :  
JDK-7115050 :  
JDK-7115052 :  
JDK-7129801 :  
JDK-7132880 :  
JDK-7133185 :  
JDK-7133238 :  
JDK-7143880 :  
JDK-7144506 :  
JDK-7148164 :  
JDK-7148622 :  
JDK-7151492 :  
JDK-7151580 :  
JDK-7154127 :  
JDK-7166552 :  
JDK-7175433 :  
JDK-7175538 :  
JDK-7175911 :  
JDK-7177385 :  
JDK-7177386 :  
JDK-7177387 :  
JDK-7187104 :  
JDK-7188968 :  
JDK-7192245 :  
JDK-7192246 :  
JDK-7193913 :  
JDK-7194586 :  
JDK-8000694 :  
JDK-8000806 :  
JDK-8001053 :  
JDK-8002099 :  
JDK-8003280 :  
JDK-8004099 :  
JDK-8004101 :  
JDK-8004102 :  
JDK-8004105 :  
JDK-8005166 :  
JDK-8005172 :  
JDK-8005179 :  
JDK-8005184 :  
JDK-8005243 :  
JDK-8005244 :  
JDK-8005851 :  
JDK-8005852 :  
JDK-8005853 :  
JDK-8005854 :  
JDK-8007462 :  
JDK-8007464 :  
JDK-8007479 :  
Description
Add support for lambda expression/method references to the Java compiler. The functionalities to be added are described in this public document:

http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-3.html

And, also, in the public JSR 335 EDR, available at the following URL:

http://jcp.org/aboutJava/communityprocess/edr/jsr335/index.html

Comments
Tighter handling of raw types means more return types are erased. After the subtask "Attr.checkMethod should be called after inference variables have been fixed" in this umbrella project has been applied, programs like: --------------------------------------------------------------------------------------------- import java.util.List; class ReproOne { static class Baz<T> { public static List<Baz<Object>> getElements(Baz<Object> transcoder) { return null; } } private static void bar(Baz arg) { Baz element = Baz.getElements(arg).get(0); } } //based on a code provided by cushon@google.com at compiler-dev list ------------------------------------------------------------------------------------- which is accepted with warnings by javac 7, are not accepted anymore by javac 8. The javac 8 output for this code is: ReproOne.java:12: error: incompatible types: Object cannot be converted to Baz Baz element = Baz.getElements(arg).get(0); ^ Note: ReproOne.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error What is happening here is that a raw type is being passed to the getElements(Baz<Object>) method which is applicable by subtyping (see the JLS, Java SE 7 Edition, section 15.12.2.2), so an unchecked conversion is necessary for the method to be applicable, so it's return type is erased (see the JLS, Java SE 7 Edition, section 15.12.2.6), in this case the return type of getElements(Baz<Object>) will be java.util.List instead of java.util.List<Baz<Object>> and thus the return type of get(int) will be Object which is not assignment-compatible with Baz. The original discussion and more examples can be found at: http://mail.openjdk.java.net/pipermail/compiler-dev/2013-October/007726.html
08-11-2013

Lambda and method references are now in TL. We can close this tracking issue.
05-07-2013

This issue seems to be triggered a lot more frequently when lambda support is enabled
28-09-2012