RFR: JDK-8025636 Hide lambda proxy frames in stacktraces

Peter Levart peter.levart at gmail.com
Tue Feb 17 16:27:14 UTC 2015


On 02/17/2015 07:54 AM, John Rose wrote:
> On Feb 16, 2015, at 10:33 PM, Staffan Larsen <staffan.larsen at oracle.com> wrote:
>> The first shot at fixing this bug was to filter out ACC_SYNTHETIC. The drawback was that the actual lambda method are marked ACC_SYNTHETIC, so that filtered too much.
> OTOH it seems odd to filter out the actual interface method.
>
> Ideally the back trace should show the name of the interface method and the implementation code of the lambda.
>
> This information is divided between the two frames in question.

That's right. Lambda method is special. It is synthetic, but contains 
user code. So perhaps lambda method could be annotated with a special 
annotation (@SyntheticName) to indicate that the name of the method is 
generated and not interesting, but it's code is written by a programmer 
and is interesting. If this info was included in the StackTraceElement, 
then printing the stack trace could merge the byte code location of such 
element with the class/method name of the subsequent element and print 
both in one line...

The logic behind this is general: if a method name is generated and not 
interesting (the lambda method), then code calling such method must have 
been generated too and is consequently not interesting (the proxy method).

Peter



More information about the compiler-dev mailing list