Hiding the lambda proxy frame
Robert.Field at oracle.com
Tue Jun 11 10:47:19 PDT 2013
Another take on naming, to some extent the "run" call is documenting the
SAM call, or would be with a better name:
StackTraceTest$$Lambda$*Runnable*.run(Unknown Source) <---
not ugly, is it
And that name is stable.
On 6/11/13 9:21 AM, Remi Forax wrote:
> On 06/11/2013 03:22 PM, Brian Goetz wrote:
>> Why wouldn't you bring this to the EG list instead?
> Sure, it was an implementation detail for me, hence the post on
> So from lambda-dev:
> Currently when you print a stacktrace that show a call inside a lambda,
> users can see the the frame corresponding to the method of the generated
> By example:
> StackTraceTest$$Lambda$1.run(Unknown Source) <--- ugly,
> isn't it
> I think this line should not be visible to user, it doesn't provide
> useful information,
> just make the stack trace longer than it should.
> There is an annotation LambdaForm.Hidden that you can use to mark method
> that should be hidden when dumping the stack trace.
> (Maybe the annotation should be a top-level by the way, add John in CC
> he is the creator of this annotation)
> This part was not in the original mail:
> Moreover, offline, one of my friend point me to a presentation of
> Jamie Allen
> on the same subject at JAXConf 2013. I've just finished to see it.
> He raises a good point that the compiler translation should try to
> provide a better name.
> By example,
> Runnable myRunnable = () -> System.out.println("hello");
> should result in a lambda that instead to be called "lambda$0",
> instead the compiler should try to name it something like
> (or lambda$myRunnable0, ..., if there is a collision) if it's possible.
> I think we already discuss about something like that in the light of
> but not in the stack trace context.
More information about the lambda-spec-observers