You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Kyle Carter (Jira)" <ji...@apache.org> on 2022/01/13 14:51:00 UTC

[jira] [Created] (AVRO-3305) Avro Compiler(s) should only mangle contextual reserved keyword when used in reserved context

Kyle Carter created AVRO-3305:
---------------------------------

             Summary: Avro Compiler(s) should only mangle contextual reserved keyword when used in reserved context
                 Key: AVRO-3305
                 URL: https://issues.apache.org/jira/browse/AVRO-3305
             Project: Apache Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.11.0
            Reporter: Kyle Carter


In AVRO-3116 it was correctly called out that new reserved keywords had been added to the Java language in recent versions that could lead to uncompilable Avro schemas in Java. While the fix developed for that issue does resolve the issue it treats all keywords identically. Some of the keywords (record, yield, var) targeted by that change are only keywords when used in particular contexts, specifically as a type identifier. Nevertheless, the Avro compiler code treats all keywords the same and will mangle them wherever they show up (for example in a package name) even if it would have been valid without mangling (ex: com.example.record).  This can be surprising and result in unnecessary code updates. 

I suggest that these contextual keywords only be mangled when used in the context they are reserved.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)