Find JSRs
Submit this Search


Ad Banner
 
 
 
 

Summary  |  Proposal  |  Detail (Summary & Proposal)
JSRs: Java Specification Requests
JSR 335: Lambda Expressions for the JavaTM Programming Language

Stage Access Start Finish
Final Release Download page 04 Mar, 2014  
Final Approval Ballot View results 18 Feb, 2014 03 Mar, 2014
Proposed Final Draft Download page 14 Jan, 2014  
Public Review Ballot View results 10 Dec, 2013 23 Dec, 2013
Public Review Download page 04 Nov, 2013 04 Dec, 2013
Early Draft Review 3 Download page 31 Jan, 2013 02 Mar, 2013
Early Draft Review 2 Download page 19 Jun, 2012 19 Jul, 2012
Early Draft Review Download page 15 Nov, 2011 15 Dec, 2011
Expert Group Formation   07 Dec, 2010 01 Aug, 2011
JSR Review Ballot View results 16 Nov, 2010 06 Dec, 2010
Status: Active
JCP version in use: 2.8
Java Specification Participation Agreement version in use: 2.0


Description:
Extend the Java language to support compact lambda expressions (closures), as well as related language and library features to enable the Java SE APIs to use lambda expressions effectively.

Expert Group Transparency:
  Public Communications
  Issue Tracking

Team

Specification Leads
  Brian Goetz Oracle
Expert Group
  Rémi Forax Goldman Sachs & Co.
: Vladimir Zakharov
Google Inc.
: Kevin Bourrillion
  IBM
: Dan Heidinga
IBM
: Srikanth Sankaran
JetBrains s.r.o.
: Andrey Breslav
  Doug Lea Bob Lee Oracle
: Brian Goetz
  Oracle
: Daniel Smith
Samuel Pullara RedHat
: David Lloyd

Updates to the Original JSR

The following information has been updated from the original proposal.

2012.10.23:
JSR 335 has moved to JCP 2.8.

2.19 Please describe the communications channel you have established for the public to observe Expert Group deliberations, provide feedback, and view archives of all Expert Group communications.

We have set up "comments" aliases:
lambda-libs-spec-comments@openjdk.java.net (libraries)
lambda-spec-comments@openjdk.java.net (language)
The archives of these are public.

Expert Group communication archives:
http://mail.openjdk.java.net/pipermail/lambda-spec-experts/ http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/

2.20 What is the URL of the Issue Tracker that the public can read, and how does the public log issues in the Issue Tracker?

http://java.net/jira/browse/JSR_335

2.21 Please provide the location of the publicly accessible document archive you have created for the Expert Group.

http://openjdk.java.net/projects/lambda


Original Java Specification Request (JSR)

Identification | Request | Contributions | Additional Information

Section 1. Identification

Submitting Member: Oracle

Name of Contact Person: Brian Goetz

E-Mail Address: brian.goetz@oracle.com

Telephone Number: +1 408 276 5980

Fax Number: -


Specification Lead: Brian Goetz

E-Mail Address: brian.goetz@oracle.com

Telephone Number: +1 408 276 5980

Fax Number: -


Initial Expert Group Membership:

Oracle
Rémi Forax
IBM
Doug Lea
Bob Lee
SAP

Supporting this JSR:

Oracle
Rémi Forax
IBM
Doug Lea
Bob Lee
SAP



Section 2: Request

2.1 Please describe the proposed Specification:

This JSR will extend the Java Programming Language Specification and the Java Virtual Machine Specification to support the following features:

- Lambda Expressions
- SAM Conversion
- Method References
- Virtual Extension Methods

This JSR may also consider other related language features in support of adding lambda expressions to the Java language.

Supporting changes may be needed in various reflective APIs, including but not limited to java.lang.reflect and javax.lang.model.

Time permitting, this JSR will also explore selected updates to the Java SE core libraries to support a more lambda-friendly style of programming.

2.2 What is the target Java platform? (i.e., desktop, server, personal, embedded, card, etc.)

All platforms.

2.3 The Executive Committees would like to ensure JSR submitters think about how their proposed technology relates to all of the Java platform editions. Please provide details here for which platform editions are being targeted by this JSR, and how this JSR has considered the relationship with the other platform editions.

This JSR targets Java SE 8. Therefore, the languages changes will first be available to the SE and EE platforms. We expect that they will eventually be adopted by the ME platforms.

2.4 Should this JSR be voted on by both Executive Committees?

No; SE/EE EC only.

2.5 What need of the Java community will be addressed by the proposed specification?

Addressing the challenge posed by multicore processors by enabling the creation and consumption of easy to use, multicore-ready libraries.

2.6 Why isn't this need met by existing specifications?

Language extensions are needed to address these issues.

2.7 Please give a short description of the underlying technology or technologies:

We propose extending the Java Language to support compact lambda expressions (otherwise known as closures or anonymous methods.) Additionally, we will extend the language to support a conversion known as "SAM conversion" to allow lambda expressions to be used where a single-abstract-method interface or class is expected, enabling forward compatibility of existing libraries.

We propose extending the semantics of interfaces in the Java Language to support virtual extension methods, whereby an interface can nominate a static default method to stand in for the implementation of an interface method in the event that an implementation class does not provide an implementation of the extension method. This enables interfaces to be augmented with new methods "after the fact" without breaking existing implementation classes.

Time permitting, we will use these features to augment the core Java SE libraries to support a more lambda-friendly style of programming, such as:

      Collection collection = ... ;
      collection.sortBy(#{ Foo f -> f.getLastName() });

or

      collection.remove(#{ Foo f -> f.isBlue() });

This will likely be accompanied by a set of standardized "SAM" types such as Predicate, Filter, Mapper, Reducer, etc.

2.8 Is there a proposed package name for the API Specification? (i.e., javapi.something, org.something, etc.)

New or modified types are expected in the java.lang and java.util packages and subpackages.

2.9 Does the proposed specification have any dependencies on specific operating systems, CPUs, or I/O devices that you know of?

No.

2.10 Are there any security issues that cannot be addressed by the current security model?

None known.

2.11 Are there any internationalization or localization issues?

None beyond localizing new compiler messages.

2.12 Are there any existing specifications that might be rendered obsolete, deprecated, or in need of revision as a result of this work?

The Java Programming Language Specification, and The Java Virtual Machine Specification. Changes to the Java SE APIs are also expected.

2.13 Please describe the anticipated schedule for the development of this specification.

Expert Group formation: January 2011
Early Draft Review: September 2011
Public Review: February 2012
Proposed Final Draft: May 2012
Final Release: November 2012

2.14 Please describe the anticipated working model for the Expert Group working on developing this specification.

A publicly readable mailing list for expert group communication will be the primary working model.

2.15 Provide detailed answers to the transparency checklist, making sure to include URLs as appropriate:

- The public can read the names of the people on the Expert Group.

We intend this to be the case.

- The Expert Group business is regularly reported on a publicly readable alias.

We intend this to be the case.

- The schedule for the JSR is publicly available, it's current, and I update it regularly.

We intend this to be the case.

- The public can read/write to a wiki for my JSR.

Rather than a wiki which the Expert Group must take time out to visit, we intend to implement a pair of mailing lists following the approach of JSR 294 and JSR 330. First, Expert Group business will be carried out on a mailing list dedicated to Expert Group members. Second, an "observer" mailing list which anyone may join will receive the traffic of the Expert Group list. The observer list allows the public to follow Expert Group business, and is writable to allow the public to make comments for other observers to see and make further comment on. Expert Group members are under no obligation to join the observer list and partake in public discussion. In addition to these lists we will maintain a private Expert-Group-only list for administrative and other non-technical traffic.

- I read and respond to posts on the discussion board for my JSR on jcp.org.

In lieu of tracking the jcp.org discussion board, and in light of the considerable public attention that the observer list is likely to receive, the Specification Lead (or his designates) will read the observer list and respond directly as appropriate.

- There is an issue-tracker for my JSR that the public can read.

We intend this to be the case.

- I have spoken at conferences and events about my JSR recently.

Yes; in 2010 Project Lambda was discussed in depth at the JavaOne, JAOO, QCon, and SPLASH conferences.

- I am using open-source processes for the development of the RI and/or TCK.

The source code for the Reference Implementation is being developed in Project Lambda within the OpenJDK Community (http://openjdk.java.net/projects/lambda), where many of the features described here have already been prototyped. We intend eventually to provide weekly and milestone binary builds for anyone to test and review. We intend to continue this practice as we move toward the Final Release.

- The Update tab for my JSR has links to and information about all public communication mechanisms and sites for the development of my JSR.

We intend this to be the case.

2.16 Please describe how the RI and TCK will de delivered, i.e. as part of a profile or platform edition, or stand-alone, or both. Include version information for the profile or platform in your answer.

The RI and TCK will be part of the RI and TCK for Java SE 8.

2.17 Please state the rationale if previous versions are available stand-alone and you are now proposing in 2.13 to only deliver RI and TCK as part of a profile or platform edition (See sections 1.1.5 and 1.1.6 of the JCP 2 document).

Not applicable.

2.18 Please provide a description of the business terms for the Specification, RI and TCK that will apply when this JSR is final.

The licenses for the specification, RI, and TCK will be the same as for Java SE 8.





Section 3: Contributions

3.1 Please list any existing documents, specifications, or implementations that describe the technology. Please include links to the documents if they are publicly available.

This JSR builds on the work done in as part of the OpenJDK Project Lambda effort:
http://openjdk.java.net/projects/lambda/
http://mail.openjdk.java.net/mailman/listinfo/lambda-dev

In particular, the current design is captured in the following documents:
http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-3.html
http://cr.openjdk.java.net/~briangoetz/lambda/Defender%20Methods%20v3.pdf

The anticipated implementation strategy requires the use of Method Handles and dynamic invocation as specified in JSR 292.

3.2 Explanation of how these items might be used as a starting point for the work.

The design for lambda expressions and related features (SAM conversion, target typing, exception transparency, and virtual extension methods) has been widely circulated and reviewed, and a prototype implementation is available in OpenJDK Project Lambda. These design documents shall serve as the basis for the initial specification for the language features of this JSR, and the prototype implementation shall serve as the basis for the reference implementation.

Expert group members are expected to be generally familiar with the discussions that have taken place on the Project Lambda list, and agree in principle with the design outlined in the most recent State of the Lambda summary (see links in section 3.1.).