Skip to content

Commit

Permalink
Clarify how annotation copying works when @CopyAnnotations is not pre…
Browse files Browse the repository at this point in the history
…sent.

RELNOTES=Clarified how annotation copying works when @CopyAnnotations is not present.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194936797
  • Loading branch information
eamonnmcmanus authored and ronshapiro committed May 2, 2018
1 parent c830cf2 commit 0808746
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions value/src/main/java/com/google/auto/value/AutoValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
* {@link java.lang.annotation.Inherited} meta-annotation.
* </ol>
*
* <p>For historical reasons, annotations are always copied from an {@code @AutoValue} property
* method to its implementation, unless {@code @CopyAnnotations} is present and explicitly
* {@linkplain CopyAnnotations#exclude excludes} that annotation. But annotations are not copied
* from the {@code @AutoValue} class itself to its implementation unless {@code @CopyAnnotations}
* is present.
*
* <p>When the <i>type</i> of an {@code @AutoValue} property method has annotations, those are
* part of the type, so they are always copied to the implementation of the method.
* {@code @CopyAnnotations} has no effect here. For example, suppose {@code @Confidential} is a
Expand Down

0 comments on commit 0808746

Please sign in to comment.