[
https://issues.apache.org/jira/browse/AVRO-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17656605#comment-17656605
]
ASF subversion and git services commented on AVRO-3698:
-------------------------------------------------------
Commit b3535df88abd93b7a8e48980831b09ccbb980fd0 in avro's branch
refs/heads/branch-1.11 from 정승현
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=b3535df88 ]
AVRO-3698: SpecificData.getClassName must replace reserved words (#2048)
(cherry picked from commit d87a99d532719ba6f619ba68e07dbaa77fe4f84e)
> [Java] SpecificData.getClassName must replace reserved words
> ------------------------------------------------------------
>
> Key: AVRO-3698
> URL: https://issues.apache.org/jira/browse/AVRO-3698
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.11.1
> Reporter: Seung-Hyun Cheong
> Priority: Major
> Labels: newbie, patch, pull-request-available
> Fix For: 1.11.2
>
> Attachments: AVRO-3698.patch
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> [Java] SpecificData.getClassName must replace reserved words
>
> When makes Java Class, SpecificCompiler adds "$" after reserved words like
> public, new, etc...
> [https://github.com/apache/avro/blob/master/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java#L1129]
> [https://github.com/apache/avro/blob/master/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java#L643]
>
> For example, if the namespace of a schema is {*}db.public.table{*}, then the
> package name of the generated Java Class, made by SpecificCompiler, is
> {*}db.public$.table{*}. (Because *public* is a reserved word in java)
>
> But when deserializes an Avro Record to a SpecificRecord,
> SpecificData.getClassName returns {*}db.pulic.table.Name{*}.
>
> So, it can't find a class by name from SpecificData.getClassName.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)