RFR: JDK-8189796: Incorrect end position for missing statement

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Oct 24 08:08:44 UTC 2017


Looks good - meta-observation: at some point we should (i) make sure 
that all errors generated in the parser go through some uniform routine 
(such as syntaxError) and also that (ii) such routine is updated to use 
the new diagnostic keys instead of strings and varargs.

Maurizio


On 23/10/17 12:50, Jan Lahoda wrote:
> Hi,
>
> Consider code like:
> {
>      if (true)
> }
>
> (i.e. missing statement after "if"). The if statement will get parsed 
> as "if (true) (ERROR);", which appears OK, but the end position for 
> "(ERROR);" and "(ERROR)" is not set. In addition, due to this, the end 
> pos of the error/diagnostic produced is -1.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8189796
> Proposed patch: cr.openjdk.java.net/~jlahoda/8189796/webrev.00/
>
> Thanks,
>      Jan



More information about the compiler-dev mailing list