RFR 8172443: Change use of tree.pos to line:col in rawDiagnostics

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Oct 5 13:51:56 UTC 2017



On 05/10/17 14:49, Vicente Romero wrote:
> Hi,
>
> +100 to this effort, that will save us a lot of time. Regarding the 
> patch, sometimes new lines need to be added to a test, sometimes in 
> the jtreg header, sometimes somewhere else. How bad would be to use 
> the column number only instead of line:col?
I understand the concern. I think the goal of this patch is to fix the 
#1 offender. As you say there could be other offenders. But getting rid 
of them all is hard - if you just use 'col' you basically lose 
uniqueness, which makes looking at the golden file more obscure, I think.

Maurizio
>
> Thanks,
> Vicente
>
> On 10/05/2017 09:29 AM, 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