Bug in javac and eclipse ??

Markus Keller markus_keller at ch.ibm.com
Wed Jan 22 10:36:30 PST 2014


Dan Smith <daniel.smith at oracle.com> wrote on 2014-01-22 18:39:21 to 
lambda-spec-experts at openjdk.java.net (where I can't answer):

> Can you clarify what incorrect assumptions you think were made?  I'm not 
seeing any new information in this thread.
> 
> I've tried to be very clear about where were at: sure, it would be 
convenient to do something here, but it's a complicated space and it 
deserves a lot more analysis before we commit to something.  It's at the 
top of our "potential future enhancements" list.

It's all in 
http://mail.openjdk.java.net/pipermail/lambda-spec-observers/2013-December/000623.html 
.

In 
http://mail.openjdk.java.net/pipermail/lambda-spec-observers/2013-December/000620.html 
, you wrote:
> I've had quite a few discussions about this, and concluded that it is 
best not to do anything until we flesh out a potential "recursive lambda 
expression" feature in the future.  (In 8, local variables initialized 
with lambdas have a similar inability to directly refer to themselves.)

This sounds like you were talking about lambda expressions that want to 
refer to themselves (e.g. by referring to a 'this' that points to the 
lambda or by referring to the target the lambda expression is assigned 
to). But the problem is not such cases.

The problem is cases where a lambda occurs in a field initializer and 
refers to a field of the same class (any field, not only the field that is 
being initialized). This is not a self-reference, but a normal reference 
to a field. There's nothing special about this situation, and 8.3.3 
already handles this fine if the reference occurs in an anonymous class 
that is functionally equivalent to the lambda.

The spec says in a comment: "The restrictions above are designed to catch, 
at compile time, circular or otherwise malformed initializations." The 
situation at hand is not about malformed initializations.

BTW, there's an editing bug in 8.3.3 of java-se-8-jls-fr-diffs.pdf: The 
sentence and bullet list are printed twice.

Markus



More information about the lambda-spec-observers mailing list