RFR: JDK-8238838: spurious error message for compact constructors with throws clause

Vicente Romero vicente.romero at oracle.com
Thu Feb 13 04:43:17 UTC 2020


On 2/11/20 3:35 PM, Vicente Romero wrote:
> Hi,
> Please review the fix for [1] at [2]. The fix is oriented at showing a 
> friendlier error message in case a throws clause is declared in a 
> compact constructor. We already issue an error for this case for 
> canonical constructors so the same support could be expected for 
> compact ones. I had to modify the arguments for a generic error 
> message used for compact and canonical constructors as the error for 
> canonical constructors is shown in Attr while the error for compact is 
> shown in the parser. This is because the syntax for compact 
> constructors doesn't expect anything between the constructor's name 
> and its body. As at parser time there are no symbols in the ASTs I 
> changed a parameter for the generic error message from `symbol` to 
> `name`. This change has provoked that other error logging related to 
> constructors had to be changed.
> Thanks,
> Vicente
> [1] https://bugs.openjdk.java.net/browse/JDK-8238838
> [2] http://cr.openjdk.java.net/~vromero/8238838/webrev.00/

More information about the compiler-dev mailing list