RFR 8172443: Change use of tree.pos to line:col in rawDiagnostics
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Thu Oct 5 15:33:34 UTC 2017
Hi,
I managed to find a cheap way to address the concerns w/o altering how
diagnostic arguments are communicated to the backend - revised webrev here:
http://cr.openjdk.java.net/~mcimadamore/8172443_v2/
Basically we compare the expression line number with the root diagnostic
line number, and if they are the same we omit that one.
There's only one case where line number is needed:
http://cr.openjdk.java.net/~mcimadamore/8172443_v2/test/langtools/tools/javac/T8024207/FlowCrashTest.out.udiff.html
Cheers
Maurizio
On 05/10/17 14:29, Maurizio Cimadamore wrote:
> Hi,
> this is a fix to our raw diagnostic machinery that will allow for more
> robust compiler negative tests. Currently, when a functional
> expression is found in a diagnostic, it can sometimes be represented
> using the absoluted cursor position of the expression in the source
> file. This makes the golden files for such tests extremely unreliable,
> as simply adding/removing chars from lines before the functional
> expression would result in golden file mismatches. This is extremely
> annoying when e.g. the jtreg header of a test must be change for some
> reason (e.g. to add an extra bug id).
>
> The solution is to use a more robust encoding with line:col - so that
> there's less dependencies on what happens on previous lines.
>
> http://cr.openjdk.java.net/~mcimadamore/8172443/
>
> Cheers
> Maurizio
>
More information about the compiler-dev
mailing list