RFR 8202372: Diagnostic with incorrect line info generated when compiling lambda expression (original) (raw)
Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed May 2 11:19:02 UTC 2018
- Previous message: JDK 11 RFR of 8202334: Update javax.lang.model.util visitors for 11
- Next message: RFR 8202372: Diagnostic with incorrect line info generated when compiling lambda expression
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, I put together a webrev based on the fix that B. Blaser put together few days ago. I've enhanced the test as I realized that the erroneous condition could present in multiple situations (the patch seems to fix all of them).
The underlying issue is that when we create a fake block for the lambda expression (which is needed for speculatively check its contents), we forget setting its position - meaning that all diags reported against the rewritten block will now appear off sync.
One solution would be to tweak the code to never use speculative trees to report diagnostic - but that would be very invasive; a cheaper fix (the one attempted here) is to add the required positional info to the rewritten tree so that it matches the original position.
http://cr.openjdk.java.net/~mcimadamore/8202372/
Cheers Maurizio
- Previous message: JDK 11 RFR of 8202334: Update javax.lang.model.util visitors for 11
- Next message: RFR 8202372: Diagnostic with incorrect line info generated when compiling lambda expression
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]