You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Olli Salonen (JIRA)" <ji...@apache.org> on 2019/01/07 13:33:00 UTC

[jira] [Updated] (AVRO-2298) Specific Avro compiler does not annotate generated Builder class with AvroGenerated

     [ https://issues.apache.org/jira/browse/AVRO-2298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olli Salonen updated AVRO-2298:
-------------------------------
    Description: 
According to current [AvroGenerated documentation|[https://avro.apache.org/docs/1.8.2/api/java/org/apache/avro/specific/AvroGenerated.html]]
{quote}All Avro generated classes will be annotated with this annotation.
{quote}
However, the nested Builder class that the specific Avro compiler generates does not get annotated with AvroGenerated or any user specified javaAnnotations. The Builder template is missing annotation generation as can be seen in the [template file on Github|[https://github.com/apache/avro/blob/7ed38d7c7e150987ef8bf035196576fc158e03eb/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm#L296]]

This has implications for tools relying on Generated annotations, such as test coverage tools like JaCoCo, which can ignore the generated SpecificRecord class but not the nested SpecificBuilder class as a result. [Here is one JaCoCo bug describing the issue|https://github.com/jacoco/jacoco/issues/814].

  was:
According to current [AvroGenerated documentation|[https://avro.apache.org/docs/1.8.2/api/java/org/apache/avro/specific/AvroGenerated.html],]
{quote}All Avro generated classes will be annotated with this annotation.
{quote}
However, the nested Builder class that the specific Avro compiler generates does not get annotated with AvroGenerated or any user specified javaAnnotations. The Builder template is missing annotation generation as can be seen in the [template file on Github|[https://github.com/apache/avro/blob/7ed38d7c7e150987ef8bf035196576fc158e03eb/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm#L296].]

This has implications for tools relying on Generated annotations, such as test coverage tools like JaCoCo, which can ignore the generated SpecificRecord class but not the nested SpecificBuilder class as a result. [Here is one JaCoCo bug describing the issue|https://github.com/jacoco/jacoco/issues/814].


> Specific Avro compiler does not annotate generated Builder class with AvroGenerated
> -----------------------------------------------------------------------------------
>
>                 Key: AVRO-2298
>                 URL: https://issues.apache.org/jira/browse/AVRO-2298
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.2
>            Reporter: Olli Salonen
>            Priority: Major
>
> According to current [AvroGenerated documentation|[https://avro.apache.org/docs/1.8.2/api/java/org/apache/avro/specific/AvroGenerated.html]]
> {quote}All Avro generated classes will be annotated with this annotation.
> {quote}
> However, the nested Builder class that the specific Avro compiler generates does not get annotated with AvroGenerated or any user specified javaAnnotations. The Builder template is missing annotation generation as can be seen in the [template file on Github|[https://github.com/apache/avro/blob/7ed38d7c7e150987ef8bf035196576fc158e03eb/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm#L296]]
> This has implications for tools relying on Generated annotations, such as test coverage tools like JaCoCo, which can ignore the generated SpecificRecord class but not the nested SpecificBuilder class as a result. [Here is one JaCoCo bug describing the issue|https://github.com/jacoco/jacoco/issues/814].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)