[ 
https://issues.apache.org/jira/browse/AVRO-2571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16939874#comment-16939874
 ] 

Daniel Shuy commented on AVRO-2571:
-----------------------------------

{quote}Public is a modifier and cannot be used as a package name.
 Java keywords have special meaning for java compilers. They are used to 
represent a data type, or to represent the structure of a program. Keywords 
cannot be used as variable names, method names, class names, or package names.
{quote}
Yes, that's why I'm requesting for the *avro-maven-plugin* to escape keywords 
like *public*, eg. by renaming *public* as *_public*.

 
{quote}I think avro should not want to break the java syntax specification, 
maybe you can change the name.
{quote}
Sometimes it is outside the control of the consumer to modify the schema. Thing 
is, Avro schemas should be programming language agnostic (since a consumer can 
be written in any one of the many programming languages Avro supports, not just 
Java). *public* is not a reserved keyword in Avro, so the producer should not 
be expected to know to avoid using that keyword. The producer should also not 
have to know what technology the consumer is using (else it violates the 
Producer/Consumer pattern).

> avro-maven-plugin not escaping "public" keyword in namespace
> ------------------------------------------------------------
>
>                 Key: AVRO-2571
>                 URL: https://issues.apache.org/jira/browse/AVRO-2571
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.9.0
>            Reporter: Daniel Shuy
>            Priority: Major
>
> If the avro schema namespace contains the word *public*, the generated Java 
> source file will fail to compile, because *public* is a reserved keyword in 
> Java.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to