RFR: JDK-8236544: Confusing javac message: return type of accessor method abc() is not compatible with type of record component number

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Jan 3 01:26:59 UTC 2020

Looks good - consider flipping from negative to positive, and replacing 
"identical" with "match", as in:

"return type of accessor method {0} must match the type of record 
component {1}"

If you go down this path, I see this other key that uses related wording 
(and you might update that to, to use 'match'):

3501 compiler.misc.type.must.be.identical.to.corresponding.record.component.type=\
3502     type must be identical to corresponding record component type\


"type must match that of the corresponding record component"

(bringing this up because the "identical" word appears nowhere else in 
the javac error messages)


On 02/01/2020 19:42, Vicente Romero wrote:
> Hi,
> Please review this very simple change to an error message related to 
> records. The patch makes the error message more specific as the spec 
> doesn't allow an accessor method to declare a return type other than 
> the same declared by the corresponding record component. The current 
> error message is referring to compatibility between types instead of 
> exact match which is what the spec allows,
> Thanks,
> Vicente
> http://cr.openjdk.java.net/~vromero/8236544/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8236544
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20200103/8dadb89a/attachment.htm>

More information about the compiler-dev mailing list